src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java
author darcy
Wed, 25 Sep 2019 09:37:18 -0700
changeset 58338 faf791c5a710
parent 54106 9a90236ab64c
permissions -rw-r--r--
8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3843
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3843
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3843
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3843
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3843
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql.rowset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.math.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.sql.rowset.serial.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * An abstract class providing a <code>RowSet</code> object with its basic functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * The basic functions include having properties and sending event notifications,
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 18156
diff changeset
    40
 * which all JavaBeans&trade; components must implement.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    41
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
    42
 * <h2>1.0 Overview</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * The <code>BaseRowSet</code> class provides the core functionality
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * for all <code>RowSet</code> implementations,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * and all standard implementations <b>may</b> use this class in combination with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * one or more <code>RowSet</code> interfaces in order to provide a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * vendor-specific implementation.  To clarify, all implementations must implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * at least one of the <code>RowSet</code> interfaces (<code>JdbcRowSet</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <code>CachedRowSet</code>, <code>JoinRowSet</code>, <code>FilteredRowSet</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * or <code>WebRowSet</code>). This means that any implementation that extends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * the <code>BaseRowSet</code> class must also implement one of the <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * The <code>BaseRowSet</code> class provides the following:
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    55
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <LI><b>Properties</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *     <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *     <li>Fields for storing current properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *     <li>Methods for getting and setting properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *     </ul>
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    62
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <LI><b>Event notification</b>
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    64
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <LI><b>A complete set of setter methods</b> for setting the parameters in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *      <code>RowSet</code> object's command
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    67
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * <LI> <b>Streams</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *  <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *  <li>Fields for storing stream instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *  <li>Constants for indicating the type of a stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *  </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
    75
 * <h2>2.0 Setting Properties</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * All rowsets maintain a set of properties, which will usually be set using
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * a tool.  The number and kinds of properties a rowset has will vary,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * depending on what the <code>RowSet</code> implementation does and how it gets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * its data.  For example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * rowsets that get their data from a <code>ResultSet</code> object need to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * set the properties that are required for making a database connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * If a <code>RowSet</code> object uses the <code>DriverManager</code> facility to make a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * connection, it needs to set a property for the JDBC URL that identifies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * appropriate driver, and it needs to set the properties that give the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * user name and password.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * If, on the other hand, the rowset uses a <code>DataSource</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * to make the connection, which is the preferred method, it does not need to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * set the property for the JDBC URL.  Instead, it needs to set the property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * for the logical name of the data source along with the properties for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * the user name and password.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * NOTE:  In order to use a <code>DataSource</code> object for making a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * connection, the <code>DataSource</code> object must have been registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * with a naming service that uses the Java Naming and Directory
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 18156
diff changeset
    95
 * Interface&trade; (JNDI) API.  This registration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * is usually done by a person acting in the capacity of a system administrator.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    97
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
    98
 * <h2>3.0 Setting the Command and Its Parameters</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * When a rowset gets its data from a relational database, it executes a command (a query)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * that produces a <code>ResultSet</code> object.  This query is the command that is set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * for the <code>RowSet</code> object's command property.  The rowset populates itself with data by reading the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * data from the <code>ResultSet</code> object into itself. If the query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * contains placeholders for values to be set, the <code>BaseRowSet</code> setter methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * are used to set these values. All setter methods allow these values to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * to <code>null</code> if required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * The following code fragment illustrates how the
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 18156
diff changeset
   108
 * <code>CachedRowSet</code>&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * object <code>crs</code> might have its command property set.  Note that if a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * tool is used to set properties, this is the code that the tool would use.
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   111
 * <PRE>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *    crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *                   "WHERE CREDIT_LIMIT > ? AND REGION = ?");
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   114
 * }</PRE>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 * In this example, the values for <code>CREDIT_LIMIT</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * <code>REGION</code> are placeholder parameters, which are indicated with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * question mark (?).  The first question mark is placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * <code>1</code>, the second question mark is placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * <code>2</code>, and so on.  Any placeholder parameters must be set with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * values before the query can be executed. To set these
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * placeholder parameters, the <code>BaseRowSet</code> class provides a set of setter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * methods, similar to those provided by the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * interface, for setting values of each data type.  A <code>RowSet</code> object stores the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * parameter values internally, and its <code>execute</code> method uses them internally
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * to set values for the placeholder parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * before it sends the command to the DBMS to be executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * The following code fragment demonstrates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * setting the two parameters in the query from the previous example.
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   131
 * <PRE>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *    crs.setInt(1, 5000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 *    crs.setString(2, "West");
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   134
 * }</PRE>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 * If the <code>execute</code> method is called at this point, the query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * sent to the DBMS will be:
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   137
 * <PRE>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 *    "SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 *                   "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'"
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   140
 * }</PRE>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * NOTE: Setting <code>Array</code>, <code>Clob</code>, <code>Blob</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * <code>Ref</code> objects as a command parameter, stores these values as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * <code>SerialArray</code>, <code>SerialClob</code>, <code>SerialBlob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * and <code>SerialRef</code> objects respectively.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
   146
 * <h2>4.0 Handling of Parameters Behind the Scenes</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 * NOTE: The <code>BaseRowSet</code> class provides two kinds of setter methods,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 * those that set properties and those that set placeholder parameters. The setter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 * methods discussed in this section are those that set placeholder parameters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 * The placeholder parameters set with the <code>BaseRowSet</code> setter methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 * are stored as objects in an internal <code>Hashtable</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 * Primitives are stored as their <code>Object</code> type. For example, <code>byte</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 * is stored as <code>Byte</code> object, and <code>int</code> is stored as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 * an <code>Integer</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * When the method <code>execute</code> is called, the values in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 * <code>Hashtable</code> object are substituted for the appropriate placeholder
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 * parameters in the command.
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
   160
 * <P>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 * A call to the method <code>getParams</code> returns the values stored in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 * <code>Hashtable</code> object as an array of <code>Object</code> instances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 * An element in this array may be a simple <code>Object</code> instance or an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 * array (which is a type of <code>Object</code>). The particular setter method used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 * determines whether an element in this array is an <code>Object</code> or an array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 * The majority of methods for setting placeholder parameters take two parameters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 *  with the first parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 * indicating which placeholder parameter is to be set, and the second parameter
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
   170
 * giving the value to be set.  Methods such as <code>setInt</code>,
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
   171
 * <code>setString</code>, <code>setBoolean</code>, and <code>setLong</code> fall into
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
 * this category.  After these methods have been called, a call to the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
 * <code>getParams</code> will return an array with the values that have been set. Each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
 * element in the array is an <code>Object</code> instance representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
 * values that have been set. The order of these values in the array is determined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 * <code>int</code> (the first parameter) passed to the setter method. The values in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
 * array are the values (the second parameter) passed to the setter method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * In other words, the first element in the array is the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * to be set for the first placeholder parameter in the <code>RowSet</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 * command. The second element is the value to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * be set for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 * Several setter methods send the driver and DBMS information beyond the value to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 * When the method <code>getParams</code> is called after one of these setter methods has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 * been used, the elements in the array will themselves be arrays to accommodate the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 * additional information. In this category, the method <code>setNull</code> is a special case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 * because one version takes only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 * two parameters (<code>setNull(int parameterIndex, int SqlType)</code>). Nevertheless,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 * it requires
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 * an array to contain the information that will be passed to the driver and DBMS.  The first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 * element in this array is the value to be set, which is <code>null</code>, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 * second element is the <code>int</code> supplied for <i>sqlType</i>, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 * indicates the type of SQL value that is being set to <code>null</code>. This information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 * is needed by some DBMSs and is therefore required in order to ensure that applications
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 * are portable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 * The other version is intended to be used when the value to be set to <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 * is a user-defined type. It takes three parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 * (<code>setNull(int parameterIndex, int sqlType, String typeName)</code>) and also
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 * requires an array to contain the information to be passed to the driver and DBMS.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 * The first two elements in this array are the same as for the first version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 * <code>setNull</code>.  The third element, <i>typeName</i>, gives the SQL name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 * the user-defined type. As is true with the other setter methods, the number of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 * placeholder parameter to be set is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * returned by <code>getParams</code>.  So, for example, if the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 * supplied to <code>setNull</code> is <code>2</code>, the second element in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 * returned by <code>getParams</code> will be an array of two or three elements.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 * Some methods, such as <code>setObject</code> and <code>setDate</code> have versions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 * that take more than two parameters, with the extra parameters giving information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 * to the driver or the DBMS. For example, the methods <code>setDate</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 * <code>setTime</code>, and <code>setTimestamp</code> can take a <code>Calendar</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 * object as their third parameter.  If the DBMS does not store time zone information,
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20880
diff changeset
   213
 * the driver uses the <code>Calendar</code> object to construct the <code>Date</code>,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 * <code>Time</code>, or <code>Timestamp</code> object being set. As is true with other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * methods that provide additional information, the element in the array returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 * by <code>getParams</code> is an array instead of a simple <code>Object</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 * The methods <code>setAsciiStream</code>, <code>setBinaryStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 * <code>setCharacterStream</code>, and <code>setUnicodeStream</code> (which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 * deprecated, so applications should use <code>getCharacterStream</code> instead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 * take three parameters, so for them, the element in the array returned by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * <code>getParams</code> is also an array.  What is different about these setter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * methods is that in addition to the information provided by parameters, the array contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 * one of the <code>BaseRowSet</code> constants indicating the type of stream being set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
* <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
* NOTE: The method <code>getParams</code> is called internally by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
* <code>RowSet</code> implementations extending this class; it is not normally called by an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
* application programmer directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
*
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
   230
* <h2>5.0 Event Notification</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
* The <code>BaseRowSet</code> class provides the event notification
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
* mechanism for rowsets.  It contains the field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
* <code>listeners</code>, methods for adding and removing listeners, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
* methods for notifying listeners of changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
* <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
* A listener is an object that has implemented the <code>RowSetListener</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
* If it has been added to a <code>RowSet</code> object's list of listeners, it will be notified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
*  when an event occurs on that <code>RowSet</code> object.  Each listener's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
* implementation of the <code>RowSetListener</code> methods defines what that object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
* will do when it is notified that an event has occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
* <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
* There are three possible events for a <code>RowSet</code> object:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
* <OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
* <LI>the cursor moves
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
* <LI>an individual row is changed (updated, deleted, or inserted)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
* <LI>the contents of the entire <code>RowSet</code> object  are changed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
* </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
* <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
* The <code>BaseRowSet</code> method used for the notification indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
* type of event that has occurred.  For example, the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
* <code>notifyRowChanged</code> indicates that a row has been updated,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
* deleted, or inserted.  Each of the notification methods creates a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
* <code>RowSetEvent</code> object, which is supplied to the listener in order to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
* identify the <code>RowSet</code> object on which the event occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
* What the listener does with this information, which may be nothing, depends on how it was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
* implemented.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
   257
*
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 52902
diff changeset
   258
* <h2>6.0 Default Behavior</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
* A default <code>BaseRowSet</code> object is initialized with many starting values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
* The following is true of a default <code>RowSet</code> instance that extends
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
* the <code>BaseRowSet</code> class:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
* <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
*   <LI>Has a scrollable cursor and does not show changes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
*       made by others.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
*   <LI>Is updatable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
*   <LI>Does not show rows that have been deleted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
*   <LI>Has no time limit for how long a driver may take to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
*       execute the <code>RowSet</code> object's command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
*   <LI>Has no limit for the number of rows it may contain.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
*   <LI>Has no limit for the number of bytes a column may contain. NOTE: This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
*   limit applies only to columns that hold values of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
*   following types:  <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
*   <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
*   and <code>LONGVARCHAR</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
*   <LI>Will not see uncommitted data (make "dirty" reads).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
*   <LI>Has escape processing turned on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
*   <LI>Has its connection's type map set to <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
*   <LI>Has an empty <code>Vector</code> object for storing the values set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
*       for the placeholder parameters in the <code>RowSet</code> object's command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
* </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
* <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
* If other values are desired, an application must set the property values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
* explicitly. For example, the following line of code sets the maximum number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
* of rows for the <code>CachedRowSet</code> object <i>crs</i> to 500.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
* <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
*    crs.setMaxRows(500);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
* </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
* Methods implemented in extensions of this <code>BaseRowSet</code> class <b>must</b> throw an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
* <code>SQLException</code> object for any violation of the defined assertions.  Also, if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
* extending class overrides and reimplements any <code>BaseRowSet</code> method and encounters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
* connectivity or underlying data source issues, that method <b>may</b> in addition throw an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
* <code>SQLException</code> object for that reason.
24968
3308660aa3f2 8046389: Add missing @since tag under javax.sql.**
henryjen
parents: 24197
diff changeset
   294
*
3308660aa3f2 8046389: Add missing @since tag under javax.sql.**
henryjen
parents: 24197
diff changeset
   295
* @since 1.5
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
public abstract class BaseRowSet implements Serializable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   300
    /**
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   301
     * A constant indicating to a <code>RowSetReaderImpl</code> object
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   302
     * that a given parameter is a Unicode stream. This
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   303
     * <code>RowSetReaderImpl</code> object is provided as an extension of the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   304
     * <code>SyncProvider</code> abstract class defined in the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   305
     * <code>SyncFactory</code> static factory SPI mechanism.
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   306
     */
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   307
    public static final int UNICODE_STREAM_PARAM = 0;
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   308
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   309
    /**
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   310
     * A constant indicating to a <code>RowSetReaderImpl</code> object
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   311
     * that a given parameter is a binary stream. A
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   312
     * <code>RowSetReaderImpl</code> object is provided as an extension of the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   313
     * <code>SyncProvider</code> abstract class defined in the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   314
     * <code>SyncFactory</code> static factory SPI mechanism.
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   315
     */
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   316
    public static final int BINARY_STREAM_PARAM = 1;
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   317
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   318
    /**
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   319
     * A constant indicating to a <code>RowSetReaderImpl</code> object
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   320
     * that a given parameter is an ASCII stream. A
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   321
     * <code>RowSetReaderImpl</code> object is provided as an extension of the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   322
     * <code>SyncProvider</code> abstract class defined in the
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   323
     * <code>SyncFactory</code> static factory SPI mechanism.
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   324
     */
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   325
    public static final int ASCII_STREAM_PARAM = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * The <code>InputStream</code> object that will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * returned by the method <code>getBinaryStream</code>, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * specified in the <code>ResultSet</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     */
58338
faf791c5a710 8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules
darcy
parents: 54106
diff changeset
   333
    @SuppressWarnings("serial") // Not statically typed as Serializable
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    protected java.io.InputStream binaryStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * The <code>InputStream</code> object that will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * returned by the method <code>getUnicodeStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * which is specified in the <code>ResultSet</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     */
58338
faf791c5a710 8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules
darcy
parents: 54106
diff changeset
   342
    @SuppressWarnings("serial") // Not statically typed as Serializable
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    protected java.io.InputStream unicodeStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * The <code>InputStream</code> object that will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * returned by the method <code>getAsciiStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * which is specified in the <code>ResultSet</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     */
58338
faf791c5a710 8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules
darcy
parents: 54106
diff changeset
   351
    @SuppressWarnings("serial") // Not statically typed as Serializable
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    protected java.io.InputStream asciiStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * The <code>Reader</code> object that will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * returned by the method <code>getCharacterStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * which is specified in the <code>ResultSet</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     */
58338
faf791c5a710 8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules
darcy
parents: 54106
diff changeset
   360
    @SuppressWarnings("serial") // Not statically typed as Serializable
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    protected java.io.Reader charStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * The query that will be sent to the DBMS for execution when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    private String command;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * The JDBC URL the reader, writer, or both supply to the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * <code>DriverManager.getConnection</code> when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * <code>DriverManager</code> is used to get a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * <P>
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
   375
     * The JDBC URL identifies the driver to be used to make the connection.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * This URL can be found in the documentation supplied by the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * vendor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    private String URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * The logical name of the data source that the reader/writer should use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * in order to retrieve a <code>DataSource</code> object from a Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * Directory and Naming Interface (JNDI) naming service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    private String dataSource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * The user name the reader, writer, or both supply to the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * <code>DriverManager.getConnection</code> when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * <code>DriverManager</code> is used to get a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    private transient String username;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * The password the reader, writer, or both supply to the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * <code>DriverManager.getConnection</code> when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * <code>DriverManager</code> is used to get a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    private transient String password;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * A constant indicating the type of this JDBC <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * object. It must be one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * constants:  <code>TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * <code>TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * <code>TYPE_SCROLL_SENSITIVE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    private int rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * A <code>boolean</code> indicating whether deleted rows are visible in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * JDBC <code>RowSet</code> object .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    private boolean showDeleted = false; // default is false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * The maximum number of seconds the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * will wait for a command to execute.  This limit applies while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * this JDBC <code>RowSet</code> object is connected to its data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * source, that is, while it is populating itself with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * data and while it is writing data back to the data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    private int queryTimeout = 0; // default is no timeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * The maximum number of rows the reader should read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    private int maxRows = 0; // default is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * The maximum field size the reader should read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    private int maxFieldSize = 0; // default is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * A constant indicating the concurrency of this JDBC <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * object. It must be one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * constants: <code>CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * <code>CONCUR_UPDATABLE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    private int concurrency = ResultSet.CONCUR_UPDATABLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * A <code>boolean</code> indicating whether this JDBC <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * object is read-only.  <code>true</code> indicates that it is read-only;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * <code>false</code> that it is writable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    private boolean readOnly;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * A <code>boolean</code> indicating whether the reader for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * JDBC <code>RowSet</code> object should perform escape processing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * <code>true</code> means that escape processing is turned on;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * <code>false</code> that it is not. The default is <code>true</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     */
27776
b2ddbbc58706 8066188: BaseRowSet default value for escape processing is not correct
lancea
parents: 25991
diff changeset
   469
    private boolean escapeProcessing = true;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * A constant indicating the isolation level of the connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * for this JDBC <code>RowSet</code> object . It must be one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * the following <code>Connection</code> constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * <code>TRANSACTION_NONE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * <code>TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * <code>TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * <code>TRANSACTION_REPEATABLE_READ</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * <code>TRANSACTION_SERIALIZABLE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
    private int isolation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * A constant used as a hint to the driver that indicates the direction in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * which data from this JDBC <code>RowSet</code> object  is going
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * to be fetched. The following <code>ResultSet</code> constants are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * possible values:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * <code>FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * <code>FETCH_REVERSE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * <code>FETCH_UNKNOWN</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * Unused at this time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    private int fetchDir = ResultSet.FETCH_FORWARD; // default fetch direction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * A hint to the driver that indicates the expected number of rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * in this JDBC <code>RowSet</code> object .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * Unused at this time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
    private int fetchSize = 0; // default fetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * The <code>java.util.Map</code> object that contains entries mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * SQL type names to classes in the Java programming language for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * custom mapping of user-defined types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     */
58338
faf791c5a710 8231442: Suppress warnings on non-serializable instance fields in java.sql.* modules
darcy
parents: 54106
diff changeset
   513
    @SuppressWarnings("serial") // Not statically typed as Serializable
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   514
    private Map<String, Class<?>> map;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * A <code>Vector</code> object that holds the list of listeners
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * that have registered with this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     */
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   521
    private Vector<RowSetListener> listeners;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * A <code>Vector</code> object that holds the parameters set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * for this <code>RowSet</code> object's current command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     */
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   528
    private Hashtable<Integer, Object> params; // could be transient?
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * Constructs a new <code>BaseRowSet</code> object initialized with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * a default <code>Vector</code> object for its <code>listeners</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * field. The other default values with which it is initialized are listed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * in Section 6.0 of the class comment for this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
    public BaseRowSet() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
        // allocate the listeners collection
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   538
        listeners = new Vector<RowSetListener>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * Performs the necessary internal configurations and initializations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * to allow any JDBC <code>RowSet</code> implementation to start using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * the standard facilities provided by a <code>BaseRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * instance. This method <b>should</b> be called after the <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * has been instantiated to correctly initialize all parameters. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * <b>should</b> never be called by an application, but is called from with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * a <code>RowSet</code> implementation extending this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
    protected void initParams() {
9257
53e6d7bc31b0 7035615: Address lint warnings for javax.sql.rowset & com.sun.rowset
lancea
parents: 6697
diff changeset
   551
        params = new Hashtable<Integer, Object>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
    //--------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    // Events
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
    //--------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    * The listener will be notified whenever an event occurs on this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
    * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
    * A listener might, for example, be a table or graph that needs to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    * be updated in order to accurately reflect the current state of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
    * the <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
    * <b>Note</b>: if the <code>RowSetListener</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
    * <code>null</code>, this method silently discards the <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
    * value and does not add a null reference to the set of listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
    * <p>
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
   570
    * <b>Note</b>: if the listener is already set, and the new <code>RowSetListener</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    * instance is added to the set of listeners already registered to receive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
    * event notifications from this <code>RowSet</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    * @param listener an object that has implemented the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    *     <code>javax.sql.RowSetListener</code> interface and wants to be notified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
    *     of any events that occur on this <code>RowSet</code> object; May be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    *     null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
    * @see #removeRowSetListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
    public void addRowSetListener(RowSetListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
        listeners.add(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
    * Removes the designated object from this <code>RowSet</code> object's list of listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
    * If the given argument is not a registered listener, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    * does nothing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    *  <b>Note</b>: if the <code>RowSetListener</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
    * <code>null</code>, this method silently discards the <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
    * @param listener a <code>RowSetListener</code> object that is on the list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
    *        of listeners for this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
    * @see #addRowSetListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
    public void removeRowSetListener(RowSetListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
        listeners.remove(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * Determine if instance of this class extends the RowSet interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    private void checkforRowSetInterface() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
        if ((this instanceof javax.sql.RowSet) == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
            throw new SQLException("The class extending abstract class BaseRowSet " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
                "must implement javax.sql.RowSet or one of it's sub-interfaces.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
    * Notifies all of the listeners registered with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
    * <code>RowSet</code> object that its cursor has moved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
    * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
    * When an application calls a method to move the cursor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
    * that method moves the cursor and then calls this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
    * internally. An application <b>should</b> never invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
    * this method directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    * @throws SQLException if the class extending the <code>BaseRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
    *     abstract class does not implement the <code>RowSet</code> interface or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
    *     one of it's sub-interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
    protected void notifyCursorMoved() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
        checkforRowSetInterface();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
        if (listeners.isEmpty() == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
            RowSetEvent event = new RowSetEvent((RowSet)this);
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   628
            for (RowSetListener rsl : listeners) {
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   629
                rsl.cursorMoved(event);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    * Notifies all of the listeners registered with this <code>RowSet</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
    * one of its rows has changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
    * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
    * When an application calls a method that changes a row, such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
    * the <code>CachedRowSet</code> methods <code>insertRow</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
    * <code>updateRow</code>, or <code>deleteRow</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
    * that method calls <code>notifyRowChanged</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    * internally. An application <b>should</b> never invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
    * this method directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
    * @throws SQLException if the class extending the <code>BaseRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
    *     abstract class does not implement the <code>RowSet</code> interface or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
    *     one of it's sub-interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
    protected void notifyRowChanged() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
        checkforRowSetInterface();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
        if (listeners.isEmpty() == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
                RowSetEvent event = new RowSetEvent((RowSet)this);
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   653
                for (RowSetListener rsl : listeners) {
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   654
                    rsl.rowChanged(event);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
    * Notifies all of the listeners registered with this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
    * object that its entire contents have changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
    * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
    * When an application calls methods that change the entire contents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
    * of the <code>RowSet</code> object, such as the <code>CachedRowSet</code> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
    * <code>execute</code>, <code>populate</code>, <code>restoreOriginal</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
    * or <code>release</code>, that method calls <code>notifyRowSetChanged</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
    * internally (either directly or indirectly). An application <b>should</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
    * never invoke this method directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
    * @throws SQLException if the class extending the <code>BaseRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
    *     abstract class does not implement the <code>RowSet</code> interface or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    *     one of it's sub-interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
    protected void notifyRowSetChanged() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
        checkforRowSetInterface();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
        if (listeners.isEmpty() == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
                RowSetEvent event = new RowSetEvent((RowSet)this);
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   678
                for (RowSetListener rsl : listeners) {
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 9257
diff changeset
   679
                    rsl.rowSetChanged(event);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * Retrieves the SQL query that is the command for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * <code>RowSet</code> object. The command property contains the query that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * will be executed to populate this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * The SQL query returned by this method is used by <code>RowSet</code> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * such as <code>execute</code> and <code>populate</code>, which may be implemented
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * by any class that extends the <code>BaseRowSet</code> abstract class and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * implements one or more of the standard JSR-114 <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * The command is used by the <code>RowSet</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * reader to obtain a <code>ResultSet</code> object.  The reader then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     * reads the data from the <code>ResultSet</code> object and uses it to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * to populate this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * The default value for the <code>command</code> property is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     * @return the <code>String</code> that is the value for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     *         <code>RowSet</code> object's <code>command</code> property;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     *         may be <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @see #setCommand
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
    public String getCommand() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
        return command;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * Sets this <code>RowSet</code> object's <code>command</code> property to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * the given <code>String</code> object and clears the parameters, if any,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * that were set for the previous command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     * The <code>command</code> property may not be needed if the <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * object gets its data from a source that does not support commands,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     * such as a spreadsheet or other tabular file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * Thus, this property is optional and may be <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * @param cmd a <code>String</code> object containing an SQL query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     *            that will be set as this <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     *            property; may be <code>null</code> but may not be an empty string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * @throws SQLException if an empty string is provided as the command value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @see #getCommand
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
    public void setCommand(String cmd) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
        // cmd equal to null or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
        // cmd with length 0 (implies url =="")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
        // are not independent events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
        if(cmd == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
           command = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
        } else if (cmd.length() == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
            throw new SQLException("Invalid command string detected. " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
            "Cannot be of length less than 0");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
            // "unbind" any parameters from any previous command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
            if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
                 throw new SQLException("Set initParams() before setCommand");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
            params.clear();
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
   743
            command = cmd;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * Retrieves the JDBC URL that this <code>RowSet</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * <code>javax.sql.Reader</code> object uses to make a connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * with a relational database using a JDBC technology-enabled driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     *<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * The <code>Url</code> property will be <code>null</code> if the underlying data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * source is a non-SQL data source, such as a spreadsheet or an XML
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * @return a <code>String</code> object that contains the JDBC URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     *         used to establish the connection for this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     *         object; may be <code>null</code> (default value) if not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * @throws SQLException if an error occurs retrieving the URL value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * @see #setUrl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
    public String getUrl() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
        return URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * Sets the Url property for this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * to the given <code>String</code> object and sets the dataSource name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * property to <code>null</code>. The Url property is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * JDBC URL that is used when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * the connection is created using a JDBC technology-enabled driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * ("JDBC driver") and the <code>DriverManager</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * The correct JDBC URL for the specific driver to be used can be found
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
   775
     * in the driver documentation.  Although there are guidelines for how
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * a JDBC URL is formed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * a driver vendor can specify any <code>String</code> object except
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * one with a length of <code>0</code> (an empty string).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * Setting the Url property is optional if connections are established using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * a <code>DataSource</code> object instead of the <code>DriverManager</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * The driver will use either the URL property or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     * dataSourceName property to create a connection, whichever was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * specified most recently. If an application uses a JDBC URL, it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * must load a JDBC driver that accepts the JDBC URL before it uses the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     * <code>RowSet</code> object to connect to a database.  The <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * object will use the URL internally to create a database connection in order
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * to read or write data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * @param url a <code>String</code> object that contains the JDBC URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     *     that will be used to establish the connection to a database for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     *     <code>RowSet</code> object; may be <code>null</code> but must not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     *     be an empty string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * @throws SQLException if an error occurs setting the Url property or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     *     parameter supplied is a string with a length of <code>0</code> (an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     *     empty string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * @see #getUrl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
    public void setUrl(String url) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
        if(url == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
           url = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
        } else if (url.length() < 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
            throw new SQLException("Invalid url string detected. " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
            "Cannot be of length less than 1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
        } else {
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
   806
            URL = url;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
        dataSource = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * Returns the logical name that when supplied to a naming service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * that uses the Java Naming and Directory Interface (JNDI) API, will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * retrieve a <code>javax.sql.DataSource</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * <code>DataSource</code> object can be used to establish a connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * to the data source that it represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * Users should set either the url or the data source name property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * The driver will use the property set most recently to establish a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * @return a <code>String</code> object that identifies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     *         <code>DataSource</code> object to be used for making a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     *         connection; if no logical name has been set, <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     *         is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * @see #setDataSourceName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
    public String getDataSourceName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
        return dataSource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * Sets the <code>DataSource</code> name property for this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * object to the given logical name and sets this <code>RowSet</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * Url property to <code>null</code>. The name must have been bound to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * <code>DataSource</code> object in a JNDI naming service so that an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * application can do a lookup using that name to retrieve the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     * <code>DataSource</code> object bound to it. The <code>DataSource</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     * object can then be used to establish a connection to the data source it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * Users should set either the Url property or the dataSourceName property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * If both properties are set, the driver will use the property set most recently.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * @param name a <code>String</code> object with the name that can be supplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     *     to a naming service based on JNDI technology to retrieve the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *     <code>DataSource</code> object that can be used to get a connection;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *     may be <code>null</code> but must not be an empty string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * @throws SQLException if an empty string is provided as the <code>DataSource</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     *    name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @see #getDataSourceName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
    public void setDataSourceName(String name) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
        if (name == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
            dataSource = null;
52902
e3398b2e1ab0 8214971: Replace use of string.equals("") with isEmpty()
rriggs
parents: 47216
diff changeset
   860
        } else if (name.isEmpty()) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
           throw new SQLException("DataSource name cannot be empty string");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
        } else {
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
   863
           dataSource = name;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
        URL = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * Returns the user name used to create a database connection.  Because it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     * is not serialized, the username property is set at runtime before
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * calling the method <code>execute</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * @return the <code>String</code> object containing the user name that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     *         is supplied to the data source to create a connection; may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     *         <code>null</code> (default value) if not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * @see #setUsername
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
    public String getUsername() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
        return username;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * Sets the username property for this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * to the given user name. Because it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * is not serialized, the username property is set at run time before
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * calling the method <code>execute</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * @param name the <code>String</code> object containing the user name that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     *     is supplied to the data source to create a connection. It may be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * @see #getUsername
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
    public void setUsername(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
        if(name == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
           username = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
        } else {
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
   898
           username = name;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * Returns the password used to create a database connection for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * <code>RowSet</code> object.  Because the password property is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * serialized, it is set at run time before calling the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * <code>execute</code>. The default value is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     * @return the <code>String</code> object that represents the password
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     *         that must be supplied to the database to create a connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
     * @see #setPassword
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
    public String getPassword() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
        return password;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * Sets the password used to create a database connection for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * <code>RowSet</code> object to the given <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * object.  Because the password property is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * serialized, it is set at run time before calling the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * <code>execute</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * @param pass the <code>String</code> object that represents the password
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     *     that is supplied to the database to create a connection. It may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     *     null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * @see #getPassword
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
    public void setPassword(String pass) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
        if(pass == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
           password = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
        } else {
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
   933
           password = pass;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * Sets the type for this <code>RowSet</code> object to the specified type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * The default type is <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     * @param type one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     *             <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     *             <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     *             <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     * @throws SQLException if the parameter supplied is not one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     *         following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     *          <code>ResultSet.TYPE_FORWARD_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     *          <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     *          <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * @see #getConcurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * @see #getType
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
    public void setType(int type) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
        if ((type != ResultSet.TYPE_FORWARD_ONLY) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
           (type != ResultSet.TYPE_SCROLL_INSENSITIVE) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
           (type != ResultSet.TYPE_SCROLL_SENSITIVE)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
                throw new SQLException("Invalid type of RowSet set. Must be either " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
                "ResultSet.TYPE_FORWARD_ONLY or ResultSet.TYPE_SCROLL_INSENSITIVE " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
                "or ResultSet.TYPE_SCROLL_SENSITIVE.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
        this.rowSetType = type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * Returns the type of this <code>RowSet</code> object. The type is initially
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * determined by the statement that created the <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * The <code>RowSet</code> object can call the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * <code>setType</code> at any time to change its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * type.  The default is <code>TYPE_SCROLL_INSENSITIVE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * @return the type of this JDBC <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     *         object, which must be one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * @throws SQLException if an error occurs getting the type of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     *     of this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * @see #setType
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
    public int getType() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
        return rowSetType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * Sets the concurrency for this <code>RowSet</code> object to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * the specified concurrency. The default concurrency for any <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * object (connected or disconnected) is <code>ResultSet.CONCUR_UPDATABLE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * but this method may be called at any time to change the concurrency.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
   990
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * @param concurrency one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     *                    <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     *                    <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * @throws SQLException if the parameter supplied is not one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     *         following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     *          <code>ResultSet.CONCUR_UPDATABLE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     *          <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * @see #getConcurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * @see #isReadOnly
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
    public void setConcurrency(int concurrency) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
        if((concurrency != ResultSet.CONCUR_READ_ONLY) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
           (concurrency != ResultSet.CONCUR_UPDATABLE)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
                throw new SQLException("Invalid concurrency set. Must be either " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
                "ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
        this.concurrency = concurrency;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * Returns a <code>boolean</code> indicating whether this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * <code>RowSet</code> object is read-only.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * Any attempts to update a read-only <code>RowSet</code> object will result in an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     * <code>SQLException</code> being thrown. By default,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * rowsets are updatable if updates are possible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * @return <code>true</code> if this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     *         cannot be updated; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * @see #setConcurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * @see #setReadOnly
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
    public boolean isReadOnly() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
        return readOnly;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     * Sets this <code>RowSet</code> object's readOnly  property to the given <code>boolean</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * @param value <code>true</code> to indicate that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     *              <code>RowSet</code> object is read-only;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     *              <code>false</code> to indicate that it is updatable
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
    public void setReadOnly(boolean value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
        readOnly = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     * Returns the transaction isolation property for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     * <code>RowSet</code> object's connection. This property represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     * the transaction isolation level requested for use in transactions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     * For <code>RowSet</code> implementations such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
     * the <code>CachedRowSet</code> that operate in a disconnected environment,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * the <code>SyncProvider</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * offers complementary locking and data integrity options. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     * options described below are pertinent only to connected <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * objects (<code>JdbcRowSet</code> objects).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
     * @return one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     *         <code>Connection.TRANSACTION_NONE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     *         <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
     *         <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
     *         <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
     *         <code>Connection.TRANSACTION_SERIALIZABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
     * @see javax.sql.rowset.spi.SyncFactory
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     * @see javax.sql.rowset.spi.SyncProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * @see #setTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
    public int getTransactionIsolation() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
        return isolation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * Sets the transaction isolation property for this JDBC <code>RowSet</code> object to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * constant. The DBMS will use this transaction isolation level for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * transactions if it can.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
     * For <code>RowSet</code> implementations such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     * the <code>CachedRowSet</code> that operate in a disconnected environment,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     * the <code>SyncProvider</code> object being used
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
     * offers complementary locking and data integrity options. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * options described below are pertinent only to connected <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
     * objects (<code>JdbcRowSet</code> objects).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     * @param level one of the following constants, listed in ascending order:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     *              <code>Connection.TRANSACTION_NONE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     *              <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
     *              <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
     *              <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
     *              <code>Connection.TRANSACTION_SERIALIZABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     * @throws SQLException if the given parameter is not one of the Connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
     *          constants
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
     * @see javax.sql.rowset.spi.SyncFactory
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
     * @see javax.sql.rowset.spi.SyncProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     * @see #getTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
    public void setTransactionIsolation(int level) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
        if ((level != Connection.TRANSACTION_NONE) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
           (level != Connection.TRANSACTION_READ_COMMITTED) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
           (level != Connection.TRANSACTION_READ_UNCOMMITTED) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
           (level != Connection.TRANSACTION_REPEATABLE_READ) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
           (level != Connection.TRANSACTION_SERIALIZABLE))
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
            {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
                throw new SQLException("Invalid transaction isolation set. Must " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
                "be either " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
                "Connection.TRANSACTION_NONE or " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
                "Connection.TRANSACTION_READ_UNCOMMITTED or " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
                "Connection.TRANSACTION_READ_COMMITTED or " +
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  1101
                "Connection.TRANSACTION_REPEATABLE_READ or " +
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
                "Connection.TRANSACTION_SERIALIZABLE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
        this.isolation = level;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
     * Retrieves the type map associated with the <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
     * object for this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
     * Drivers that support the JDBC 3.0 API will create
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
     * <code>Connection</code> objects with an associated type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
     * This type map, which is initially empty, can contain one or more
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
     * fully-qualified SQL names and <code>Class</code> objects indicating
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
     * the class to which the named SQL value will be mapped. The type mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
     * specified in the connection's type map is used for custom type mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
     * when no other type map supersedes it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
     * If a type map is explicitly supplied to a method that can perform
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
     * custom mapping, that type map supersedes the connection's type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
     * @return the <code>java.util.Map</code> object that is the type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
     *         for this <code>RowSet</code> object's connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
    public java.util.Map<String,Class<?>> getTypeMap() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
        return map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
     * Installs the given <code>java.util.Map</code> object as the type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
     * associated with the <code>Connection</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
     * <code>RowSet</code> object.  The custom mapping indicated in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
     * this type map will be used unless a different type map is explicitly
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
     * supplied to a method, in which case the type map supplied will be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
     * @param map a <code>java.util.Map</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
     *     mapping from SQL type names for user defined types (UDT) to classes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
     *     the Java programming language.  Each entry in the <code>Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
     *     object consists of the fully qualified SQL name of a UDT and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
     *     <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
     *     of that UDT. May be <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
    public void setTypeMap(java.util.Map<String,Class<?>> map) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
        this.map = map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
     * Retrieves the maximum number of bytes that can be used for a column
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
     * value in this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
     * This limit applies only to columns that hold values of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
     * following types:  <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
     * and <code>LONGVARCHAR</code>.  If the limit is exceeded, the excess
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
     * data is silently discarded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
     * @return an <code>int</code> indicating the current maximum column size
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
     *     limit; zero means that there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
     * @throws SQLException if an error occurs internally determining the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
     *    maximum limit of the column size
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
    public int getMaxFieldSize() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
        return maxFieldSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
     * Sets the maximum number of bytes that can be used for a column
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
     * value in this <code>RowSet</code> object to the given number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
     * This limit applies only to columns that hold values of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
     * following types:  <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
     * and <code>LONGVARCHAR</code>.  If the limit is exceeded, the excess
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
     * data is silently discarded. For maximum portability, it is advisable to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
     * use values greater than 256.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
     * @param max an <code>int</code> indicating the new maximum column size
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
     *     limit; zero means that there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
     * @throws SQLException if (1) an error occurs internally setting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
     *     maximum limit of the column size or (2) a size of less than 0 is set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
    public void setMaxFieldSize(int max) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
        if (max < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
            throw new SQLException("Invalid max field size set. Cannot be of " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
            "value: " + max);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
        maxFieldSize = max;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
     * Retrieves the maximum number of rows that this <code>RowSet</code> object may contain. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
     * this limit is exceeded, the excess rows are silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
     * @return an <code>int</code> indicating the current maximum number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
     *     rows; zero means that there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
     * @throws SQLException if an error occurs internally determining the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
     *     maximum limit of rows that a <code>Rowset</code> object can contain
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
    public int getMaxRows() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
        return maxRows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
     * Sets the maximum number of rows that this <code>RowSet</code> object may contain to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
     * the given number. If this limit is exceeded, the excess rows are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
     * silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
     * @param max an <code>int</code> indicating the current maximum number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
     *     of rows; zero means that there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
     * @throws SQLException if an error occurs internally setting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
     *     maximum limit on the number of rows that a JDBC <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
     *     can contain; or if <i>max</i> is less than <code>0</code>; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
     *     if <i>max</i> is less than the <code>fetchSize</code> of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
     *     <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
    public void setMaxRows(int max) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
        if (max < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
            throw new SQLException("Invalid max row size set. Cannot be of " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
                "value: " + max);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
        } else if (max < this.getFetchSize()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
            throw new SQLException("Invalid max row size set. Cannot be less " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
                "than the fetchSize.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
        this.maxRows = max;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
     * Sets to the given <code>boolean</code> whether or not the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
     * scan for escape syntax and do escape substitution before sending SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
     * statements to the database. The default is for the driver to do escape
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
     * processing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
     * Note: Since <code>PreparedStatement</code> objects have usually been
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
     * parsed prior to making this call, disabling escape processing for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
     * prepared statements will likely have no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
     * @param enable <code>true</code> to enable escape processing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
     *     <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
     * @throws SQLException if an error occurs setting the underlying JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
     * technology-enabled driver to process the escape syntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
    public void setEscapeProcessing(boolean enable) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
        escapeProcessing = enable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
     * Retrieves the maximum number of seconds the driver will wait for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
     * query to execute. If the limit is exceeded, an <code>SQLException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
     * is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
     * @return the current query timeout limit in seconds; zero means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
     *     there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
     * @throws SQLException if an error occurs in determining the query
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
     *     time-out value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
    public int getQueryTimeout() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
        return queryTimeout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
     * Sets to the given number the maximum number of seconds the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
     * wait for a query to execute. If the limit is exceeded, an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
     * <code>SQLException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
     * @param seconds the new query time-out limit in seconds; zero means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
     *     there is no limit; must not be less than zero
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
     * @throws SQLException if an error occurs setting the query
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
     *     time-out or if the query time-out value is less than 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
    public void setQueryTimeout(int seconds) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
        if (seconds < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
            throw new SQLException("Invalid query timeout value set. Cannot be " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
            "of value: " + seconds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
        this.queryTimeout = seconds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
     * Retrieves a <code>boolean</code> indicating whether rows marked
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
     * for deletion appear in the set of current rows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
     * The default value is <code>false</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
     * Note: Allowing deleted rows to remain visible complicates the behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
     * of some of the methods.  However, most <code>RowSet</code> object users
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
     * can simply ignore this extra detail because only sophisticated
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
     * applications will likely want to take advantage of this feature.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
     * @return <code>true</code> if deleted rows are visible;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
     *         <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
     * @throws SQLException if an error occurs determining if deleted rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
     * are visible or not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
     * @see #setShowDeleted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
    public boolean getShowDeleted() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
        return showDeleted;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
     * Sets the property <code>showDeleted</code> to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
     * <code>boolean</code> value, which determines whether
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
     * rows marked for deletion appear in the set of current rows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
     * @param value <code>true</code> if deleted rows should be shown;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
     *     <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
     * @throws SQLException if an error occurs setting whether deleted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
     *     rows are visible or not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
     * @see #getShowDeleted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
    public void setShowDeleted(boolean value) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
        showDeleted = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
     * Ascertains whether escape processing is enabled for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
     * <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
     * @return <code>true</code> if escape processing is turned on;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
     *         <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
     * @throws SQLException if an error occurs determining if escape
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
     *     processing is enabled or not or if the internal escape
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
     *     processing trigger has not been enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
    public boolean getEscapeProcessing() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
        return escapeProcessing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
     * Gives the driver a performance hint as to the direction in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
     * which the rows in this <code>RowSet</code> object will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
     * processed.  The driver may ignore this hint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
     * A <code>RowSet</code> object inherits the default properties of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
     * <code>ResultSet</code> object from which it got its data.  That
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
     * <code>ResultSet</code> object's default fetch direction is set by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
     * the <code>Statement</code> object that created it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
     * This method applies to a <code>RowSet</code> object only while it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
     * connected to a database using a JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
     * A <code>RowSet</code> object may use this method at any time to change
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
     * its setting for the fetch direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
     * @param direction one of <code>ResultSet.FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
     *                  <code>ResultSet.FETCH_REVERSE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
     *                  <code>ResultSet.FETCH_UNKNOWN</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
     * @throws SQLException if (1) the <code>RowSet</code> type is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
     *     <code>TYPE_FORWARD_ONLY</code> and the given fetch direction is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
     *     <code>FETCH_FORWARD</code> or (2) the given fetch direction is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
     *     one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
     *        ResultSet.FETCH_FORWARD,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
     *        ResultSet.FETCH_REVERSE, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
     *        ResultSet.FETCH_UNKNOWN
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
     * @see #getFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
    public void setFetchDirection(int direction) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
        // Changed the condition checking to the below as there were two
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
        // conditions that had to be checked
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
        // 1. RowSet is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
        // 2. Direction is not one of the valid values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
        if (((getType() == ResultSet.TYPE_FORWARD_ONLY) && (direction != ResultSet.FETCH_FORWARD)) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
            ((direction != ResultSet.FETCH_FORWARD) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
            (direction != ResultSet.FETCH_REVERSE) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
            (direction != ResultSet.FETCH_UNKNOWN))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
            throw new SQLException("Invalid Fetch Direction");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
        fetchDir = direction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
     * Retrieves this <code>RowSet</code> object's current setting for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
     * fetch direction. The default type is <code>ResultSet.FETCH_FORWARD</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
     * @return one of <code>ResultSet.FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
     *                  <code>ResultSet.FETCH_REVERSE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
     *                  <code>ResultSet.FETCH_UNKNOWN</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
     * @throws SQLException if an error occurs in determining the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
     *     current fetch direction for fetching rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
     * @see #setFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
    public int getFetchDirection() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
        //Added the following code to throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
        //SQL Exception if the fetchDir is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
        //set properly.Bug id:4914155
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
        // This checking is not necessary!
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
         if((fetchDir != ResultSet.FETCH_FORWARD) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
           (fetchDir != ResultSet.FETCH_REVERSE) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
           (fetchDir != ResultSet.FETCH_UNKNOWN)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
            throw new SQLException("Fetch Direction Invalid");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
        return (fetchDir);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
     * Sets the fetch size for this <code>RowSet</code> object to the given number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
     * rows.  The fetch size gives a JDBC technology-enabled driver ("JDBC driver")
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
     * a hint as to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
     * number of rows that should be fetched from the database when more rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
     * are needed for this <code>RowSet</code> object. If the fetch size specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
     * is zero, the driver ignores the value and is free to make its own best guess
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
     * as to what the fetch size should be.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
     * A <code>RowSet</code> object inherits the default properties of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
     * <code>ResultSet</code> object from which it got its data.  That
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
     * <code>ResultSet</code> object's default fetch size is set by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
     * the <code>Statement</code> object that created it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
     * This method applies to a <code>RowSet</code> object only while it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
     * connected to a database using a JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
     * For connected <code>RowSet</code> implementations such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
     * <code>JdbcRowSet</code>, this method has a direct and immediate effect
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
     * on the underlying JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
     * A <code>RowSet</code> object may use this method at any time to change
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
     * its setting for the fetch size.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
     * For <code>RowSet</code> implementations such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
     * <code>CachedRowSet</code>, which operate in a disconnected environment,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
     * the <code>SyncProvider</code> object being used
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
     * may leverage the fetch size to poll the data source and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
     * retrieve a number of rows that do not exceed the fetch size and that may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
     * form a subset of the actual rows returned by the original query. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
     * an implementation variance determined by the specific <code>SyncProvider</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
     * object employed by the disconnected <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
     * @param rows the number of rows to fetch; <code>0</code> to let the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
     *        driver decide what the best fetch size is; must not be less
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
     *        than <code>0</code> or more than the maximum number of rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
     *        allowed for this <code>RowSet</code> object (the number returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
     *        by a call to the method {@link #getMaxRows})
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
     * @throws SQLException if the specified fetch size is less than <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
     *        or more than the limit for the maximum number of rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
     * @see #getFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
    public void setFetchSize(int rows) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
        //Added this checking as maxRows can be 0 when this function is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
        //maxRows = 0 means rowset can hold any number of rows, os this checking
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
        // is needed to take care of this condition.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
        if (getMaxRows() == 0 && rows >= 0)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
            fetchSize = rows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
        if ((rows < 0) || (rows > getMaxRows())) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
            throw new SQLException("Invalid fetch size set. Cannot be of " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
            "value: " + rows);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
        fetchSize = rows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
     * Returns the fetch size for this <code>RowSet</code> object. The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
     * value is zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
     * @return the number of rows suggested as the fetch size when this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
     *     needs more rows from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
     * @throws SQLException if an error occurs determining the number of rows in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
     *     current fetch size
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
     * @see #setFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
    public int getFetchSize() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
        return fetchSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
     * Returns the concurrency for this <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
     * The default is <code>CONCUR_UPDATABLE</code> for both connected and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
     * disconnected <code>RowSet</code> objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
     * An application can call the method <code>setConcurrency</code> at any time
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
     * to change a <code>RowSet</code> object's concurrency.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  1474
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
     * @return the concurrency type for this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
     *     object, which must be one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
     *     <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
     *     <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
     * @throws SQLException if an error occurs getting the concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
     *     of this <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
     * @see #setConcurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
     * @see #isReadOnly
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
    public int getConcurrency() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
        return concurrency;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
    //-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
    // Parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
    //-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
     * Checks the given index to see whether it is less than <code>1</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
     * throws an <code>SQLException</code> object if it is.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
     * This method is called by many methods internally; it is never
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
     * called by an application directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
     * @param idx an <code>int</code> indicating which parameter is to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
     *     checked; the first parameter is <code>1</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
     * @throws SQLException if the parameter is less than <code>1</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
    private void checkParamIndex(int idx) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
        if ((idx < 1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
            throw new SQLException("Invalid Parameter Index");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
    //---------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
    // setter methods for setting the parameters in a <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
    //---------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
     * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
     * Note that the parameter's SQL type must be specified using one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
         * type codes defined in <code>java.sql.Types</code>.  This SQL type is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
     * specified in the second parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
     * Note that the second parameter tells the DBMS the data type of the value being
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
     * set to <code>NULL</code>. Some DBMSs require this information, so it is required
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
     * in order to make code more portable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
     * <code>setNull</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
     * has been called will return an <code>Object</code> array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
     * The second element is the value set for <i>sqlType</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
     * In other words, if the second placeholder parameter is being set to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
     * <code>null</code>, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
     * @param sqlType an <code>int</code> that is one of the SQL type codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
     *        defined in the class {@link java.sql.Types}. If a non-standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
     *        <i>sqlType</i> is supplied, this method will not throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
     *        <code>SQLException</code>. This allows implicit support for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
     *        non-standard SQL types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
     * @throws SQLException if a database access error occurs or the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
     *        parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
    public void setNull(int parameterIndex, int sqlType) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
        Object nullVal[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
        nullVal = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
        nullVal[0] = null;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1571
        nullVal[1] = Integer.valueOf(sqlType);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
       if (params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
            throw new SQLException("Set initParams() before setNull");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
       }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1577
        params.put(Integer.valueOf(parameterIndex - 1), nullVal);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
     * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
     * Although this version of the  method <code>setNull</code> is intended
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
     * for user-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
     * and <code>REF</code> parameters, this method may be used to set a null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
     * parameter for any JDBC type. The following are user-defined types:
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
     * <code>STRUCT</code>, <code>DISTINCT</code>, and <code>JAVA_OBJECT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
     * and named array types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
     * <P><B>Note:</B> To be portable, applications must give the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
     * SQL type code and the fully qualified SQL type name when specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
     * a <code>NULL</code> user-defined or <code>REF</code> parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
     * In the case of a user-defined type, the name is the type name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
     * the parameter itself.  For a <code>REF</code> parameter, the name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
     * the type name of the referenced type.  If a JDBC technology-enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
     * driver does not need the type code or type name information,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
     * it may ignore it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
     * If the parameter does not have a user-defined or <code>REF</code> type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
     * the given <code>typeName</code> parameter is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
     * <code>setNull</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
     * has been called will return an <code>Object</code> array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
     * The second element is the value set for <i>sqlType</i>, and the third
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
     * element is the value set for <i>typeName</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
     * In other words, if the second placeholder parameter is being set to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
     * <code>null</code>, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
     * @param sqlType a value from <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
     * @param typeName the fully qualified name of an SQL user-defined type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
     *                 which is ignored if the parameter is not a user-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
     *                 type or <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
     * @throws SQLException if an error occurs or the given parameter index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
     *            is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
    public void setNull(int parameterIndex, int sqlType, String typeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
        throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
        Object nullVal[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
        nullVal = new Object[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
        nullVal[0] = null;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1652
        nullVal[1] = Integer.valueOf(sqlType);
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 5506
diff changeset
  1653
        nullVal[2] = typeName;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
       if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
            throw new SQLException("Set initParams() before setNull");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
       }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1659
        params.put(Integer.valueOf(parameterIndex - 1), nullVal);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
     * Sets the designated parameter to the given <code>boolean</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
     * Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
     * <code>BIT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
     * Methods such as <code>execute</code>, <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
    public void setBoolean(int parameterIndex, boolean x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
       if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
            throw new SQLException("Set initParams() before setNull");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
       }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1694
        params.put(Integer.valueOf(parameterIndex - 1), Boolean.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
     * Sets the designated parameter to the given <code>byte</code> in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
     * programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
     * <code>TINYINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
    public void setByte(int parameterIndex, byte x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
       if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
            throw new SQLException("Set initParams() before setByte");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
       }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1728
        params.put(Integer.valueOf(parameterIndex - 1), Byte.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
     * Sets the designated parameter to the given <code>short</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
     * Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
     * <code>SMALLINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
     * as it is undefined in this class.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  1745
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1753
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1754
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1755
    public void setShort(int parameterIndex, short x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1756
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1757
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1758
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1759
             throw new SQLException("Set initParams() before setShort");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1760
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1761
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1762
        params.put(Integer.valueOf(parameterIndex - 1), Short.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1763
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1764
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1765
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1766
     * Sets the designated parameter to an <code>int</code> in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1767
     * programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1768
     * <code>INTEGER</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1770
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1771
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1772
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1774
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1775
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1776
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1777
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1778
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1779
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1780
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1781
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1782
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1783
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1784
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1785
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1786
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1787
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1788
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1789
    public void setInt(int parameterIndex, int x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1790
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1791
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1792
             throw new SQLException("Set initParams() before setInt");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1793
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1794
        params.put(Integer.valueOf(parameterIndex - 1), Integer.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1795
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1796
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1797
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1798
     * Sets the designated parameter to the given <code>long</code> in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1799
     * programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1800
     * <code>BIGINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1801
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1805
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1806
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1807
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1808
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1809
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1810
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1811
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1812
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1813
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1814
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1815
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1816
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1817
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1818
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1819
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1820
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1821
    public void setLong(int parameterIndex, long x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1822
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1823
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1824
             throw new SQLException("Set initParams() before setLong");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1826
        params.put(Integer.valueOf(parameterIndex - 1), Long.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1827
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1828
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1829
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1830
     * Sets the designated parameter to the given <code>float</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1831
     * Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1832
     * <code>FLOAT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1833
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1834
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1835
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1836
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1837
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1838
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1839
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1840
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1841
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1842
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1843
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1844
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1845
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1846
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1847
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1848
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1849
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1850
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1851
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1852
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1853
    public void setFloat(int parameterIndex, float x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1854
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1855
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1856
             throw new SQLException("Set initParams() before setFloat");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1857
        }
14179
4681260d262a 8000763: use XXX.valueOf methods instead of constructors
lancea
parents: 14171
diff changeset
  1858
        params.put(Integer.valueOf(parameterIndex - 1), Float.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1859
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1860
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1861
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1862
     * Sets the designated parameter to the given <code>double</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1863
     * Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1864
     * <code>DOUBLE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1865
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1870
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1871
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1872
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1873
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
     * as it is undefined in this class.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  1875
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1876
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1877
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1878
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1879
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1880
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1881
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1882
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1883
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1884
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1885
    public void setDouble(int parameterIndex, double x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1887
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
             throw new SQLException("Set initParams() before setDouble");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1889
        }
14179
4681260d262a 8000763: use XXX.valueOf methods instead of constructors
lancea
parents: 14171
diff changeset
  1890
        params.put(Integer.valueOf(parameterIndex - 1), Double.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1891
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1892
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1894
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1895
     * <code>java.lang.BigDecimal</code> value.  The driver converts this to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1896
     * an SQL <code>NUMERIC</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1897
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1898
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1899
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1900
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1901
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1902
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1903
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1904
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
     * Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1908
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1909
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1910
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1911
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1912
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1913
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1914
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1915
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1916
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1917
    public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1918
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1919
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1920
             throw new SQLException("Set initParams() before setBigDecimal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1921
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1922
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1923
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1924
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1925
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1926
     * Sets the designated parameter to the given <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1927
     * value.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1928
     * <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1929
     * (depending on the argument's size relative to the driver's limits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1930
     * on <code>VARCHAR</code> values) when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1932
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1933
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1934
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1935
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1936
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1937
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1938
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1939
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1940
     * as it is undefined in this class.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  1941
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1942
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1943
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1944
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1945
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1946
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1947
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1948
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1949
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1950
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1951
    public void setString(int parameterIndex, String x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1952
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1953
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1954
             throw new SQLException("Set initParams() before setString");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1955
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1956
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1957
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
     * Sets the designated parameter to the given array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
     * The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1962
     * <code>VARBINARY</code> or <code>LONGVARBINARY</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1963
     * (depending on the argument's size relative to the driver's limits
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1964
     * on <code>VARBINARY</code> values) when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1965
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1967
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1968
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1969
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1970
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1971
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1972
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1973
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1974
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1975
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1979
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1980
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1981
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1982
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1984
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1985
    public void setBytes(int parameterIndex, byte x[]) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1986
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1987
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1988
             throw new SQLException("Set initParams() before setBytes");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1989
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1990
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1991
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1992
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1994
     * Sets the designated parameter to the given <code>java.sql.Date</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
     * value. The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1996
     * <code>DATE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1997
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1998
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1999
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2001
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2002
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2003
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2004
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2005
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2006
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2007
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2008
     * Calls made to the method <code>getParams</code> after this version
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2009
     * of <code>setDate</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2010
     * has been called will return an array with the value to be set for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2011
     * placeholder parameter number <i>parameterIndex</i> being the <code>Date</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2012
     * object supplied as the second parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2013
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2014
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2015
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2016
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2017
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2018
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2019
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2020
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2021
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2022
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2023
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2024
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2025
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2026
    public void setDate(int parameterIndex, java.sql.Date x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
             throw new SQLException("Set initParams() before setDate");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2031
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2032
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2033
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2034
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2035
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2036
     * Sets the designated parameter to the given <code>java.sql.Time</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2037
     * value.  The driver converts this to an SQL <code>TIME</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2038
     * when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2039
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2040
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2041
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2042
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2043
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2044
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2045
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2046
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2047
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2048
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2049
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2050
     * Calls made to the method <code>getParams</code> after this version
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2051
     * of the method <code>setTime</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2052
     * has been called will return an array of the parameters that have been set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2053
     * The parameter to be set for parameter placeholder number <i>parameterIndex</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2054
     * will be the <code>Time</code> object that was set as the second parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2055
     * to this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2056
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2057
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2058
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2059
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2060
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2061
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2062
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2063
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2064
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2065
     * @param x a <code>java.sql.Time</code> object, which is to be set as the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2066
     *              for placeholder parameter <i>parameterIndex</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2067
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2068
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2069
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2070
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2071
    public void setTime(int parameterIndex, java.sql.Time x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2072
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2073
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2074
             throw new SQLException("Set initParams() before setTime");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2075
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2076
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2077
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2078
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2079
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2080
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2081
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2082
     * <code>java.sql.Timestamp</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2083
     * The driver converts this to an SQL <code>TIMESTAMP</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2084
     * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2085
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2086
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2087
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2088
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2089
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2090
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2091
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2092
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2093
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2094
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2095
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2096
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2097
     * <code>setTimestamp</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2098
     * has been called will return an array with the value for parameter placeholder
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2099
     * number <i>parameterIndex</i> being the <code>Timestamp</code> object that was
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2100
     * supplied as the second parameter to this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2101
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2102
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2103
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2105
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2106
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2107
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2108
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2109
     * @param x a <code>java.sql.Timestamp</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2110
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2111
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2112
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2114
    public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2115
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2116
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2117
             throw new SQLException("Set initParams() before setTimestamp");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2118
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2119
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2120
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2121
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2122
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2123
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2124
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2125
     * <code>java.io.InputStream</code> object,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2126
     * which will have the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2127
     * The contents of the stream will be read and sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2128
     * This method throws an <code>SQLException</code> object if the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2129
     * read and sent to the database is not equal to <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2130
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2131
     * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2132
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2133
     * <code>java.io.InputStream</code> object. A JDBC technology-enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2134
     * driver will read the data from the stream as needed until it reaches
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2135
     * end-of-file. The driver will do any necessary conversion from ASCII to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2136
     * the database <code>CHAR</code> format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2137
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2138
     * <P><B>Note:</B> This stream object can be either a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2139
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2140
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2141
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2142
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2143
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2144
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2145
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2146
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2147
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2148
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2149
     * Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2150
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2151
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2152
     * Calls made to the method <code>getParams</code> after <code>setAsciiStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2153
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2154
     * have been set.  The element in the array that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2155
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2156
     * is the given <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2157
     * The second element is the value set for <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2158
     * The third element is an internal <code>BaseRowSet</code> constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2159
     * specifying that the stream passed to this method is an ASCII stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2160
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2161
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2162
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2163
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2164
     * In other words, if the input stream being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2165
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2166
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2167
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2168
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2169
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2170
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2171
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2172
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2173
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2174
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2175
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2176
     * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2177
     * @param length the number of bytes in the stream. This is the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2178
     *       the driver will send to the DBMS; lengths of 0 or less are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2179
     *       are undefined but will cause an invalid length exception to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2180
     *       thrown in the underlying JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2181
     * @throws SQLException if an error occurs, the parameter index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2182
     *       or when connected to a data source, the number of bytes the driver reads
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2183
     *       and sends to the database is not equal to the number of bytes specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2184
     *       in <i>length</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2185
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2186
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2187
    public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2188
        Object asciiStream[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2189
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2190
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2191
        asciiStream = new Object[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2192
        asciiStream[0] = x;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2193
        asciiStream[1] = Integer.valueOf(length);
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2194
        asciiStream[2] = Integer.valueOf(ASCII_STREAM_PARAM);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2195
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2196
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2197
             throw new SQLException("Set initParams() before setAsciiStream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2199
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2200
        params.put(Integer.valueOf(parameterIndex - 1), asciiStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2202
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2203
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2204
   * Sets the designated parameter in this <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2205
   * to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2206
   * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2207
   * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2208
   * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2209
   * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2210
   * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2211
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2212
   * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2213
   * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2214
   * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2215
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2216
   * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2217
   * <code>setAsciiStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2218
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2219
   * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2220
   * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2221
   * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2222
   * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2223
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2224
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2225
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2226
  public void setAsciiStream(int parameterIndex, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2227
                      throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2228
      throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2229
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2230
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2231
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2232
     * Sets the designated parameter to the given <code>java.io.InputStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2233
     * object, which will have the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2234
     * The contents of the stream will be read and sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2235
     * This method throws an <code>SQLException</code> object if the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2236
     * read and sent to the database is not equal to <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2237
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2238
     * When a very large binary value is input to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2239
     * <code>LONGVARBINARY</code> parameter, it may be more practical
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2240
     * to send it via a <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2241
     * A JDBC technology-enabled driver will read the data from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2242
     * stream as needed until it reaches end-of-file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2244
     * <P><B>Note:</B> This stream object can be either a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2245
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2246
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2247
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2248
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2249
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2250
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2251
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2252
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2253
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
     *<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2255
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2257
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2258
     * Calls made to the method <code>getParams</code> after <code>setBinaryStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2259
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2260
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2261
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2262
     * is the given <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2263
     * The second element is the value set for <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2264
     * The third element is an internal <code>BaseRowSet</code> constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2265
     * specifying that the stream passed to this method is a binary stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2266
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2267
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2268
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2269
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2270
     * In other words, if the input stream being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2271
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2272
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2273
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2274
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2275
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2276
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2277
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2278
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2279
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2280
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2281
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2282
     * @param x the input stream that contains the binary value to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2283
     * @param length the number of bytes in the stream; lengths of 0 or less are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2284
     *         are undefined but will cause an invalid length exception to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2285
     *         thrown in the underlying JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2286
     * @throws SQLException if an error occurs, the parameter index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2287
     *         or when connected to a data source, the number of bytes the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2288
     *         reads and sends to the database is not equal to the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2289
     *         specified in <i>length</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2290
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2292
    public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2293
        Object binaryStream[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2294
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2295
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2296
        binaryStream = new Object[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2297
        binaryStream[0] = x;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2298
        binaryStream[1] = Integer.valueOf(length);
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2299
        binaryStream[2] = Integer.valueOf(BINARY_STREAM_PARAM);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2300
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2301
             throw new SQLException("Set initParams() before setBinaryStream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2302
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2303
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2304
        params.put(Integer.valueOf(parameterIndex - 1), binaryStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2305
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2306
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2307
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2308
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2309
   * Sets the designated parameter in this <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2310
   * to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2311
   * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2312
   * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2313
   * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2314
   * stream as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2315
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2316
   * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2317
   * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2318
   * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2319
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2320
   * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2321
   * <code>setBinaryStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2322
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2323
   * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2324
   * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2325
   * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2326
   * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2327
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2328
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2329
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2330
  public void setBinaryStream(int parameterIndex, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2331
                              throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2332
      throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2333
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2334
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2335
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2336
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2337
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2338
     * <code>java.io.InputStream</code> object, which will have the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2339
     * number of bytes. The contents of the stream will be read and sent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2340
     * to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2341
     * This method throws an <code>SQLException</code> if the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2342
     * read and sent to the database is not equal to <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2343
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2344
     * When a very large Unicode value is input to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2345
     * <code>LONGVARCHAR</code> parameter, it may be more practical
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2346
     * to send it via a <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2347
     * A JDBC technology-enabled driver will read the data from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2348
     * stream as needed, until it reaches end-of-file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2349
     * The driver will do any necessary conversion from Unicode to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2350
     * database <code>CHAR</code> format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2351
     * The byte format of the Unicode stream must be Java UTF-8, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2352
     * defined in the Java Virtual Machine Specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2353
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2354
     * <P><B>Note:</B> This stream object can be either a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2355
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2356
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2357
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2358
     * This method is deprecated; the method <code>getCharacterStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2359
     * should be used in its place.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2360
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2361
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2362
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2363
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2364
     * Calls made to the method <code>getParams</code> after <code>setUnicodeStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2365
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2366
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2367
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2368
     * is the given <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2369
     * The second element is the value set for <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2370
     * The third element is an internal <code>BaseRowSet</code> constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2371
     * specifying that the stream passed to this method is a Unicode stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2372
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2373
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2374
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2375
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2376
     * In other words, if the input stream being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2377
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2378
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2379
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2380
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2381
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2382
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2383
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2384
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2385
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2386
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2387
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2388
     * @param x the <code>java.io.InputStream</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2389
     *          UNICODE parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2390
     * @param length the number of bytes in the input stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2391
     * @throws SQLException if an error occurs, the parameter index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2392
     *         or the number of bytes the driver reads and sends to the database is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2393
     *         not equal to the number of bytes specified in <i>length</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2394
     * @deprecated getCharacterStream should be used in its place
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2395
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2396
     */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
  2397
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2398
    public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2399
        Object unicodeStream[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2400
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2401
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2402
        unicodeStream = new Object[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2403
        unicodeStream[0] = x;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2404
        unicodeStream[1] = Integer.valueOf(length);
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2405
        unicodeStream[2] = Integer.valueOf(UNICODE_STREAM_PARAM);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2406
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2407
             throw new SQLException("Set initParams() before setUnicodeStream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2408
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2409
        params.put(Integer.valueOf(parameterIndex - 1), unicodeStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2410
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2411
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2412
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2413
     * Sets the designated parameter to the given <code>java.io.Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2414
     * object, which will have the specified number of characters. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2415
     * contents of the reader will be read and sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2416
     * This method throws an <code>SQLException</code> if the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2417
     * read and sent to the database is not equal to <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2418
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2419
     * When a very large Unicode value is input to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2420
     * <code>LONGVARCHAR</code> parameter, it may be more practical
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2421
     * to send it via a <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2422
     * A JDBC technology-enabled driver will read the data from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2423
     * stream as needed until it reaches end-of-file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2424
     * The driver will do any necessary conversion from Unicode to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2425
     * database <code>CHAR</code> format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2426
     * The byte format of the Unicode stream must be Java UTF-8, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2427
     * defined in the Java Virtual Machine Specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2428
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2429
     * <P><B>Note:</B> This stream object can be either a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2430
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2431
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2432
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2433
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2434
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2435
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2436
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2437
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2438
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2439
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2440
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2441
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2442
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2443
     * Calls made to the method <code>getParams</code> after
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2444
     * <code>setCharacterStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2445
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2446
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2447
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2448
     * is the given <code>java.io.Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2449
     * The second element is the value set for <i>length</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2450
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2451
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2452
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2453
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2454
     * In other words, if the reader being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2455
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2456
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2457
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2458
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2459
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2460
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2461
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2462
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2463
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2464
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2465
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2466
     * @param reader the <code>Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2467
     *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2468
     * @param length the number of characters in the stream; lengths of 0 or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2469
     *        less are undefined but will cause an invalid length exception to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2470
     *        be thrown in the underlying JDBC driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2471
     * @throws SQLException if an error occurs, the parameter index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2472
     *        or when connected to a data source, the number of bytes the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2473
     *        reads and sends to the database is not equal to the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2474
     *        specified in <i>length</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2475
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2476
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2477
    public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2478
        Object charStream[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2479
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2480
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2481
        charStream = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2482
        charStream[0] = reader;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2483
        charStream[1] = Integer.valueOf(length);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2484
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2485
             throw new SQLException("Set initParams() before setCharacterStream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2486
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2487
        params.put(Integer.valueOf(parameterIndex - 1), charStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2488
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2489
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2490
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2491
   * Sets the designated parameter in this <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2492
   * to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2493
   * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2494
   * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2495
   * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2496
   * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2497
   * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2498
   * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2499
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2500
   * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2501
   * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2502
   * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2503
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2504
   * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2505
   * <code>setCharacterStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2506
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2507
   * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2508
   * @param reader the <code>java.io.Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2509
   *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2510
   * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2511
   * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2512
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2513
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2514
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2515
  public void setCharacterStream(int parameterIndex,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2516
                          java.io.Reader reader) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2517
      throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2518
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2519
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2520
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2521
     * Sets the designated parameter to an <code>Object</code> in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2522
     * programming language. The second parameter must be an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2523
     * <code>Object</code> type.  For integral values, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2524
     * <code>java.lang</code> equivalent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2525
     * objects should be used. For example, use the class <code>Integer</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2526
     * for an <code>int</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2527
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2528
     * The driver converts this object to the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2529
     * target SQL type before sending it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2530
     * If the object has a custom mapping (is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2531
     * <code>SQLData</code>), the driver should call the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2532
     * <code>SQLData.writeSQL</code> to write the object to the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2533
     * data stream. If, on the other hand, the object is of a class
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2534
     * implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2535
     * <code>Struct</code>, or <code>Array</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2536
     * the driver should pass it to the database as a value of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2537
     * corresponding SQL type.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
  2538
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2539
     * <p>Note that this method may be used to pass database-
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2540
     * specific abstract data types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2541
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2542
     * The parameter value set by this method is stored internally and
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15278
diff changeset
  2543
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2544
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2545
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2546
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2547
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2548
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2549
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2550
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2551
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2552
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2553
     * <code>setObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2554
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2555
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2556
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2557
     * is the given <code>Object</code> instance, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2558
     * second element is the value set for <i>targetSqlType</i>.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2559
     * third element is the value set for <i>scale</i>, which the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2560
     * ignore if the type of the object being set is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2561
     * <code>java.sql.Types.NUMERIC</code> or <code>java.sql.Types.DECIMAL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2562
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2563
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2564
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2565
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2566
     * In other words, if the object being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2567
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2568
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2569
     *<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2570
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2571
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2572
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2573
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2574
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2575
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2576
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2577
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2578
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2579
     * @param x the <code>Object</code> containing the input parameter value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2580
     *        must be an <code>Object</code> type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2581
     * @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2582
     *        to be sent to the database. The <code>scale</code> argument may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2583
     *        further qualify this type. If a non-standard <i>targetSqlType</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2584
     *        is supplied, this method will not throw a <code>SQLException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2585
     *        This allows implicit support for non-standard SQL types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2586
     * @param scale for the types <code>java.sql.Types.DECIMAL</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2587
     *        <code>java.sql.Types.NUMERIC</code>, this is the number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2588
     *        of digits after the decimal point.  For all other types, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2589
     *        value will be ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2590
     * @throws SQLException if an error occurs or the parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2591
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2592
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2593
    public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2594
        Object obj[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2595
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2596
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2597
        obj = new Object[3];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2598
        obj[0] = x;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2599
        obj[1] = Integer.valueOf(targetSqlType);
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2600
        obj[2] = Integer.valueOf(scale);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2601
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2602
             throw new SQLException("Set initParams() before setObject");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2603
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2604
        params.put(Integer.valueOf(parameterIndex - 1), obj);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2605
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2606
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2607
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2608
     * Sets the value of the designated parameter with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2609
     * <code>Object</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2610
     * This method is like <code>setObject(int parameterIndex, Object x, int
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2611
     * targetSqlType, int scale)</code> except that it assumes a scale of zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2612
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2613
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2614
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2615
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2616
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2617
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2618
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2619
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2620
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2621
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2622
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2623
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2624
     * <code>setObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2625
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2626
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2627
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2628
     * is the given <code>Object</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2629
     * The second element is the value set for <i>targetSqlType</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2630
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2631
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2632
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2633
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2634
     * In other words, if the object being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2635
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2636
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2637
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2638
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2639
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2640
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2641
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2642
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2643
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2644
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2645
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2646
     * @param x the <code>Object</code> containing the input parameter value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2647
     *        must be an <code>Object</code> type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2648
     * @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2649
     *        to be sent to the database. If a non-standard <i>targetSqlType</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2650
     *        is supplied, this method will not throw a <code>SQLException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2651
     *        This allows implicit support for non-standard SQL types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2652
     * @throws SQLException if an error occurs or the parameter index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2653
     *        is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2654
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2655
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2656
    public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2657
        Object obj[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2658
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2659
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2660
        obj = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2661
        obj[0] = x;
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2662
        obj[1] = Integer.valueOf(targetSqlType);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2663
        if (params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2664
             throw new SQLException("Set initParams() before setObject");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2665
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2666
        params.put(Integer.valueOf(parameterIndex - 1), obj);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2667
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2668
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2669
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2670
     * Sets the designated parameter to an <code>Object</code> in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2671
     * programming language. The second parameter must be an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2672
     * <code>Object</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2673
     * type.  For integral values, the <code>java.lang</code> equivalent
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2674
     * objects should be used. For example, use the class <code>Integer</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2675
     * for an <code>int</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2676
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2677
     * The JDBC specification defines a standard mapping from
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2678
     * Java <code>Object</code> types to SQL types.  The driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2679
     * use this standard mapping to  convert the given object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2680
     * to its corresponding SQL type before sending it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2681
     * If the object has a custom mapping (is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2682
     * <code>SQLData</code>), the driver should call the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2683
     * <code>SQLData.writeSQL</code> to write the object to the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2684
     * data stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2685
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2686
     * If, on the other hand, the object is of a class
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2687
     * implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2688
     * <code>Struct</code>, or <code>Array</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2689
     * the driver should pass it to the database as a value of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2690
     * corresponding SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2691
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2692
     * This method throws an exception if there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2693
     * is an ambiguity, for example, if the object is of a class
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2694
     * implementing more than one interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2695
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2696
     * Note that this method may be used to pass database-specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2697
     * abstract data types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2698
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2699
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2700
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2701
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2702
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2703
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2704
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2705
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2706
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2707
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2708
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2709
     * After this method has been called, a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2710
     * method <code>getParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2711
     * will return an object array of the current command parameters, which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2712
     * include the <code>Object</code> set for placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2713
     * <code>parameterIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2714
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2715
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2716
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2717
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2718
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2719
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2720
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2721
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2722
     * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2723
     * @throws SQLException if an error occurs the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2724
     *                         parameter index is out of bounds, or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2725
     *                         is ambiguity in the implementation of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2726
     *                         object being set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2727
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2728
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2729
    public void setObject(int parameterIndex, Object x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2730
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2731
        if (params == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2732
             throw new SQLException("Set initParams() before setObject");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2733
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2734
        params.put(Integer.valueOf(parameterIndex - 1), x);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2735
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2736
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2737
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2738
     * Sets the designated parameter to the given <code>Ref</code> object in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2739
     * the Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2740
     * <code>REF</code> value when it sends it to the database. Internally, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2741
     * <code>Ref</code> is represented as a <code>SerialRef</code> to ensure
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2742
     * serializability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2743
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2744
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2745
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2746
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2747
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2748
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2749
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2750
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2751
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2752
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2753
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2754
     * After this method has been called, a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2755
     * method <code>getParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2756
     * will return an object array of the current command parameters, which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2757
     * include the <code>Ref</code> object set for placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2758
     * <code>parameterIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2759
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2760
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2761
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2762
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2763
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2764
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2765
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2766
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2767
     * @param ref a <code>Ref</code> object representing an SQL <code>REF</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2768
     *         value; cannot be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2769
     * @throws SQLException if an error occurs; the parameter index is out of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2770
     *         bounds or the <code>Ref</code> object is <code>null</code>; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2771
     *         the <code>Ref</code> object returns a <code>null</code> base type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2772
     *         name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2773
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2774
     * @see javax.sql.rowset.serial.SerialRef
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2775
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2776
    public void setRef (int parameterIndex, Ref ref) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2777
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2778
        if (params == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2779
             throw new SQLException("Set initParams() before setRef");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2780
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2781
        params.put(Integer.valueOf(parameterIndex - 1), new SerialRef(ref));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2782
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2783
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2784
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2785
     * Sets the designated parameter to the given <code>Blob</code> object in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2786
     * the Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2787
     * <code>BLOB</code> value when it sends it to the database. Internally,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2788
     * the <code>Blob</code> is represented as a <code>SerialBlob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2789
     * to ensure serializability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2790
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2791
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2792
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2793
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2794
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2795
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2796
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2797
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2798
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2799
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2800
     * After this method has been called, a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2801
     * method <code>getParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2802
     * will return an object array of the current command parameters, which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2803
     * include the <code>Blob</code> object set for placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2804
     * <code>parameterIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2805
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2806
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2807
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2808
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2809
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2810
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2811
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2812
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2813
     * @param x a <code>Blob</code> object representing an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2814
     *          <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2815
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2816
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2817
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2818
     * @see javax.sql.rowset.serial.SerialBlob
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2819
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2820
    public void setBlob (int parameterIndex, Blob x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2821
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2822
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2823
             throw new SQLException("Set initParams() before setBlob");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2824
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2825
        params.put(Integer.valueOf(parameterIndex - 1), new SerialBlob(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2826
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2827
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2828
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2829
     * Sets the designated parameter to the given <code>Clob</code> object in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2830
     * the Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2831
     * <code>CLOB</code> value when it sends it to the database. Internally, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2832
     * <code>Clob</code> is represented as a <code>SerialClob</code> to ensure
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2833
     * serializability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2834
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2835
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2836
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2837
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2838
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2839
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2840
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2841
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2842
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2843
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2844
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2845
     * After this method has been called, a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2846
     * method <code>getParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2847
     * will return an object array of the current command parameters, which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2848
     * include the <code>Clob</code> object set for placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2849
     * <code>parameterIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2850
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2851
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2852
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2853
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2854
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2855
     *     in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2856
     *     The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2857
     *     <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2858
     * @param x a <code>Clob</code> object representing an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2859
     *     <code>CLOB</code> value; cannot be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2860
     * @throws SQLException if an error occurs; the parameter index is out of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2861
     *     bounds or the <code>Clob</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2862
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2863
     * @see javax.sql.rowset.serial.SerialBlob
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2864
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2865
    public void setClob (int parameterIndex, Clob x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2866
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2867
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2868
             throw new SQLException("Set initParams() before setClob");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2869
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2870
        params.put(Integer.valueOf(parameterIndex - 1), new SerialClob(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2871
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2872
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2873
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2874
     * Sets the designated parameter to an <code>Array</code> object in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2875
     * Java programming language.  The driver converts this to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2876
     * <code>ARRAY</code> value when it sends it to the database. Internally,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2877
     * the <code>Array</code> is represented as a <code>SerialArray</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2878
     * to ensure serializability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2879
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2880
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2881
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2882
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2883
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2884
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2885
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2886
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2887
     * Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2888
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2889
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2890
     * After this method has been called, a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2891
     * method <code>getParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2892
     * will return an object array of the current command parameters, which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2893
     * include the <code>Array</code> object set for placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2894
     * <code>parameterIndex</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2895
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2896
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2897
     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2898
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2899
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2900
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2901
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2902
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2903
     * @param array an <code>Array</code> object representing an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2904
     *        <code>ARRAY</code> value; cannot be null. The <code>Array</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2905
     *        passed to this method must return a non-null Object for all
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2906
     *        <code>getArray()</code> method calls. A null value will cause a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2907
     *        <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2908
     * @throws SQLException if an error occurs; the parameter index is out of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2909
     *        bounds or the <code>ARRAY</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2910
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2911
     * @see javax.sql.rowset.serial.SerialArray
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2912
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2913
    public void setArray (int parameterIndex, Array array) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2914
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2915
        if (params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2916
             throw new SQLException("Set initParams() before setArray");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2917
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2918
        params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2919
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2920
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2921
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2922
     * Sets the designated parameter to the given <code>java.sql.Date</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2923
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2924
     * When the DBMS does not store time zone information, the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2925
     * the given <code>Calendar</code> object to construct the SQL <code>DATE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2926
     * value to send to the database. With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2927
     * <code>Calendar</code> object, the driver can calculate the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2928
     * taking into account a custom time zone.  If no <code>Calendar</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2929
     * object is specified, the driver uses the time zone of the Virtual Machine
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2930
     * that is running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2931
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2932
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2933
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2934
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2935
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2936
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2937
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2938
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2939
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2940
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2941
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2942
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2943
     * <code>setDate</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2944
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2945
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2946
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2947
     * is the given <code>java.sql.Date</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2948
     * The second element is the value set for <i>cal</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2949
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2950
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2951
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2952
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2953
     * In other words, if the date being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2954
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2955
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2956
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2957
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2958
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2959
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2960
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2961
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2962
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2963
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2964
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2965
     * @param x a <code>java.sql.Date</code> object representing an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2966
     *        <code>DATE</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2967
     * @param cal a <code>java.util.Calendar</code> object to use when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2968
     *        when constructing the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2969
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2970
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2971
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2972
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2973
    public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2974
        Object date[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2975
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2976
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2977
        date = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2978
        date[0] = x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2979
        date[1] = cal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2980
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2981
             throw new SQLException("Set initParams() before setDate");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2982
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  2983
        params.put(Integer.valueOf(parameterIndex - 1), date);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2984
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2985
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2986
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2987
     * Sets the designated parameter to the given <code>java.sql.Time</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2988
     * object.  The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2989
     * to an SQL <code>TIME</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2990
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2991
     * When the DBMS does not store time zone information, the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2992
     * the given <code>Calendar</code> object to construct the SQL <code>TIME</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2993
     * value to send to the database. With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2994
     * <code>Calendar</code> object, the driver can calculate the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2995
     * taking into account a custom time zone.  If no <code>Calendar</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2996
     * object is specified, the driver uses the time zone of the Virtual Machine
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2997
     * that is running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2998
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2999
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3000
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3001
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3002
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3003
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3004
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3005
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3006
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3007
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3008
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3009
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3010
     * <code>setTime</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3011
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3012
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3013
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3014
     * is the given <code>java.sql.Time</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3015
     * The second element is the value set for <i>cal</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3016
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3017
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3018
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3019
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3020
     * In other words, if the time being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3021
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3022
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3023
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3024
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3025
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3026
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3027
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3028
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3029
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3030
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3031
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3032
     * @param x a <code>java.sql.Time</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3033
     * @param cal the <code>java.util.Calendar</code> object the driver can use to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3034
     *         construct the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3035
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3036
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3037
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3038
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3039
    public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3040
        Object time[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3041
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3042
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3043
        time = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3044
        time[0] = x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3045
        time[1] = cal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3046
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3047
             throw new SQLException("Set initParams() before setTime");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3048
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  3049
        params.put(Integer.valueOf(parameterIndex - 1), time);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3050
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3051
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3052
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3053
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3054
     * <code>java.sql.Timestamp</code> object.  The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3055
     * to an SQL <code>TIMESTAMP</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3056
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3057
     * When the DBMS does not store time zone information, the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3058
     * the given <code>Calendar</code> object to construct the SQL <code>TIMESTAMP</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3059
     * value to send to the database. With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3060
     * <code>Calendar</code> object, the driver can calculate the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3061
     * taking into account a custom time zone.  If no <code>Calendar</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3062
     * object is specified, the driver uses the time zone of the Virtual Machine
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3063
     * that is running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3064
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3065
     * The parameter value set by this method is stored internally and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3066
     * will be supplied as the appropriate parameter in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3067
     * object's command when the method <code>execute</code> is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3068
     * Methods such as <code>execute</code> and <code>populate</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3069
     * provided in any class that extends this class and implements one or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3070
     * more of the standard JSR-114 <code>RowSet</code> interfaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3071
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3072
     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3073
     * as it is undefined in this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3074
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3075
     * Calls made to the method <code>getParams</code> after this version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3076
     * <code>setTimestamp</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3077
     * has been called will return an array containing the parameter values that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3078
     * have been set.  In that array, the element that represents the values
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3079
     * set with this method will itself be an array. The first element of that array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3080
     * is the given <code>java.sql.Timestamp</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3081
     * The second element is the value set for <i>cal</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3082
     * The parameter number is indicated by an element's position in the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3083
     * returned by the method <code>getParams</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3084
     * with the first element being the value for the first placeholder parameter, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3085
     * second element being the value for the second placeholder parameter, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3086
     * In other words, if the timestamp being set is the value for the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3087
     * placeholder parameter, the array containing it will be the second element in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3088
     * the array returned by <code>getParams</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3089
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3090
     * Note that because the numbering of elements in an array starts at zero,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3091
     * the array element that corresponds to placeholder parameter number
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3092
     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3093
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3094
     * @param parameterIndex the ordinal number of the placeholder parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3095
     *        in this <code>RowSet</code> object's command that is to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3096
     *        The first parameter is 1, the second is 2, and so on; must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3097
     *        <code>1</code> or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3098
     * @param x a <code>java.sql.Timestamp</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3099
     * @param cal the <code>java.util.Calendar</code> object the driver can use to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3100
     *         construct the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3101
     * @throws SQLException if an error occurs or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3102
     *                         parameter index is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3103
     * @see #getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3104
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3105
    public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3106
        Object timestamp[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3107
        checkParamIndex(parameterIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3108
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3109
        timestamp = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3110
        timestamp[0] = x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3111
        timestamp[1] = cal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3112
        if(params == null){
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3113
             throw new SQLException("Set initParams() before setTimestamp");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3114
        }
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  3115
        params.put(Integer.valueOf(parameterIndex - 1), timestamp);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3117
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3119
     * Clears all of the current parameter values in this <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3120
     * object's internal representation of the parameters to be set in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3121
     * this <code>RowSet</code> object's command when it is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3122
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3123
     * In general, parameter values remain in force for repeated use in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3124
     * this <code>RowSet</code> object's command. Setting a parameter value with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3125
     * setter methods automatically clears the value of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3126
     * designated parameter and replaces it with the new specified value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3127
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3128
     * This method is called internally by the <code>setCommand</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3129
     * method to clear all of the parameters set for the previous command.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3130
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3131
     * Furthermore, this method differs from the <code>initParams</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3132
     * method in that it maintains the schema of the <code>RowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3133
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3134
     * @throws SQLException if an error occurs clearing the parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3135
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3136
    public void clearParameters() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3137
        params.clear();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3138
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3139
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3141
     * Retrieves an array containing the parameter values (both Objects and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3142
     * primitives) that have been set for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3143
     * <code>RowSet</code> object's command and throws an <code>SQLException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3144
     * if all parameters have not been set.   Before the command is sent to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3145
     * DBMS to be executed, these parameters will be substituted
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3146
     * for placeholder parameters in the  <code>PreparedStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3147
     * that is the command for a <code>RowSet</code> implementation extending
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3148
     * the <code>BaseRowSet</code> class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3149
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3150
     * Each element in the array that is returned is an <code>Object</code> instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3151
     * that contains the values of the parameters supplied to a setter method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3152
     * The order of the elements is determined by the value supplied for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3153
     * <i>parameterIndex</i>.  If the setter method takes only the parameter index
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3154
     * and the value to be set (possibly null), the array element will contain the value to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3155
     * (which will be expressed as an <code>Object</code>).  If there are additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3156
     * parameters, the array element will itself be an array containing the value to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3157
     * plus any additional parameter values supplied to the setter method. If the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3158
     * sets a stream, the array element includes the type of stream being supplied to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3159
     * method. These additional parameters are for the use of the driver or the DBMS and may or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3160
     * may not be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3161
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3162
     * NOTE: Stored parameter values of types <code>Array</code>, <code>Blob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3163
     * <code>Clob</code> and <code>Ref</code> are returned as <code>SerialArray</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3164
     * <code>SerialBlob</code>, <code>SerialClob</code> and <code>SerialRef</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3165
     * respectively.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3166
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3167
     * @return an array of <code>Object</code> instances that includes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3168
     *         parameter values that may be set in this <code>RowSet</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3169
     *         command; an empty array if no parameters have been set
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20880
diff changeset
  3170
     * @throws SQLException if an error occurs retrieving the object array of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3171
     *         parameters of this <code>RowSet</code> object or if not all parameters have
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3172
     *         been set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3174
    public Object[] getParams() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3175
        if (params == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3176
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3177
            initParams();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3178
            Object [] paramsArray = new Object[params.size()];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3179
            return paramsArray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3180
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3181
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3182
            // The parameters may be set in random order
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3183
            // but all must be set, check to verify all
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3184
            // have been set till the last parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3185
            // else throw exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3186
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3187
            Object[] paramsArray = new Object[params.size()];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3188
            for (int i = 0; i < params.size(); i++) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  3189
               paramsArray[i] = params.get(Integer.valueOf(i));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3190
               if (paramsArray[i] == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3191
                 throw new SQLException("missing parameter: " + (i + 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3192
               } //end if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3193
            } //end for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3194
            return paramsArray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3195
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3196
        } //end if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3197
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3198
    } //end getParams
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3199
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3200
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3201
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3202
    * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3203
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3204
    * <P><B>Note:</B> You must specify the parameter's SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3205
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3206
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3207
    * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3208
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3209
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3210
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3211
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3212
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3213
   public void setNull(String parameterName, int sqlType) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3214
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3215
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3216
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3217
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3218
    * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3219
    * This version of the method <code>setNull</code> should
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3220
    * be used for user-defined types and REF type parameters.  Examples
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3221
    * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3222
    * named array types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3223
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3224
    * <P><B>Note:</B> To be portable, applications must give the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3225
    * SQL type code and the fully-qualified SQL type name when specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3226
    * a NULL user-defined or REF parameter.  In the case of a user-defined type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3227
    * the name is the type name of the parameter itself.  For a REF
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3228
    * parameter, the name is the type name of the referenced type.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3229
    * a JDBC driver does not need the type code or type name information,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3230
    * it may ignore it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3231
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3232
    * Although it is intended for user-defined and Ref parameters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3233
    * this method may be used to set a null parameter of any JDBC type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3234
    * If the parameter does not have a user-defined or REF type, the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3235
    * typeName is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3236
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3237
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3238
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3239
    * @param sqlType a value from <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3240
    * @param typeName the fully-qualified name of an SQL user-defined type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3241
    *        ignored if the parameter is not a user-defined type or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3242
    *        SQL <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3243
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3244
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3245
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3246
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3247
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3248
   public void setNull (String parameterName, int sqlType, String typeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3249
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3250
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3251
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3252
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3253
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3254
    * Sets the designated parameter to the given Java <code>boolean</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3255
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3256
    * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3257
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3258
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3259
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3260
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3261
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3262
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3263
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3264
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3265
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3266
   public void setBoolean(String parameterName, boolean x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3267
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3268
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3269
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3270
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3271
    * Sets the designated parameter to the given Java <code>byte</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3272
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3273
    * to an SQL <code>TINYINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3274
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3275
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3276
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3277
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3278
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3279
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3280
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3281
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3282
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3283
   public void setByte(String parameterName, byte x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3284
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3285
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3286
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3287
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3288
    * Sets the designated parameter to the given Java <code>short</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3289
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3290
    * to an SQL <code>SMALLINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3291
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3292
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3293
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3294
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3295
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3296
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3297
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3298
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3299
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3300
   public void setShort(String parameterName, short x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3301
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3302
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3303
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3304
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3305
    * Sets the designated parameter to the given Java <code>int</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3306
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3307
    * to an SQL <code>INTEGER</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3308
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3309
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3310
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3311
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3312
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3313
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3314
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3315
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3316
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3317
   public void setInt(String parameterName, int x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3318
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3319
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3320
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3321
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3322
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3323
    * Sets the designated parameter to the given Java <code>long</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3324
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3325
    * to an SQL <code>BIGINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3326
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3327
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3328
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3329
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3330
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3331
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3332
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3333
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3334
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3335
   public void setLong(String parameterName, long x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3336
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3337
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3338
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3339
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3340
    * Sets the designated parameter to the given Java <code>float</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3341
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3342
    * to an SQL <code>FLOAT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3343
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3344
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3345
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3346
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3347
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3348
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3349
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3350
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3351
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3352
   public void setFloat(String parameterName, float x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3353
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3354
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3355
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3356
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3357
    * Sets the designated parameter to the given Java <code>double</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3358
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3359
    * to an SQL <code>DOUBLE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3360
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3361
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3362
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3363
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3364
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3365
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3366
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3367
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3368
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3369
   public void setDouble(String parameterName, double x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3370
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3371
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3372
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3373
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3374
    * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3375
    * <code>java.math.BigDecimal</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3376
    * The driver converts this to an SQL <code>NUMERIC</code> value when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3377
    * it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3378
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3379
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3380
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3381
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3382
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3383
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3384
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3385
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3386
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3387
   public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3388
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3389
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3390
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3391
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3392
    * Sets the designated parameter to the given Java <code>String</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3393
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3394
    * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3395
    * (depending on the argument's
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3396
    * size relative to the driver's limits on <code>VARCHAR</code> values)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3397
    * when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3398
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3399
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3400
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3401
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3402
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3403
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3404
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3405
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3406
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3407
   public void setString(String parameterName, String x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3408
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3409
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3410
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3411
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3412
    * Sets the designated parameter to the given Java array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3413
    * The driver converts this to an SQL <code>VARBINARY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3414
    * <code>LONGVARBINARY</code> (depending on the argument's size relative
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3415
    * to the driver's limits on <code>VARBINARY</code> values) when it sends
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3416
    * it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3417
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3418
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3419
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3420
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3421
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3422
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3423
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3424
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3425
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3426
   public void setBytes(String parameterName, byte x[]) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3427
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3428
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3429
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3430
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3431
    * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3432
    * The driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3433
    * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3434
    * database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3435
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3436
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3437
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3438
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3439
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3440
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3441
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3442
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3443
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3444
   public void setTimestamp(String parameterName, java.sql.Timestamp x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3445
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3446
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3447
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3448
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3449
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3450
    * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3451
    * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3452
    * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3453
    * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3454
    * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3455
    * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3456
    * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3457
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3458
    * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3459
    * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3460
    * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3461
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3462
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3463
    * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3464
    * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3465
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3466
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3467
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3468
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3469
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3470
   public void setAsciiStream(String parameterName, java.io.InputStream x, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3471
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3472
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3473
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3474
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3475
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3476
    * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3477
    * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3478
    * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3479
    * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3480
    * <code>java.io.InputStream</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3481
    * as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3482
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3483
    * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3484
    * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3485
    * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3486
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3487
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3488
    * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3489
    * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3490
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3491
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3492
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3493
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3494
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3495
   public void setBinaryStream(String parameterName, java.io.InputStream x,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3496
                        int length) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3497
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3498
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3499
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3500
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3501
    * Sets the designated parameter to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3502
    * object, which is the given number of characters long.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3503
    * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3504
    * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3505
    * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3506
    * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3507
    * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3508
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3509
    * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3510
    * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3511
    * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3512
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3513
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3514
    * @param reader the <code>java.io.Reader</code> object that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3515
    *        contains the UNICODE data used as the designated parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3516
    * @param length the number of characters in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3517
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3518
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3519
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3520
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3521
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3522
   public void setCharacterStream(String parameterName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3523
                           java.io.Reader reader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3524
                           int length) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3525
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3526
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3527
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3528
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3529
   * Sets the designated parameter to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3530
   * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3531
   * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3532
   * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3533
   * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3534
   * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3535
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3536
   * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3537
   * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3538
   * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3539
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3540
   * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3541
   * <code>setAsciiStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3542
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3543
   * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3544
   * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3545
   * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3546
   * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3547
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  3548
   * @since 1.6
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3549
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3550
  public void setAsciiStream(String parameterName, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3551
          throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3552
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3553
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3554
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3555
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3556
    * Sets the designated parameter to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3557
    * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3558
    * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3559
    * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3560
    * stream as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3561
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3562
    * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3563
    * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3564
    * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3565
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3566
    * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3567
    * <code>setBinaryStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3568
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3569
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3570
    * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3571
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3572
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3573
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3574
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3575
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3576
   public void setBinaryStream(String parameterName, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3577
   throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3578
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3579
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3580
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3581
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3582
    * Sets the designated parameter to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3583
    * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3584
    * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3585
    * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3586
    * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3587
    * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3588
    * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3589
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3590
    * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3591
    * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3592
    * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3593
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3594
    * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3595
    * <code>setCharacterStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3596
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3597
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3598
    * @param reader the <code>java.io.Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3599
    *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3600
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3601
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3602
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3603
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3604
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3605
   public void setCharacterStream(String parameterName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3606
                         java.io.Reader reader) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3607
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3608
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3609
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3610
 /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3611
  * Sets the designated parameter in this <code>RowSet</code> object's command
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3612
  * to a <code>Reader</code> object. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3613
  * <code>Reader</code> reads the data till end-of-file is reached. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3614
  * driver does the necessary conversion from Java character format to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3615
  * the national character set in the database.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 21278
diff changeset
  3616
  *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3617
  * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3618
  * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3619
  * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3620
  * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3621
  * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3622
  * <code>setNCharacterStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3623
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3624
  * @param parameterIndex of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3625
  * @param value the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3626
  * @throws SQLException if the driver does not support national
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3627
  *         character sets;  if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3628
  *  error could occur ; if a database access error occurs; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3629
  * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3630
  * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3631
  * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3632
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3633
  public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3634
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3635
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3636
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3637
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3638
    * Sets the value of the designated parameter with the given object. The second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3639
    * argument must be an object type; for integral values, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3640
    * <code>java.lang</code> equivalent objects should be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3641
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3642
    * <p>The given Java object will be converted to the given targetSqlType
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3643
    * before being sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3644
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3645
    * If the object has a custom mapping (is of a class implementing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3646
    * interface <code>SQLData</code>),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3647
    * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3648
    * to the SQL data stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3649
    * If, on the other hand, the object is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3650
    * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,  <code>NClob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3651
    *  <code>Struct</code>, <code>java.net.URL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3652
    * or <code>Array</code>, the driver should pass it to the database as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3653
    * value of the corresponding SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3654
    * <P>
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3655
    * Note that this method may be used to pass database-
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3656
    * specific abstract data types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3657
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3658
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3659
    * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3660
    * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3661
    * sent to the database. The scale argument may further qualify this type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3662
    * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3663
    *          this is the number of digits after the decimal point.  For all other
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3664
    *          types, this value will be ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3665
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3666
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3667
    * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3668
    * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3669
    * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3670
    * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3671
    *  <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3672
    * or  <code>STRUCT</code> data type and the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3673
    * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3674
    * @see Types
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3675
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3676
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3677
   public void setObject(String parameterName, Object x, int targetSqlType, int scale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3678
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3679
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3680
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3681
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3682
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3683
    * Sets the value of the designated parameter with the given object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3684
    * This method is like the method <code>setObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3685
    * above, except that it assumes a scale of zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3686
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3687
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3688
    * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3689
    * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3690
    *                      sent to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3691
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3692
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3693
    * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3694
    * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3695
    * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3696
    * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3697
    *  <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3698
    * or  <code>STRUCT</code> data type and the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3699
    * this data type
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3700
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3701
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3702
   public void setObject(String parameterName, Object x, int targetSqlType)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3703
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3704
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3705
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3706
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3707
  /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3708
   * Sets the value of the designated parameter with the given object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3709
   * The second parameter must be of type <code>Object</code>; therefore, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3710
   * <code>java.lang</code> equivalent objects should be used for built-in types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3711
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3712
   * <p>The JDBC specification specifies a standard mapping from
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3713
   * Java <code>Object</code> types to SQL types.  The given argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3714
   * will be converted to the corresponding SQL type before being
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3715
   * sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3716
   *
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3717
   * <p>Note that this method may be used to pass database-
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3718
   * specific abstract data types, by using a driver-specific Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3719
   * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3720
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3721
   * If the object is of a class implementing the interface <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3722
   * the JDBC driver should call the method <code>SQLData.writeSQL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3723
   * to write it to the SQL data stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3724
   * If, on the other hand, the object is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3725
   * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,  <code>NClob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3726
   *  <code>Struct</code>, <code>java.net.URL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3727
   * or <code>Array</code>, the driver should pass it to the database as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3728
   * value of the corresponding SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3729
   * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3730
   * This method throws an exception if there is an ambiguity, for example, if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3731
   * object is of a class implementing more than one of the interfaces named above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3732
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3733
   * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3734
   * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3735
   * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3736
   * this method is called on a closed <code>CallableStatement</code> or if the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3737
   *            <code>Object</code> parameter is ambiguous
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3738
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3739
   * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  3740
   * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3741
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3742
  public void setObject(String parameterName, Object x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3743
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3744
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3745
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3746
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3747
    * Sets the designated parameter to a <code>InputStream</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3748
    * The <code>InputStream</code> must contain  the number
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3749
    * of characters specified by length otherwise a <code>SQLException</code> will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3750
    * generated when the <code>PreparedStatement</code> is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3751
    * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3752
    * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3753
    * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3754
    * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3755
    * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3756
    * @param parameterIndex index of the first parameter is 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3757
    * the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3758
    * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3759
    * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3760
    * @param length the number of bytes in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3761
    * @throws SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3762
    * this method is called on a closed <code>PreparedStatement</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3763
    * if parameterIndex does not correspond
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3764
    * to a parameter marker in the SQL statement,  if the length specified
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3765
    * is less than zero or if the number of bytes in the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3766
    * <code>InputStream</code> does not match the specified length.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3767
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3768
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3769
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3770
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3771
    public void setBlob(int parameterIndex, InputStream inputStream, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3772
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3773
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3774
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3775
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3776
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3777
    * Sets the designated parameter to a <code>InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3778
    * This method differs from the <code>setBinaryStream (int, InputStream)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3779
    * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3780
    * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3781
    * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3782
    * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3783
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3784
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3785
    * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3786
    * <code>setBlob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3787
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3788
    * @param parameterIndex index of the first parameter is 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3789
    * the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3790
    * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3791
    * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3792
    * @throws SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3793
    * this method is called on a closed <code>PreparedStatement</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3794
    * if parameterIndex does not correspond
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3795
    * to a parameter marker in the SQL statement,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3796
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3797
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3798
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3799
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3800
    public void setBlob(int parameterIndex, InputStream inputStream)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3801
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3802
        throw new SQLFeatureNotSupportedException("Feature not supported");
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3803
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3804
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3805
    /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3806
     * Sets the designated parameter to a <code>InputStream</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3807
     * The <code>Inputstream</code> must contain  the number
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3808
     * of characters specified by length, otherwise a <code>SQLException</code> will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3809
     * generated when the <code>CallableStatement</code> is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3810
     * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3811
     * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3812
     * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3813
     * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3814
     * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3815
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3816
     * @param parameterName the name of the parameter to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3817
     * the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3818
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3819
     * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3820
     * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3821
     * @param length the number of bytes in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3822
     * @throws SQLException  if parameterIndex does not correspond
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3823
     * to a parameter marker in the SQL statement,  or if the length specified
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3824
     * is less than zero; if the number of bytes in the <code>InputStream</code> does not match
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20880
diff changeset
  3825
     * the specified length; if a database access error occurs or
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3826
     * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3827
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3828
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3829
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3830
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3831
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3832
     public void setBlob(String parameterName, InputStream inputStream, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3833
        throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3834
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3835
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3836
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3837
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3838
    * Sets the designated parameter to the given <code>java.sql.Blob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3839
    * The driver converts this to an SQL <code>BLOB</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3840
    * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3841
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3842
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3843
    * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3844
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3845
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3846
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3847
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3848
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3849
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3850
   public void setBlob (String parameterName, Blob x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3851
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3852
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3853
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3854
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3855
    * Sets the designated parameter to a <code>InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3856
    * This method differs from the <code>setBinaryStream (int, InputStream)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3857
    * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3858
    * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3859
    * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3860
    * data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3861
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3862
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3863
    * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3864
    * <code>setBlob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3865
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3866
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3867
    * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3868
    * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3869
    * @throws SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3870
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3871
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3872
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3873
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3874
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3875
    public void setBlob(String parameterName, InputStream inputStream)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3876
       throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3877
        throw new SQLFeatureNotSupportedException("Feature not supported");
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3878
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3879
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3880
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3881
    * Sets the designated parameter to a <code>Reader</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3882
    * The reader must contain  the number
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3883
    * of characters specified by length otherwise a <code>SQLException</code> will be
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3884
    * generated when the <code>PreparedStatement</code> is executed.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3885
    * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3886
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3887
    * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3888
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3889
    * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3890
    * @param parameterIndex index of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3891
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3892
    * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3893
    * @throws SQLException if a database access error occurs, this method is called on
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3894
    * a closed <code>PreparedStatement</code>, if parameterIndex does not correspond to a parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3895
    * marker in the SQL statement, or if the length specified is less than zero.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3896
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3897
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3898
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3899
    */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3900
   public void setClob(int parameterIndex, Reader reader, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3901
     throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3902
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3903
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3904
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3905
  /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3906
   * Sets the designated parameter to a <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3907
   * This method differs from the <code>setCharacterStream (int, Reader)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3908
   * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3909
   * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3910
   * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3911
   * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3912
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3913
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3914
   * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3915
   * <code>setClob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3916
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3917
   * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3918
   * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3919
   * @throws SQLException if a database access error occurs, this method is called on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3920
   * a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3921
   * marker in the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3922
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3923
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3924
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3925
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3926
   public void setClob(int parameterIndex, Reader reader)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3927
     throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3928
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3929
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3930
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3931
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3932
    * Sets the designated parameter to a <code>Reader</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3933
    * The <code>reader</code> must contain  the number
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3934
    * of characters specified by length otherwise a <code>SQLException</code> will be
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3935
    * generated when the <code>CallableStatement</code> is executed.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3936
    * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3937
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3938
    * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3939
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3940
    * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3941
    * @param parameterName the name of the parameter to be set
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3942
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3943
    * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3944
    * @throws SQLException if parameterIndex does not correspond to a parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3945
    * marker in the SQL statement; if the length specified is less than zero;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3946
    * a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3947
    * this method is called on a closed <code>CallableStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3948
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3949
    * this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3950
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3951
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3952
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3953
   public void setClob(String parameterName, Reader reader, long length)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3954
      throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3955
       throw new SQLFeatureNotSupportedException("Feature not supported");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3956
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3957
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3958
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3959
    * Sets the designated parameter to the given <code>java.sql.Clob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3960
    * The driver converts this to an SQL <code>CLOB</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3961
    * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3962
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3963
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3964
    * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3965
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3966
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3967
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3968
    * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3969
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3970
    */
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3971
   public void setClob (String parameterName, Clob x) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3972
       throw new SQLFeatureNotSupportedException("Feature not supported");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3973
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3974
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3975
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3976
    * Sets the designated parameter to a <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3977
    * This method differs from the <code>setCharacterStream (int, Reader)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3978
    * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3979
    * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3980
    * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3981
    * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3982
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3983
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3984
    * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3985
    * <code>setClob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3986
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3987
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3988
    * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3989
    * @throws SQLException if a database access error occurs or this method is called on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3990
    * a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3991
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3992
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3993
    * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3994
    */
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3995
    public void setClob(String parameterName, Reader reader) throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3996
        throw new SQLFeatureNotSupportedException("Feature not supported");
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3997
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3998
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  3999
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4000
    * Sets the designated parameter to the given <code>java.sql.Date</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4001
    * using the default time zone of the virtual machine that is running
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4002
    * the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4003
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4004
    * to an SQL <code>DATE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4005
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4006
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4007
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4008
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4009
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4010
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4011
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  4012
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4013
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4014
   public void setDate(String parameterName, java.sql.Date x)
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4015
           throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4016
       throw new SQLFeatureNotSupportedException("Feature not supported");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4017
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4018
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4019
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4020
    * Sets the designated parameter to the given <code>java.sql.Date</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4021
    * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4022
    * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4023
    * which the driver then sends to the database.  With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4024
    * a <code>Calendar</code> object, the driver can calculate the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4025
    * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4026
    * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4027
    * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4028
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4029
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4030
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4031
    * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4032
    *            to construct the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4033
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4034
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4035
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4036
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  4037
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4038
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4039
   public void setDate(String parameterName, java.sql.Date x, Calendar cal)
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4040
           throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4041
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4042
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4043
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4044
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4045
    * Sets the designated parameter to the given <code>java.sql.Time</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4046
    * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4047
    * to an SQL <code>TIME</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4048
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4049
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4050
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4051
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4052
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4053
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4054
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  4055
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4056
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4057
   public void setTime(String parameterName, java.sql.Time x)
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4058
           throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4059
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4060
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4061
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4062
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4063
    * Sets the designated parameter to the given <code>java.sql.Time</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4064
    * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4065
    * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4066
    * which the driver then sends to the database.  With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4067
    * a <code>Calendar</code> object, the driver can calculate the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4068
    * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4069
    * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4070
    * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4071
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4072
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4073
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4074
    * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4075
    *            to construct the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4076
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4077
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4078
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4079
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  4080
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4081
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4082
   public void setTime(String parameterName, java.sql.Time x, Calendar cal)
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4083
           throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4084
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4085
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4086
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4087
   /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4088
    * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4089
    * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4090
    * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4091
    * which the driver then sends to the database.  With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4092
    * a <code>Calendar</code> object, the driver can calculate the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4093
    * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4094
    * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4095
    * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4096
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4097
    * @param parameterName the name of the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4098
    * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4099
    * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4100
    *            to construct the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4101
    * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4102
    * this method is called on a closed <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4103
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4104
    * this method
3843
b582759a6e99 6737212: Fixed javadoc warning messages in RowSet classes
lancea
parents: 2
diff changeset
  4105
    * @see #getParams
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4106
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4107
   public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4108
           throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4109
        throw new SQLFeatureNotSupportedException("Feature not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4110
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4111
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4112
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4113
    * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4114
    * SQL <code>XML</code> value when it sends it to the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4115
    * @param parameterIndex index of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4116
    * @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4117
    * @throws SQLException if a database access error occurs, this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4118
    *  is called on a closed result set,
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4119
    * the <code>java.xml.transform.Result</code>,
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4120
    *  <code>Writer</code> or <code>OutputStream</code> has not been closed
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4121
    * for the <code>SQLXML</code> object  or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4122
    *  if there is an error processing the XML value.  The <code>getCause</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4123
    *  of the exception may provide a more detailed exception, for example, if the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4124
    *  stream does not contain valid XML.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4125
    * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4126
    * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4127
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4128
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4129
   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4130
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4131
   }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4132
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4133
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4134
    * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4135
    * <code>SQL XML</code> value when it sends it to the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4136
    * @param parameterName the name of the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4137
    * @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4138
    * @throws SQLException if a database access error occurs, this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4139
    *  is called on a closed result set,
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4140
    * the <code>java.xml.transform.Result</code>,
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4141
    *  <code>Writer</code> or <code>OutputStream</code> has not been closed
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4142
    * for the <code>SQLXML</code> object  or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4143
    *  if there is an error processing the XML value.  The <code>getCause</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4144
    *  of the exception may provide a more detailed exception, for example, if the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4145
    *  stream does not contain valid XML.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4146
    * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4147
    * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4148
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4149
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4150
   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4151
       throw new SQLFeatureNotSupportedException("Feature not supported");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4152
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4153
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4154
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4155
   * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4156
   * driver converts this to a SQL <code>ROWID</code> value when it sends it
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4157
   * to the database
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4158
   *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4159
   * @param parameterIndex the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4160
   * @param x the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4161
   * @throws SQLException if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4162
   * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4163
   * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4164
   *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4165
   * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4166
   */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4167
  public void setRowId(int parameterIndex, RowId x) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4168
      throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4169
  }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4170
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4171
  /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4172
   * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4173
   * driver converts this to a SQL <code>ROWID</code> when it sends it to the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4174
   * database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4175
   *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4176
   * @param parameterName the name of the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4177
   * @param x the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4178
   * @throws SQLException if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4179
   * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4180
   * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4181
   * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4182
   */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4183
  public void setRowId(String parameterName, RowId x) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4184
      throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4185
  }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4186
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4187
  /**
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4188
   * Sets the designated parameter to the given <code>String</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4189
   * The driver converts this to a SQL <code>NCHAR</code> or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4190
   * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4191
   * (depending on the argument's
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4192
   * size relative to the driver's limits on <code>NVARCHAR</code> values)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4193
   * when it sends it to the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4194
   *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4195
   * @param parameterIndex of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4196
   * @param value the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4197
   * @throws SQLException if the driver does not support national
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4198
   * character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4199
   * error could occur ; or if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4200
   * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4201
   * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4202
   * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4203
   */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4204
  public void setNString(int parameterIndex, String value) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4205
      throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4206
  }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4207
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4208
  /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4209
   * Sets the designated parameter to the given <code>String</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4210
   * The driver converts this to a SQL <code>NCHAR</code> or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4211
   * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4212
   * @param parameterName the name of the column to be set
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4213
   * @param value the parameter value
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4214
   * @throws SQLException if the driver does not support national
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4215
   * character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4216
   * error could occur; or if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4217
   * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4218
   * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4219
   * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4220
   */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4221
  public void setNString(String parameterName, String value) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4222
     throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4223
  }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4224
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4225
  /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4226
   * Sets the designated parameter to a <code>Reader</code> object. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4227
   * <code>Reader</code> reads the data till end-of-file is reached. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4228
   * driver does the necessary conversion from Java character format to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4229
   * the national character set in the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4230
   * @param parameterIndex of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4231
   * @param value the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4232
   * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4233
   * @throws SQLException if the driver does not support national
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4234
   *         character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4235
   *  error could occur ; or if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4236
   * @throws SQLFeatureNotSupportedException if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4237
   * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4238
   * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4239
   */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4240
  public void setNCharacterStream(int parameterIndex, Reader value, long length)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4241
          throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4242
      throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4243
  }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4244
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4245
  /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4246
   * Sets the designated parameter to a <code>Reader</code> object. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4247
   * <code>Reader</code> reads the data till end-of-file is reached. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4248
   * driver does the necessary conversion from Java character format to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4249
   * the national character set in the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4250
   * @param parameterName the name of the column to be set
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4251
   * @param value the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4252
   * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4253
   * @throws SQLException if the driver does not support national
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4254
   *         character sets;  if the driver can detect that a data conversion
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4255
   *  error could occur; or if a database access error occurs
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4256
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4257
   * support this method
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4258
   * @since 1.6
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4259
   */
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4260
  public void setNCharacterStream(String parameterName, Reader value, long length)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4261
          throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4262
      throw new SQLFeatureNotSupportedException("Feature not supported");
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4263
  }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4264
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4265
  /**
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4266
   * Sets the designated parameter to a <code>Reader</code> object. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4267
   * <code>Reader</code> reads the data till end-of-file is reached. The
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4268
   * driver does the necessary conversion from Java character format to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4269
   * the national character set in the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4270
   * <P><B>Note:</B> This stream object can either be a standard
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4271
   * Java stream object or your own subclass that implements the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4272
   * standard interface.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4273
   * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4274
   * it might be more efficient to use a version of
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4275
   * <code>setNCharacterStream</code> which takes a length parameter.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4276
   *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4277
   * @param parameterName the name of the parameter
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4278
   * @param value the parameter value
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4279
   * @throws SQLException if the driver does not support national
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4280
   *         character sets;  if the driver can detect that a data conversion
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4281
   *  error could occur ; if a database access error occurs; or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4282
   * this method is called on a closed <code>CallableStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4283
   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4284
   * @since 1.6
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4285
   */
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4286
  public void setNCharacterStream(String parameterName, Reader value)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4287
          throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4288
      throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4289
   }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4290
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4291
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4292
    * Sets the designated parameter to a <code>java.sql.NClob</code> object. The object
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4293
    * implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4294
    * object maps to a SQL <code>NCLOB</code>.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4295
    * @param parameterName the name of the column to be set
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4296
    * @param value the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4297
    * @throws SQLException if the driver does not support national
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4298
    *         character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4299
    *  error could occur; or if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4300
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4301
    * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4302
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4303
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4304
   public void setNClob(String parameterName, NClob value) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4305
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4306
   }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4307
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4308
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4309
    * Sets the designated parameter to a <code>Reader</code> object.  The <code>reader</code> must contain
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4310
    * the number
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4311
    * of characters specified by length otherwise a <code>SQLException</code> will be
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4312
    * generated when the <code>CallableStatement</code> is executed.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4313
    * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4314
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4315
    * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4316
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4317
    * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4318
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4319
    * @param parameterName the name of the parameter to be set
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4320
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4321
    * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4322
    * @throws SQLException if parameterIndex does not correspond to a parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4323
    * marker in the SQL statement; if the length specified is less than zero;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4324
    * if the driver does not support national
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4325
    *         character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4326
    *  error could occur; if a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4327
    * this method is called on a closed <code>CallableStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4328
    * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4329
    * this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4330
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4331
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4332
   public void setNClob(String parameterName, Reader reader, long length)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4333
           throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4334
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4335
   }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4336
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4337
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4338
    * Sets the designated parameter to a <code>Reader</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4339
    * This method differs from the <code>setCharacterStream (int, Reader)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4340
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4341
    * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4342
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4343
    * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4344
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4345
    * it might be more efficient to use a version of
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4346
    * <code>setNClob</code> which takes a length parameter.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4347
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4348
    * @param parameterName the name of the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4349
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4350
    * @throws SQLException if the driver does not support national character sets;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4351
    * if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4352
    *  error could occur;  if a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4353
    * this method is called on a closed <code>CallableStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4354
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4355
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4356
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4357
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4358
   public void setNClob(String parameterName, Reader reader) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4359
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4360
   }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4361
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4362
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4363
    * Sets the designated parameter to a <code>Reader</code> object.  The reader must contain  the number
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4364
    * of characters specified by length otherwise a <code>SQLException</code> will be
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4365
    * generated when the <code>PreparedStatement</code> is executed.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4366
    * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4367
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4368
    * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4369
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4370
    * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4371
    * @param parameterIndex index of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4372
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4373
    * @param length the number of characters in the parameter data.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4374
    * @throws SQLException if parameterIndex does not correspond to a parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4375
    * marker in the SQL statement; if the length specified is less than zero;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4376
    * if the driver does not support national character sets;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4377
    * if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4378
    *  error could occur;  if a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4379
    * this method is called on a closed <code>PreparedStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4380
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4381
    * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4382
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4383
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4384
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4385
   public void setNClob(int parameterIndex, Reader reader, long length)
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4386
           throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4387
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4388
   }
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4389
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4390
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4391
    * Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this oa
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4392
    * SQL <code>NCLOB</code> value when it sends it to the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4393
    * @param parameterIndex of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4394
    * @param value the parameter value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4395
    * @throws SQLException if the driver does not support national
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4396
    *         character sets;  if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4397
    *  error could occur ; or if a database access error occurs
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4398
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4399
    * support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4400
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4401
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4402
   public void setNClob(int parameterIndex, NClob value) throws SQLException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4403
        throw new SQLFeatureNotSupportedException("Feature not supported");
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4404
   }
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4405
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4406
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4407
    * Sets the designated parameter to a <code>Reader</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4408
    * This method differs from the <code>setCharacterStream (int, Reader)</code> method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4409
    * because it informs the driver that the parameter value should be sent to
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4410
    * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4411
    * driver may have to do extra work to determine whether the parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4412
    * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4413
    * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4414
    * it might be more efficient to use a version of
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4415
    * <code>setNClob</code> which takes a length parameter.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4416
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4417
    * @param parameterIndex index of the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4418
    * @param reader An object that contains the data to set the parameter value to.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4419
    * @throws SQLException if parameterIndex does not correspond to a parameter
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4420
    * marker in the SQL statement;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4421
    * if the driver does not support national character sets;
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4422
    * if the driver can detect that a data conversion
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4423
    *  error could occur;  if a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4424
    * this method is called on a closed <code>PreparedStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4425
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4426
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4427
    * @since 1.6
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4428
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4429
   public void setNClob(int parameterIndex, Reader reader)throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4430
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4431
   }
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4432
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4433
   /**
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4434
    * Sets the designated parameter to the given <code>java.net.URL</code> value.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4435
    * The driver converts this to an SQL <code>DATALINK</code> value
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4436
    * when it sends it to the database.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4437
    *
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4438
    * @param parameterIndex the first parameter is 1, the second is 2, ...
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4439
    * @param x the <code>java.net.URL</code> object to be set
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4440
    * @exception SQLException if a database access error occurs or
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4441
    * this method is called on a closed <code>PreparedStatement</code>
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4442
    * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4443
    */
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4444
   public void setURL(int parameterIndex, java.net.URL x) throws SQLException {
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4445
       throw new SQLFeatureNotSupportedException("Feature not supported");
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4446
   }
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14179
diff changeset
  4447
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 24968
diff changeset
  4448
   static final long serialVersionUID = 4886719666485113312L;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  4449
32427
c22b7e41adf3 8134984: Text files should end in exactly one newline
martin
parents: 27776
diff changeset
  4450
} //end class