• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 package java.sql;
19 
20 import java.io.InputStream;
21 import java.io.Reader;
22 import java.math.BigDecimal;
23 import java.net.URL;
24 import java.util.Calendar;
25 
26 /**
27  * An interface for a precompiled SQL Statement.
28  * <p>
29  * An SQL Statement is put into a {@code PreparedStatement} and is precompiled
30  * so that it can be executed efficiently multiple times.
31  * <p>
32  * Setter methods are supplied in the {@code PreparedStatement} interface for
33  * the setting of {@code IN} parameters for the statement. The setter method
34  * used for each {@code IN} parameter must match the parameter's type.
35  */
36 public interface PreparedStatement extends Statement {
37 
38     /**
39      * Add a set of parameters to the {@code PreparedStatement}'s command batch.
40      *
41      * @throws SQLException
42      *             if a database error happens.
43      */
addBatch()44     public void addBatch() throws SQLException;
45 
46     /**
47      * Clear the current parameter values.
48      * <p>
49      * Typically, parameter values are retained for multiple executions of the
50      * {@code Statement}. Setting a parameter value replaces the previous value. This
51      * method clears the values for all parameters, releasing all resources used
52      * by those parameters.
53      *
54      * @throws SQLException
55      *             if a database error happens.
56      */
clearParameters()57     public void clearParameters() throws SQLException;
58 
59     /**
60      * Executes the SQL statement in this {@code PreparedStatement}.
61      * <p>
62      * A {@code PreparedStatement} may return multiple results. The execute
63      * method executes the {@code PreparedStatement} and returns a flag
64      * indicating the kind of result produced by the action. The methods
65      * {@code getResultSet} or {@code getUpdateCount} are used to retrieve
66      * the first result, and the second and subsequent results are
67      * retrieved with {@code getMoreResults}.
68      *
69      * @return {@code true} if the result of the execution is a {@code
70      *         ResultSet}, {@code false} if there is no result or if the result
71      *         is an update count.
72      * @throws SQLException
73      *             if a database error happens.
74      */
execute()75     public boolean execute() throws SQLException;
76 
77     /**
78      * Executes the SQL query in the {@code PreparedStatement} and returns the
79      * {@code ResultSet} generated by the query.
80      *
81      * @return the {@code ResultSet} generated by the query, never {@code null}.
82      * @throws SQLException
83      *             if a database error happens or if the SQL statement does not
84      *             produce a {@code ResultSet}.
85      */
executeQuery()86     public ResultSet executeQuery() throws SQLException;
87 
88     /**
89      * Invokes the SQL command contained within the prepared statement. This
90      * must be {@code INSERT}, {@code UPDATE}, {@code DELETE}, or a command that
91      * returns nothing.
92      *
93      * @return the number of affected rows for {@code INSERT}, {@code UPDATE} or {@code
94      *         DELETE} statements, {@code 0} for statements that return nothing.
95      * @throws SQLException
96      *             if a database error happens or if the SQL statement returns a
97      *             {@code ResultSet}.
98      */
executeUpdate()99     public int executeUpdate() throws SQLException;
100 
101     /**
102      * Returns a {@code ResultSetMetaData} describing the {@code
103      * ResultSet} that would be produced by execution of the {@code PreparedStatement}.
104      * <p>
105      * It is possible to know the metadata for the {@code ResultSet} without
106      * executing the {@code PreparedStatement}, because the {@code
107      * PreparedStatement} is precompiled. As a result the metadata can be
108      * queried ahead of time without actually executing the statement.
109      *
110      * @return a {@code ResultSetMetaData} object with the information about the
111      *         columns of the {@code ResultSet}, if the driver can return a
112      *         {@code ResultSetMetaData}. {@code null} otherwise.
113      * @throws SQLException
114      *             if there is a database error.
115      */
getMetaData()116     public ResultSetMetaData getMetaData() throws SQLException;
117 
118     /**
119      * Gets information about the parameters of the {@code PreparedStatement}.
120      *
121      * @return a {@code ParameterMetaData} object which holds information about
122      *         the number, type, and properties of the parameters of this {@code
123      *         PreparedStatement}.
124      * @throws SQLException
125      *             if a database error happens.
126      */
getParameterMetaData()127     public ParameterMetaData getParameterMetaData() throws SQLException;
128 
129     /**
130      * Sets the value of a specified parameter to the supplied {@code Array}.
131      *
132      * @param parameterIndex
133      *            the parameter number index, where the first parameter has
134      *            index 1.
135      * @param theArray
136      *            a {@code java.sql.Array} giving the new value of the parameter at {@code
137      *            parameterIndex}.
138      * @throws SQLException
139      *             if a database error happens.
140      * @see Array
141      */
setArray(int parameterIndex, Array theArray)142     public void setArray(int parameterIndex, Array theArray)
143             throws SQLException;
144 
145     /**
146      * Sets the value of a specified parameter to the content of a supplied
147      * {@code InputStream}, which has a specified number of bytes.
148      * <p>
149      * This is a good method for setting an SQL {@code LONGVARCHAR} parameter
150      * where the length of the data is large. Data is read from the {@code
151      * InputStream} until end-of-file is reached or the specified number of
152      * bytes is copied.
153      *
154      * @param parameterIndex
155      *            the parameter number index, where the first parameter has
156      *            index 1.
157      * @param theInputStream
158      *            the ASCII {@code InputStream} carrying the data to which the
159      *            parameter at {@code parameterIndex} is set.
160      * @param length
161      *            the number of bytes in the {@code InputStream} to copy to the
162      *            parameter.
163      * @throws SQLException
164      *             if a database error happens.
165      */
setAsciiStream(int parameterIndex, InputStream theInputStream, int length)166     public void setAsciiStream(int parameterIndex, InputStream theInputStream,
167             int length) throws SQLException;
168 
169     /**
170      * Sets the value of a specified parameter to a supplied {@code
171      * java.math.BigDecimal} value.
172      *
173      * @param parameterIndex
174      *            the parameter number index, where the first parameter has
175      *            index 1.
176      * @param theBigDecimal
177      *            the value to which the parameter at {@code parameterIndex} is
178      *            set.
179      * @throws SQLException
180      *             if a database error happens.
181      * @see java.math.BigDecimal
182      */
setBigDecimal(int parameterIndex, BigDecimal theBigDecimal)183     public void setBigDecimal(int parameterIndex, BigDecimal theBigDecimal)
184             throws SQLException;
185 
186     /**
187      * Sets the value of a specified parameter to the content of a supplied
188      * binary {@code InputStream}, which has a specified number of bytes.
189      * <p>
190      * Use this method when a large amount of data needs to be set into a
191      * {@code LONGVARBINARY} parameter.
192      *
193      * @param parameterIndex
194      *            the parameter number index, where the first parameter has
195      *            index 1.
196      * @param theInputStream
197      *            the binary {@code InputStream} carrying the data to update the
198      *            parameter.
199      * @param length
200      *            the number of bytes in the {@code InputStream} to copy to the
201      *            parameter.
202      * @throws SQLException
203      *             if a database error happens.
204      */
setBinaryStream(int parameterIndex, InputStream theInputStream, int length)205     public void setBinaryStream(int parameterIndex, InputStream theInputStream,
206             int length) throws SQLException;
207 
208     /**
209      * Sets the value of a specified parameter to the given {@code Blob} object.
210      *
211      * @param parameterIndex
212      *            the parameter number index, where the first parameter has
213      *            index 1.
214      * @param theBlob
215      *            the {@code java.sql.Blob} to which the parameter at {@code
216      *            parameterIndex} is set.
217      * @throws SQLException
218      *             if a database error happens.
219      * @see Blob
220      */
setBlob(int parameterIndex, Blob theBlob)221     public void setBlob(int parameterIndex, Blob theBlob) throws SQLException;
222 
223     /**
224      * Sets the value of a specified parameter to a supplied {@code boolean}
225      * value.
226      *
227      * @param parameterIndex
228      *            the parameter number index, where the first parameter has
229      *            index 1.
230      * @param theBoolean
231      *            the boolean value to which the parameter at {@code
232      *            parameterIndex} is set.
233      * @throws SQLException
234      *             if a database error happens.
235      */
setBoolean(int parameterIndex, boolean theBoolean)236     public void setBoolean(int parameterIndex, boolean theBoolean)
237             throws SQLException;
238 
239     /**
240      * Sets the value of a specified parameter to a supplied {@code byte} value.
241      *
242      * @param parameterIndex
243      *            the parameter number index, where the first parameter has
244      *            index 1.
245      * @param theByte
246      *            the byte value to which the parameter at {@code
247      *            parameterIndex} is set.
248      * @throws SQLException
249      *             if a database error happens.
250      */
setByte(int parameterIndex, byte theByte)251     public void setByte(int parameterIndex, byte theByte) throws SQLException;
252 
253     /**
254      * Sets the value of a specified parameter to a supplied array of bytes. The
255      * array is mapped to a {@code VARBINARY} or {@code LONGVARBINARY} in the
256      * database.
257      *
258      * @param parameterIndex
259      *            the parameter number index, where the first parameter has
260      *            index 1.
261      * @param theBytes
262      *            the array of bytes to which the parameter at {@code
263      *            parameterIndex} is set.
264      * @throws SQLException
265      *             if a database error happens.
266      */
setBytes(int parameterIndex, byte[] theBytes)267     public void setBytes(int parameterIndex, byte[] theBytes)
268             throws SQLException;
269 
270     /**
271      * Sets the value of a specified parameter to the character content of a
272      * {@code Reader} object, with the specified length of character data.
273      * <p>
274      * Data is read from the {@code
275      * Reader} until end-of-file is reached or the specified number of
276      * characters are copied.
277      *
278      * @param parameterIndex
279      *            the parameter number index, where the first parameter has
280      *            index 1
281      * @param reader
282      *            the {@code java.io.Reader} containing the character data.
283      * @param length
284      *            the number of characters to be read.
285      * @throws SQLException
286      *             if a database error happens.
287      */
setCharacterStream(int parameterIndex, Reader reader, int length)288     public void setCharacterStream(int parameterIndex, Reader reader, int length)
289             throws SQLException;
290 
291     /**
292      * Sets the value of a specified parameter to the given {@code Clob} object.
293      *
294      * @param parameterIndex
295      *            the parameter number index, where the first parameter has
296      *            index 1.
297      * @param theClob
298      *            a {@code java.sql.Clob} holding the data to which the
299      *            parameter at {@code parameterIndex} is set.
300      * @throws SQLException
301      *             if a database error happens.
302      */
setClob(int parameterIndex, Clob theClob)303     public void setClob(int parameterIndex, Clob theClob) throws SQLException;
304 
305     /**
306      * Sets the value of a specified parameter to a supplied {@code
307      * java.sql.Date} value.
308      *
309      * @param parameterIndex
310      *            the parameter number index, where the first parameter has
311      *            index 1.
312      * @param theDate
313      *            a {@code java.sql.Date} to which the parameter at {@code
314      *            parameterIndex} is set.
315      * @throws SQLException
316      *             if a database error happens.
317      */
setDate(int parameterIndex, Date theDate)318     public void setDate(int parameterIndex, Date theDate) throws SQLException;
319 
320     /**
321      * Sets the value of a specified parameter to a supplied {@code
322      * java.sql.Date} value, using a supplied {@code Calendar} to map the Date.
323      * The {@code Calendar} allows the application to control the timezone used
324      * to compute the SQL {@code DATE} in the database - without the supplied
325      * {@code Calendar}, the driver uses the default timezone of the Java
326      * virtual machine.
327      *
328      * @param parameterIndex
329      *            the parameter number index, where the first parameter has
330      *            index 1.
331      * @param theDate
332      *            a {@code java.sql.Date} to which the parameter at {@code
333      *            parameterIndex} is set.
334      * @param cal
335      *            a {@code Calendar} to use to construct the SQL {@code DATE}
336      *            value.
337      * @throws SQLException
338      *             if a database error happens.
339      * @see Date
340      * @see java.util.Calendar
341      */
setDate(int parameterIndex, Date theDate, Calendar cal)342     public void setDate(int parameterIndex, Date theDate, Calendar cal)
343             throws SQLException;
344 
345     /**
346      * Sets the value of a specified parameter to a supplied {@code double}
347      * value.
348      *
349      * @param parameterIndex
350      *            the parameter number index, where the first parameter has
351      *            index 1.
352      * @param theDouble
353      *            the {@code double} value to which the parameter at {@code
354      *            parameterIndex} is set.
355      * @throws SQLException
356      *             if a database error happens.
357      */
setDouble(int parameterIndex, double theDouble)358     public void setDouble(int parameterIndex, double theDouble)
359             throws SQLException;
360 
361     /**
362      * Sets the value of a specified parameter to to a supplied {@code float}
363      * value.
364      *
365      * @param parameterIndex
366      *            the parameter number index, where the first parameter has
367      *            index 1.
368      * @param theFloat
369      *            the {@code float} value to update the parameter.
370      * @throws SQLException
371      *             if a database error happens.
372      */
setFloat(int parameterIndex, float theFloat)373     public void setFloat(int parameterIndex, float theFloat)
374             throws SQLException;
375 
376     /**
377      * Sets the value of a specified parameter to a supplied {@code int} value.
378      *
379      * @param parameterIndex
380      *            the parameter number index, where the first parameter has
381      *            index 1.
382      * @param theInt
383      *            the {@code int} value to which the parameter at {@code
384      *            parameterIndex} is set.
385      * @throws SQLException
386      *             if a database error happens.
387      */
setInt(int parameterIndex, int theInt)388     public void setInt(int parameterIndex, int theInt) throws SQLException;
389 
390     /**
391      * Sets the value of a specified parameter to a supplied {@code long} value.
392      *
393      * @param parameterIndex
394      *            the parameter number index, where the first parameter has
395      *            index 1.
396      * @param theLong
397      *            the {@code long} value to which the parameter at {@code
398      *            parameterIndex} is set.
399      * @throws SQLException
400      *             if a database error happens.
401      */
setLong(int parameterIndex, long theLong)402     public void setLong(int parameterIndex, long theLong) throws SQLException;
403 
404     /**
405      * Sets the value of a specified parameter to SQL {@code NULL}. Don't use
406      * this version of {@code setNull} for <i>User Defined Types</i> (UDT) or
407      * for REF type parameters.
408      *
409      * @param parameterIndex
410      *            the parameter number index, where the first parameter has
411      *            index 1.
412      * @param sqlType
413      *            the SQL type of the parameter, as defined in {@code
414      *            java.sql.Types}.
415      * @throws SQLException
416      *             if a database error happens.
417      */
setNull(int parameterIndex, int sqlType)418     public void setNull(int parameterIndex, int sqlType) throws SQLException;
419 
420     /**
421      * Sets the value of a specified parameter to SQL {@code NULL}. This version
422      * of {@code setNull} should be used for <i>User Defined Types</i> (UDTs)
423      * and also REF types. UDTs can be {@code STRUCT}, {@code DISTINCT}, {@code
424      * JAVA_OBJECT} and named array types.
425      * <p>
426      * Applications must provide the SQL type code and also a fully qualified
427      * SQL type name when supplying a {@code NULL} UDT or REF. For a UDT, the
428      * type name is the type name of the parameter itself, but for a REF
429      * parameter the type name is the type name of the referenced type.
430      *
431      * @param paramIndex
432      *            the parameter number index, where the first parameter has
433      *            index 1.
434      * @param sqlType
435      *            the SQL type of the parameter, as defined in {@code
436      *            java.sql.Types}.
437      * @param typeName
438      *            the fully qualified name of a UDT or REF type - ignored if the
439      *            parameter is not a UDT.
440      * @throws SQLException
441      *             if a database error happens.
442      * @see Types
443      */
setNull(int paramIndex, int sqlType, String typeName)444     public void setNull(int paramIndex, int sqlType, String typeName)
445             throws SQLException;
446 
447     /**
448      * Sets the value of a specified parameter using a supplied object.
449      * <p>
450      * There is a standard mapping from Java types to SQL types, defined in the
451      * JDBC specification. The passed object is then transformed into the
452      * appropriate SQL type, and then transferred to the database. {@code
453      * setObject} can be used to pass abstract data types unique to the
454      * database, by using a JDBC driver specific Java type. If the object's
455      * class implements the interface {@code SQLData}, the JDBC driver calls
456      * {@code SQLData.writeSQL} to write it to the SQL data stream. If the
457      * object's class implements {@code Ref}, {@code Blob}, {@code Clob},
458      * {@code Struct}, or {@code Array}, the driver passes it to the database as
459      * a value of the corresponding SQL type.
460      *
461      * @param parameterIndex
462      *            the parameter number index, where the first parameter has
463      *            index 1.
464      * @param theObject
465      *            the object containing the value to which the parameter at
466      *            {@code parameterIndex} is set.
467      * @throws SQLException
468      *             if a database error happens.
469      */
setObject(int parameterIndex, Object theObject)470     public void setObject(int parameterIndex, Object theObject)
471             throws SQLException;
472 
473     /**
474      * Sets the value of a specified parameter using a supplied object.
475      * <p>
476      * The object is converted to the given {@code targetSqlType} before it is
477      * sent to the database. If the object has a custom mapping (its class
478      * implements the interface {@code SQLData}), the JDBC driver will call the method
479      * {@code SQLData.writeSQL} to write it to the SQL data stream. If the
480      * object's class implements {@code Ref}, {@code Blob}, {@code Clob},
481      * {@code Struct}, or {@code Array}, the driver will pass it to the database
482      * in the form of the relevant SQL type.
483      *
484      * @param parameterIndex
485      *            the parameter index, where the first parameter has index 1.
486      * @param theObject
487      *            the Object containing the value to which the parameter at
488      *            {@code parameterIndex} is set.
489      * @param targetSqlType
490      *            the SQL type to send to the database, as defined in {@code
491      *            java.sql.Types}.
492      * @throws SQLException
493      *             if a database error happens.
494      */
setObject(int parameterIndex, Object theObject, int targetSqlType)495     public void setObject(int parameterIndex, Object theObject,
496             int targetSqlType) throws SQLException;
497 
498     /**
499      * Sets the value of a specified parameter using a supplied object.
500      * <p>
501      * The object is converted to the given {@code targetSqlType} before it is
502      * sent to the database. If the object has a custom mapping (its class
503      * implements the interface {@code SQLData}), the JDBC driver will call the method
504      * {@code SQLData.writeSQL} to write it to the SQL data stream. If the
505      * object's class implements {@code Ref}, {@code Blob}, {@code Clob},
506      * {@code Struct}, or {@code Array}, the driver will pass it to the database
507      * in the form of the relevant SQL type.
508      *
509      * @param parameterIndex
510      *            the parameter index, where the first parameter has index 1.
511      * @param theObject
512      *            the Object containing the value to which the parameter at
513      *            {@code parameterIndex} is set.
514      * @param targetSqlType
515      *            the SQL type to send to the database, as defined in {@code
516      *            java.sql.Types}.
517      * @param scale
518      *            the number of digits after the decimal point - only applies to
519      *            the types {@code java.sql.Types.DECIMAL} and {@code
520      *            java.sql.Types.NUMERIC} - ignored for all other types.
521      * @throws SQLException
522      *             if a database error happens.
523      */
setObject(int parameterIndex, Object theObject, int targetSqlType, int scale)524     public void setObject(int parameterIndex, Object theObject,
525             int targetSqlType, int scale) throws SQLException;
526 
527     /**
528      * Sets the value of a specified parameter to a supplied {@code
529      * REF(<structured-type>)} value. This is stored as an SQL {@code REF}.
530      *
531      * @param parameterIndex
532      *            the parameter number index, where the first parameter has
533      *            index 1.
534      * @param theRef
535      *            a {@code java.sql.Ref} value to which the parameter at {@code
536      *            parameterIndex} is set.
537      * @throws SQLException
538      *             if a database error happens.
539      * @see Ref
540      */
setRef(int parameterIndex, Ref theRef)541     public void setRef(int parameterIndex, Ref theRef) throws SQLException;
542 
543     /**
544      * Sets the value of a specified parameter to a supplied {@code short}
545      * value.
546      *
547      * @param parameterIndex
548      *            the parameter number index, where the first parameter has
549      *            index 1.
550      * @param theShort
551      *            a {@code short} value to which the parameter at {@code
552      *            parameterIndex} is set.
553      * @throws SQLException
554      *             if a database error happens.
555      */
setShort(int parameterIndex, short theShort)556     public void setShort(int parameterIndex, short theShort)
557             throws SQLException;
558 
559     /**
560      * Sets the value of a specified parameter to a supplied string.
561      *
562      * @param parameterIndex
563      *            the parameter number index, where the first parameter has
564      *            index 1.
565      * @param theString
566      *            the value to which the parameter at {@code parameterIndex} is
567      *            set.
568      * @throws SQLException
569      *             if a database error happens.
570      */
setString(int parameterIndex, String theString)571     public void setString(int parameterIndex, String theString)
572             throws SQLException;
573 
574     /**
575      * Sets the value of a specified parameter to a supplied {@code
576      * java.sql.Time} value.
577      *
578      * @param parameterIndex
579      *            the parameter number index, where the first parameter has
580      *            index 1.
581      * @param theTime
582      *            a {@code java.sql.Time} value to which the parameter at
583      *            {@code parameterIndex} is set.
584      * @throws SQLException
585      *             if a database error happens.
586      */
setTime(int parameterIndex, Time theTime)587     public void setTime(int parameterIndex, Time theTime) throws SQLException;
588 
589     /**
590      * Sets the value of a specified parameter to a supplied {@code
591      * java.sql.Time} value, using a supplied {@code Calendar}.
592      * <p>
593      * The driver uses the supplied {@code Calendar} to create the SQL {@code
594      * TIME} value, which allows it to use a custom timezone - otherwise the
595      * driver uses the default timezone of the Java virtual machine.
596      *
597      * @param parameterIndex
598      *            the parameter number index, where the first parameter has
599      *            index 1.
600      * @param theTime
601      *            a {@code java.sql.Time} value to which the parameter at
602      *            {@code parameterIndex} is set.
603      * @param cal
604      *            a {@code Calendar} to use to construct the SQL {@code TIME}
605      *            value.
606      * @throws SQLException
607      *             if a database error happens.
608      * @see Time
609      * @see java.util.Calendar
610      */
setTime(int parameterIndex, Time theTime, Calendar cal)611     public void setTime(int parameterIndex, Time theTime, Calendar cal)
612             throws SQLException;
613 
614     /**
615      * Sets the value of a specified parameter to a supplied java.sql.Timestamp
616      * value.
617      *
618      * @param parameterIndex
619      *            the parameter number index, where the first parameter has
620      *            index 1.
621      * @param theTimestamp
622      *            the java.sql.Timestamp value to which the parameter at {@code
623      *            parameterIndex} is set.
624      * @throws SQLException
625      *             if a database error happens.
626      */
setTimestamp(int parameterIndex, Timestamp theTimestamp)627     public void setTimestamp(int parameterIndex, Timestamp theTimestamp)
628             throws SQLException;
629 
630     /**
631      * Sets the value of a specified parameter to a supplied {@code
632      * java.sql.Timestamp} value, using the supplied {@code Calendar}.
633      * <p>
634      * The driver uses the supplied {@code Calendar} to create the SQL {@code
635      * TIMESTAMP} value, which allows it to use a custom timezone - otherwise
636      * the driver uses the default timezone of the Java virtual machine.
637      *
638      * @param parameterIndex
639      *            the parameter number index, where the first parameter has
640      *            index 1.
641      * @param theTimestamp
642      *            the {@code java.sql.Timestamp} value to which the parameter at
643      *            {@code parameterIndex} is set.
644      * @param cal
645      *            a {@code Calendar} to use to construct the SQL {@code
646      *            TIMESTAMP} value
647      * @throws SQLException
648      *             if a database error happens.
649      * @see Timestamp
650      * @see java.util.Calendar
651      */
setTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar cal)652     public void setTimestamp(int parameterIndex, Timestamp theTimestamp,
653             Calendar cal) throws SQLException;
654 
655     /**
656      * Sets the value of a specified parameter to the characters from a supplied
657      * {@code InputStream}, with a specified number of bytes.
658      *
659      * @deprecated Use {@link #setCharacterStream(int, Reader, int)}
660      * @param parameterIndex
661      *            the parameter number index, where the first parameter has
662      *            index 1.
663      * @param theInputStream
664      *            the {@code InputStream} with the character data to which the
665      *            parameter at {@code parameterIndex} is set.
666      * @param length
667      *            the number of bytes to read from the {@code InputStream}.
668      * @throws SQLException
669      *             if a database error happens.
670      */
671     @Deprecated
setUnicodeStream(int parameterIndex, InputStream theInputStream, int length)672     public void setUnicodeStream(int parameterIndex,
673             InputStream theInputStream, int length) throws SQLException;
674 
675     /**
676      * Sets the value of a specified parameter to a supplied {@code
677      * java.net.URL}.
678      *
679      * @param parameterIndex
680      *            the parameter number index, where the first parameter has
681      *            index 1.
682      * @param theURL
683      *            the {@code URL} to which the parameter at {@code
684      *            parameterIndex} is set.
685      * @throws SQLException
686      *             if a database error happens.
687      * @see URL
688      */
setURL(int parameterIndex, URL theURL)689     public void setURL(int parameterIndex, URL theURL) throws SQLException;
690 
691     /**
692      * Sets the value of a specified parameter to a supplied {@code
693      * java.sql.RowId}.
694      *
695      * @param parameterIndex
696      *            the parameter number index, where the first parameter has
697      *            index 1.
698      * @param theRowId
699      *            the {@code RowId} to which the parameter at {@code
700      *            parameterIndex} is set.
701      * @throws SQLException if a database error happens.
702      */
setRowId(int parameterIndex, RowId theRowId)703     public void setRowId(int parameterIndex, RowId theRowId) throws SQLException;
704 
705     /**
706      * Sets the value of a specified parameter to a supplied string.
707      *
708      * @param parameterIndex
709      *            the parameter number index, where the first parameter has
710      *            index 1.
711      * @param theString
712      *            the {@code String} to which the parameter at {@code
713      *            parameterIndex} is set.
714      * @throws SQLException if a database error happens.
715      */
setNString(int parameterIndex, String theString)716     public void setNString(int parameterIndex, String theString) throws SQLException;
717 
718     /**
719      * Sets the value of the specified parameter to the next {@code length} characters
720      * from {@code reader}.
721      *
722      * @param parameterIndex
723      *            the parameter number index, where the first parameter has
724      *            index 1.
725      * @param reader the {@code Reader}
726      * @param length character count
727      * @throws SQLException if a database error happens.
728      */
setNCharacterStream(int parameterIndex, Reader reader, long length)729     public void setNCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException;
730 
731     /**
732      * Sets the value of the specified parameter to {@code value}.
733      *
734      * @param parameterIndex
735      *            the parameter number index, where the first parameter has
736      *            index 1.
737      * @param value
738      *            the {@code NClob} to which the parameter at {@code
739      *            parameterIndex} is set.
740      * @throws SQLException if a database error happens.
741      */
setNClob(int parameterIndex, NClob value)742     public void setNClob(int parameterIndex, NClob value) throws SQLException;
743 
744     /**
745      * Sets the value of the specified parameter to the next {@code length} characters
746      * from {@code reader}.
747      *
748      * @param parameterIndex
749      *            the parameter number index, where the first parameter has
750      *            index 1.
751      * @param reader the {@code Reader}
752      * @param length character count
753      * @throws SQLException if a database error happens.
754      */
setClob(int parameterIndex, Reader reader, long length)755     public void setClob(int parameterIndex, Reader reader, long length) throws SQLException;
756 
757     /**
758      * Sets the value of the specified parameter to the next {@code length} bytes
759      * from {@code inputStream}.
760      *
761      * @param parameterIndex
762      *            the parameter number index, where the first parameter has
763      *            index 1.
764      * @param inputStream the {@code InputStream}
765      * @param length character count
766      * @throws SQLException if a database error happens.
767      */
setBlob(int parameterIndex, InputStream inputStream, long length)768     public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException;
769 
770     /**
771      * Sets the value of the specified parameter to the next {@code length} characters
772      * from {@code reader}.
773      *
774      * @param parameterIndex
775      *            the parameter number index, where the first parameter has
776      *            index 1.
777      * @param reader the {@code Reader}
778      * @param length character count
779      * @throws SQLException if a database error happens.
780      */
setNClob(int parameterIndex, Reader reader, long length)781     public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException;
782 
783     /**
784      * Sets the value of the specified parameter to the value of {@code xmlObject}.
785      *
786      * @param parameterIndex
787      *            the parameter number index, where the first parameter has
788      *            index 1.
789      * @param xmlObject the {@code SQLXML}
790      * @throws SQLException if a database error happens.
791      */
setSQLXML(int parameterIndex, SQLXML xmlObject)792     public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException;
793 
794     /**
795      * Sets the value of the specified parameter to the next {@code length} bytes
796      * from {@code inputStream}.
797      *
798      * @param parameterIndex
799      *            the parameter number index, where the first parameter has
800      *            index 1.
801      * @param inputStream the {@code InputStream}
802      * @param length character count
803      * @throws SQLException if a database error happens.
804      */
setAsciiStream(int parameterIndex, InputStream inputStream, long length)805     public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException;
806 
807     /**
808      * Sets the value of the specified parameter to the next {@code length} bytes
809      * from {@code inputStream}.
810      *
811      * @param parameterIndex
812      *            the parameter number index, where the first parameter has
813      *            index 1.
814      * @param inputStream the {@code InputStream}
815      * @param length character count
816      * @throws SQLException if a database error happens.
817      */
setBinaryStream(int parameterIndex, InputStream inputStream, long length)818     public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException;
819 
820     /**
821      * Sets the value of the specified parameter to the next {@code length} characters
822      * from {@code reader}.
823      *
824      * @param parameterIndex
825      *            the parameter number index, where the first parameter has
826      *            index 1.
827      * @param reader the {@code Reader}
828      * @param length character count
829      * @throws SQLException if a database error happens.
830      */
setCharacterStream(int parameterIndex, Reader reader, long length)831     public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException;
832 
833     /**
834      * Sets the value of the specified parameter to the bytes
835      * from {@code inputStream}.
836      *
837      * @param parameterIndex
838      *            the parameter number index, where the first parameter has
839      *            index 1.
840      * @param inputStream the {@code InputStream}
841      * @throws SQLException if a database error happens.
842      */
setAsciiStream(int parameterIndex, InputStream inputStream)843     public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException;
844 
845     /**
846      * Sets the value of the specified parameter to the bytes
847      * from {@code inputStream}.
848      *
849      * @param parameterIndex
850      *            the parameter number index, where the first parameter has
851      *            index 1.
852      * @param inputStream the {@code InputStream}
853      * @throws SQLException if a database error happens.
854      */
setBinaryStream(int parameterIndex, InputStream inputStream)855     public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException;
856 
857     /**
858      * Sets the value of the specified parameter to the characters
859      * from {@code reader}.
860      *
861      * @param parameterIndex
862      *            the parameter number index, where the first parameter has
863      *            index 1.
864      * @param reader the {@code Reader}
865      * @throws SQLException if a database error happens.
866      */
setCharacterStream(int parameterIndex, Reader reader)867     public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException;
868 
869     /**
870      * Sets the value of the specified parameter to the characters
871      * from {@code reader}.
872      *
873      * @param parameterIndex
874      *            the parameter number index, where the first parameter has
875      *            index 1.
876      * @param reader the {@code Reader}
877      * @throws SQLException if a database error happens.
878      */
setNCharacterStream(int parameterIndex, Reader reader)879     public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException;
880 
881     /**
882      * Sets the value of the specified parameter to the characters
883      * from {@code reader}.
884      *
885      * @param parameterIndex
886      *            the parameter number index, where the first parameter has
887      *            index 1.
888      * @param reader the {@code Reader}
889      * @throws SQLException if a database error happens.
890      */
setClob(int parameterIndex, Reader reader)891     public void setClob(int parameterIndex, Reader reader) throws SQLException;
892 
893     /**
894      * Sets the value of the specified parameter to the bytes
895      * from {@code inputStream}.
896      *
897      * @param parameterIndex
898      *            the parameter number index, where the first parameter has
899      *            index 1.
900      * @param inputStream the {@code InputStream}
901      * @throws SQLException if a database error happens.
902      */
setBlob(int parameterIndex, InputStream inputStream)903     public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException;
904 
905     /**
906      * Sets the value of the specified parameter to the characters
907      * from {@code reader}.
908      *
909      * @param parameterIndex
910      *            the parameter number index, where the first parameter has
911      *            index 1.
912      * @param reader the {@code Reader}
913      * @throws SQLException if a database error happens.
914      */
setNClob(int parameterIndex, Reader reader)915     public void setNClob(int parameterIndex, Reader reader) throws SQLException;
916 }
917