History

My first initial commit with all of mine experimental changes.

Dmitry Kabak (userdima committed 13 years ago

Commit d37b88d1 parent 3f5b46618352 files · +2598093 −-8690Browse files

Showing the changes to java/pkg/java/sql (104 of 18352 files). Show all

Unified · Split

104 files
  1. java/pkg/java/sql/Array.class +0 −0
  2. java/pkg/java/sql/Array.java +366 −0
  3. java/pkg/java/sql/BatchUpdateException.class +0 −0
  4. java/pkg/java/sql/BatchUpdateException.java +340 −0
  5. java/pkg/java/sql/Blob.class +0 −0
  6. java/pkg/java/sql/Blob.java +304 −0
  7. java/pkg/java/sql/CallableStatement.class +0 −0
  8. java/pkg/java/sql/CallableStatement.java +2499 −0
  9. java/pkg/java/sql/ClientInfoStatus.class +0 −0
  10. java/pkg/java/sql/ClientInfoStatus.java +62 −0
  11. java/pkg/java/sql/Clob.class +0 −0
  12. java/pkg/java/sql/Clob.java +348 −0
  13. java/pkg/java/sql/Connection.class +0 −0
  14. java/pkg/java/sql/Connection.java +1486 −0
  15. java/pkg/java/sql/DataTruncation.class +0 −0
  16. java/pkg/java/sql/DataTruncation.java +188 −0
  17. java/pkg/java/sql/DatabaseMetaData.class +0 −0
  18. java/pkg/java/sql/DatabaseMetaData.java +3655 −0
  19. java/pkg/java/sql/Date.class +0 −0
  20. java/pkg/java/sql/Date.java +250 −0
  21. java/pkg/java/sql/Driver.class +0 −0
  22. java/pkg/java/sql/Driver.java +170 −0
  23. java/pkg/java/sql/DriverInfo.class +0 −0
  24. java/pkg/java/sql/DriverManager$1.class +0 −0
  25. java/pkg/java/sql/DriverManager$2.class +0 −0
  26. java/pkg/java/sql/DriverManager.class +0 −0
  27. java/pkg/java/sql/DriverManager.java +636 −0
  28. java/pkg/java/sql/DriverPropertyInfo.class +0 −0
  29. java/pkg/java/sql/DriverPropertyInfo.java +84 −0
  30. java/pkg/java/sql/NClob.class +0 −0
  31. java/pkg/java/sql/NClob.java +55 −0
  32. java/pkg/java/sql/ParameterMetaData.class +0 −0
  33. java/pkg/java/sql/ParameterMetaData.java +196 −0
  34. java/pkg/java/sql/PreparedStatement.class +0 −0
  35. java/pkg/java/sql/PreparedStatement.java +1223 −0
  36. java/pkg/java/sql/PseudoColumnUsage.class +0 −0
  37. java/pkg/java/sql/PseudoColumnUsage.java +57 −0
  38. java/pkg/java/sql/Ref.class +0 −0
  39. java/pkg/java/sql/Ref.java +127 −0
  40. java/pkg/java/sql/ResultSet.class +0 −0
  41. java/pkg/java/sql/ResultSet.java +4139 −0
  42. java/pkg/java/sql/ResultSetMetaData.class +0 −0
  43. java/pkg/java/sql/ResultSetMetaData.java +277 −0
  44. java/pkg/java/sql/RowId.class +0 −0
  45. java/pkg/java/sql/RowId.java +120 −0
  46. java/pkg/java/sql/RowIdLifetime.class +0 −0
  47. java/pkg/java/sql/RowIdLifetime.java +67 −0
  48. java/pkg/java/sql/SQLClientInfoException.class +0 −0
  49. java/pkg/java/sql/SQLClientInfoException.java +321 −0
  50. java/pkg/java/sql/SQLData.class +0 −0
  51. java/pkg/java/sql/SQLData.java +137 −0
  52. java/pkg/java/sql/SQLDataException.class +0 −0
  53. java/pkg/java/sql/SQLDataException.java +173 −0
  54. java/pkg/java/sql/SQLException$1.class +0 −0
  55. java/pkg/java/sql/SQLException.class +0 −0
  56. java/pkg/java/sql/SQLException.java +375 −0
  57. java/pkg/java/sql/SQLFeatureNotSupportedException.class +0 −0
  58. java/pkg/java/sql/SQLFeatureNotSupportedException.java +179 −0
  59. java/pkg/java/sql/SQLInput.class +0 −0
  60. java/pkg/java/sql/SQLInput.java +424 −0
  61. java/pkg/java/sql/SQLIntegrityConstraintViolationException.class +0 −0
  62. java/pkg/java/sql/SQLIntegrityConstraintViolationException.java +174 −0
  63. java/pkg/java/sql/SQLInvalidAuthorizationSpecException.class +0 −0
  64. java/pkg/java/sql/SQLInvalidAuthorizationSpecException.java +174 −0
  65. java/pkg/java/sql/SQLNonTransientConnectionException.class +0 −0
  66. java/pkg/java/sql/SQLNonTransientConnectionException.java +176 −0
  67. java/pkg/java/sql/SQLNonTransientException.class +0 −0
  68. java/pkg/java/sql/SQLNonTransientException.java +175 −0
  69. java/pkg/java/sql/SQLOutput.class +0 −0
  70. java/pkg/java/sql/SQLOutput.java +437 −0
  71. java/pkg/java/sql/SQLPermission.class +0 −0
  72. java/pkg/java/sql/SQLPermission.java +158 −0
  73. java/pkg/java/sql/SQLRecoverableException.class +0 −0
  74. java/pkg/java/sql/SQLRecoverableException.java +175 −0
  75. java/pkg/java/sql/SQLSyntaxErrorException.class +0 −0
  76. java/pkg/java/sql/SQLSyntaxErrorException.java +173 −0
  77. java/pkg/java/sql/SQLTimeoutException.class +0 −0
  78. java/pkg/java/sql/SQLTimeoutException.java +171 −0
  79. java/pkg/java/sql/SQLTransactionRollbackException.class +0 −0
  80. java/pkg/java/sql/SQLTransactionRollbackException.java +173 −0
  81. java/pkg/java/sql/SQLTransientConnectionException.class +0 −0
  82. java/pkg/java/sql/SQLTransientConnectionException.java +174 −0
  83. java/pkg/java/sql/SQLTransientException.class +0 −0
  84. java/pkg/java/sql/SQLTransientException.java +172 −0
  85. java/pkg/java/sql/SQLWarning.class +0 −0
  86. java/pkg/java/sql/SQLWarning.java +217 −0
  87. java/pkg/java/sql/SQLXML.class +0 −0
  88. java/pkg/java/sql/SQLXML.java +425 −0
  89. java/pkg/java/sql/Savepoint.class +0 −0
  90. java/pkg/java/sql/Savepoint.java +60 −0
  91. java/pkg/java/sql/Statement.class +0 −0
  92. java/pkg/java/sql/Statement.java +1063 −0
  93. java/pkg/java/sql/Struct.class +0 −0
  94. java/pkg/java/sql/Struct.java +106 −0
  95. java/pkg/java/sql/Time.class +0 −0
  96. java/pkg/java/sql/Time.java +248 −0
  97. java/pkg/java/sql/Timestamp.class +0 −0
  98. java/pkg/java/sql/Timestamp.java +532 −0
  99. java/pkg/java/sql/Types.class +0 −0
  100. java/pkg/java/sql/Types.java +314 −0
  101. java/pkg/java/sql/Wrapper.class +0 −0
  102. java/pkg/java/sql/Wrapper.java +80 −0
  103. java/pkg/java/sql/mkfile +56 −0
  104. java/pkg/java/sql/package.html +326 −0
java/pkg/java/sql/Array.class+0−0

Binary file not shown.

java/pkg/java/sql/Array.java+366−0
@@ -0,0 +1,366 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The mapping in the Java programming language for the SQL type
30+ * <code>ARRAY</code>.
31+ * By default, an <code>Array</code> value is a transaction-duration
32+ * reference to an SQL <code>ARRAY</code> value. By default, an <code>Array</code>
33+ * object is implemented using an SQL LOCATOR(array) internally, which
34+ * means that an <code>Array</code> object contains a logical pointer
35+ * to the data in the SQL <code>ARRAY</code> value rather
36+ * than containing the <code>ARRAY</code> value's data.
37+ * <p>
38+ * The <code>Array</code> interface provides methods for bringing an SQL
39+ * <code>ARRAY</code> value's data to the client as either an array or a
40+ * <code>ResultSet</code> object.
41+ * If the elements of the SQL <code>ARRAY</code>
42+ * are a UDT, they may be custom mapped. To create a custom mapping,
43+ * a programmer must do two things:
44+ * <ul>
45+ * <li>create a class that implements the {@link SQLData}
46+ * interface for the UDT to be custom mapped.
47+ * <li>make an entry in a type map that contains
48+ * <ul>
49+ * <li>the fully-qualified SQL type name of the UDT
50+ * <li>the <code>Class</code> object for the class implementing
51+ * <code>SQLData</code>
52+ * </ul>
53+ * </ul>
54+ * <p>
55+ * When a type map with an entry for
56+ * the base type is supplied to the methods <code>getArray</code>
57+ * and <code>getResultSet</code>, the mapping
58+ * it contains will be used to map the elements of the <code>ARRAY</code> value.
59+ * If no type map is supplied, which would typically be the case,
60+ * the connection's type map is used by default.
61+ * If the connection's type map or a type map supplied to a method has no entry
62+ * for the base type, the elements are mapped according to the standard mapping.
63+ * <p>
64+ * All methods on the <code>Array</code> interface must be fully implemented if the
65+ * JDBC driver supports the data type.
66+ *
67+ * @since 1.2
68+ */
69+
70+public interface Array {
71+
72+ /**
73+ * Retrieves the SQL type name of the elements in
74+ * the array designated by this <code>Array</code> object.
75+ * If the elements are a built-in type, it returns
76+ * the database-specific type name of the elements.
77+ * If the elements are a user-defined type (UDT),
78+ * this method returns the fully-qualified SQL type name.
79+ *
80+ * @return a <code>String</code> that is the database-specific
81+ * name for a built-in base type; or the fully-qualified SQL type
82+ * name for a base type that is a UDT
83+ * @exception SQLException if an error occurs while attempting
84+ * to access the type name
85+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
86+ * this method
87+ * @since 1.2
88+ */
89+ String getBaseTypeName() throws SQLException;
90+
91+ /**
92+ * Retrieves the JDBC type of the elements in the array designated
93+ * by this <code>Array</code> object.
94+ *
95+ * @return a constant from the class {@link java.sql.Types} that is
96+ * the type code for the elements in the array designated by this
97+ * <code>Array</code> object
98+ * @exception SQLException if an error occurs while attempting
99+ * to access the base type
100+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
101+ * this method
102+ * @since 1.2
103+ */
104+ int getBaseType() throws SQLException;
105+
106+ /**
107+ * Retrieves the contents of the SQL <code>ARRAY</code> value designated
108+ * by this
109+ * <code>Array</code> object in the form of an array in the Java
110+ * programming language. This version of the method <code>getArray</code>
111+ * uses the type map associated with the connection for customizations of
112+ * the type mappings.
113+ * <p>
114+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
115+ * a base type that maps to a primitive data type, then it is
116+ * implementation-defined whether the array returned is an array of
117+ * that primitive data type or an array of <code>Object</code>.
118+ *
119+ * @return an array in the Java programming language that contains
120+ * the ordered elements of the SQL <code>ARRAY</code> value
121+ * designated by this <code>Array</code> object
122+ * @exception SQLException if an error occurs while attempting to
123+ * access the array
124+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
125+ * this method
126+ * @since 1.2
127+ */
128+ Object getArray() throws SQLException;
129+
130+ /**
131+ * Retrieves the contents of the SQL <code>ARRAY</code> value designated by this
132+ * <code>Array</code> object.
133+ * This method uses
134+ * the specified <code>map</code> for type map customizations
135+ * unless the base type of the array does not match a user-defined
136+ * type in <code>map</code>, in which case it
137+ * uses the standard mapping. This version of the method
138+ * <code>getArray</code> uses either the given type map or the standard mapping;
139+ * it never uses the type map associated with the connection.
140+ * <p>
141+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
142+ * a base type that maps to a primitive data type, then it is
143+ * implementation-defined whether the array returned is an array of
144+ * that primitive data type or an array of <code>Object</code>.
145+ *
146+ * @param map a <code>java.util.Map</code> object that contains mappings
147+ * of SQL type names to classes in the Java programming language
148+ * @return an array in the Java programming language that contains the ordered
149+ * elements of the SQL array designated by this object
150+ * @exception SQLException if an error occurs while attempting to
151+ * access the array
152+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
153+ * this method
154+ * @since 1.2
155+ */
156+ Object getArray(java.util.Map<String,Class<?>> map) throws SQLException;
157+
158+ /**
159+ * Retrieves a slice of the SQL <code>ARRAY</code>
160+ * value designated by this <code>Array</code> object, beginning with the
161+ * specified <code>index</code> and containing up to <code>count</code>
162+ * successive elements of the SQL array. This method uses the type map
163+ * associated with the connection for customizations of the type mappings.
164+ * <p>
165+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
166+ * a base type that maps to a primitive data type, then it is
167+ * implementation-defined whether the array returned is an array of
168+ * that primitive data type or an array of <code>Object</code>.
169+ *
170+ * @param index the array index of the first element to retrieve;
171+ * the first element is at index 1
172+ * @param count the number of successive SQL array elements to retrieve
173+ * @return an array containing up to <code>count</code> consecutive elements
174+ * of the SQL array, beginning with element <code>index</code>
175+ * @exception SQLException if an error occurs while attempting to
176+ * access the array
177+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
178+ * this method
179+ * @since 1.2
180+ */
181+ Object getArray(long index, int count) throws SQLException;
182+
183+ /**
184+ * Retreives a slice of the SQL <code>ARRAY</code> value
185+ * designated by this <code>Array</code> object, beginning with the specified
186+ * <code>index</code> and containing up to <code>count</code>
187+ * successive elements of the SQL array.
188+ * <P>
189+ * This method uses
190+ * the specified <code>map</code> for type map customizations
191+ * unless the base type of the array does not match a user-defined
192+ * type in <code>map</code>, in which case it
193+ * uses the standard mapping. This version of the method
194+ * <code>getArray</code> uses either the given type map or the standard mapping;
195+ * it never uses the type map associated with the connection.
196+ * <p>
197+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
198+ * a base type that maps to a primitive data type, then it is
199+ * implementation-defined whether the array returned is an array of
200+ * that primitive data type or an array of <code>Object</code>.
201+ *
202+ * @param index the array index of the first element to retrieve;
203+ * the first element is at index 1
204+ * @param count the number of successive SQL array elements to
205+ * retrieve
206+ * @param map a <code>java.util.Map</code> object
207+ * that contains SQL type names and the classes in
208+ * the Java programming language to which they are mapped
209+ * @return an array containing up to <code>count</code>
210+ * consecutive elements of the SQL <code>ARRAY</code> value designated by this
211+ * <code>Array</code> object, beginning with element
212+ * <code>index</code>
213+ * @exception SQLException if an error occurs while attempting to
214+ * access the array
215+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
216+ * this method
217+ * @since 1.2
218+ */
219+ Object getArray(long index, int count, java.util.Map<String,Class<?>> map)
220+ throws SQLException;
221+
222+ /**
223+ * Retrieves a result set that contains the elements of the SQL
224+ * <code>ARRAY</code> value
225+ * designated by this <code>Array</code> object. If appropriate,
226+ * the elements of the array are mapped using the connection's type
227+ * map; otherwise, the standard mapping is used.
228+ * <p>
229+ * The result set contains one row for each array element, with
230+ * two columns in each row. The second column stores the element
231+ * value; the first column stores the index into the array for
232+ * that element (with the first array element being at index 1).
233+ * The rows are in ascending order corresponding to
234+ * the order of the indices.
235+ *
236+ * @return a {@link ResultSet} object containing one row for each
237+ * of the elements in the array designated by this <code>Array</code>
238+ * object, with the rows in ascending order based on the indices.
239+ * @exception SQLException if an error occurs while attempting to
240+ * access the array
241+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
242+ * this method
243+ * @since 1.2
244+ */
245+ ResultSet getResultSet () throws SQLException;
246+
247+ /**
248+ * Retrieves a result set that contains the elements of the SQL
249+ * <code>ARRAY</code> value designated by this <code>Array</code> object.
250+ * This method uses
251+ * the specified <code>map</code> for type map customizations
252+ * unless the base type of the array does not match a user-defined
253+ * type in <code>map</code>, in which case it
254+ * uses the standard mapping. This version of the method
255+ * <code>getResultSet</code> uses either the given type map or the standard mapping;
256+ * it never uses the type map associated with the connection.
257+ * <p>
258+ * The result set contains one row for each array element, with
259+ * two columns in each row. The second column stores the element
260+ * value; the first column stores the index into the array for
261+ * that element (with the first array element being at index 1).
262+ * The rows are in ascending order corresponding to
263+ * the order of the indices.
264+ *
265+ * @param map contains the mapping of SQL user-defined types to
266+ * classes in the Java programming language
267+ * @return a <code>ResultSet</code> object containing one row for each
268+ * of the elements in the array designated by this <code>Array</code>
269+ * object, with the rows in ascending order based on the indices.
270+ * @exception SQLException if an error occurs while attempting to
271+ * access the array
272+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
273+ * this method
274+ * @since 1.2
275+ */
276+ ResultSet getResultSet (java.util.Map<String,Class<?>> map) throws SQLException;
277+
278+ /**
279+ * Retrieves a result set holding the elements of the subarray that
280+ * starts at index <code>index</code> and contains up to
281+ * <code>count</code> successive elements. This method uses
282+ * the connection's type map to map the elements of the array if
283+ * the map contains an entry for the base type. Otherwise, the
284+ * standard mapping is used.
285+ * <P>
286+ * The result set has one row for each element of the SQL array
287+ * designated by this object, with the first row containing the
288+ * element at index <code>index</code>. The result set has
289+ * up to <code>count</code> rows in ascending order based on the
290+ * indices. Each row has two columns: The second column stores
291+ * the element value; the first column stores the index into the
292+ * array for that element.
293+ *
294+ * @param index the array index of the first element to retrieve;
295+ * the first element is at index 1
296+ * @param count the number of successive SQL array elements to retrieve
297+ * @return a <code>ResultSet</code> object containing up to
298+ * <code>count</code> consecutive elements of the SQL array
299+ * designated by this <code>Array</code> object, starting at
300+ * index <code>index</code>.
301+ * @exception SQLException if an error occurs while attempting to
302+ * access the array
303+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
304+ * this method
305+ * @since 1.2
306+ */
307+ ResultSet getResultSet(long index, int count) throws SQLException;
308+
309+ /**
310+ * Retrieves a result set holding the elements of the subarray that
311+ * starts at index <code>index</code> and contains up to
312+ * <code>count</code> successive elements.
313+ * This method uses
314+ * the specified <code>map</code> for type map customizations
315+ * unless the base type of the array does not match a user-defined
316+ * type in <code>map</code>, in which case it
317+ * uses the standard mapping. This version of the method
318+ * <code>getResultSet</code> uses either the given type map or the standard mapping;
319+ * it never uses the type map associated with the connection.
320+ * <P>
321+ * The result set has one row for each element of the SQL array
322+ * designated by this object, with the first row containing the
323+ * element at index <code>index</code>. The result set has
324+ * up to <code>count</code> rows in ascending order based on the
325+ * indices. Each row has two columns: The second column stores
326+ * the element value; the first column stroes the index into the
327+ * array for that element.
328+ *
329+ * @param index the array index of the first element to retrieve;
330+ * the first element is at index 1
331+ * @param count the number of successive SQL array elements to retrieve
332+ * @param map the <code>Map</code> object that contains the mapping
333+ * of SQL type names to classes in the Java(tm) programming language
334+ * @return a <code>ResultSet</code> object containing up to
335+ * <code>count</code> consecutive elements of the SQL array
336+ * designated by this <code>Array</code> object, starting at
337+ * index <code>index</code>.
338+ * @exception SQLException if an error occurs while attempting to
339+ * access the array
340+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
341+ * this method
342+ * @since 1.2
343+ */
344+ ResultSet getResultSet (long index, int count,
345+ java.util.Map<String,Class<?>> map)
346+ throws SQLException;
347+ /**
348+ * This method frees the <code>Array</code> object and releases the resources that
349+ * it holds. The object is invalid once the <code>free</code>
350+ * method is called.
351+ *<p>
352+ * After <code>free</code> has been called, any attempt to invoke a
353+ * method other than <code>free</code> will result in a <code>SQLException</code>
354+ * being thrown. If <code>free</code> is called multiple times, the subsequent
355+ * calls to <code>free</code> are treated as a no-op.
356+ *<p>
357+ *
358+ * @throws SQLException if an error occurs releasing
359+ * the Array's resources
360+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
361+ * this method
362+ * @since 1.6
363+ */
364+ void free() throws SQLException;
365+
366+}
java/pkg/java/sql/BatchUpdateException.class+0−0

Binary file not shown.

java/pkg/java/sql/BatchUpdateException.java+340−0
@@ -0,0 +1,340 @@
1+/*
2+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.Arrays;
29+
30+/**
31+ * The subclass of {@link SQLException} thrown when an error
32+ * occurs during a batch update operation. In addition to the
33+ * information provided by {@link SQLException}, a
34+ * <code>BatchUpdateException</code> provides the update
35+ * counts for all commands that were executed successfully during the
36+ * batch update, that is, all commands that were executed before the error
37+ * occurred. The order of elements in an array of update counts
38+ * corresponds to the order in which commands were added to the batch.
39+ * <P>
40+ * After a command in a batch update fails to execute properly
41+ * and a <code>BatchUpdateException</code> is thrown, the driver
42+ * may or may not continue to process the remaining commands in
43+ * the batch. If the driver continues processing after a failure,
44+ * the array returned by the method
45+ * <code>BatchUpdateException.getUpdateCounts</code> will have
46+ * an element for every command in the batch rather than only
47+ * elements for the commands that executed successfully before
48+ * the error. In the case where the driver continues processing
49+ * commands, the array element for any command
50+ * that failed is <code>Statement.EXECUTE_FAILED</code>.
51+ * <P>
52+ * @since 1.2
53+ */
54+
55+public class BatchUpdateException extends SQLException {
56+
57+ /**
58+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
59+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code> and
60+ * <code>updateCounts</code>.
61+ * The <code>cause</code> is not initialized, and may subsequently be
62+ * initialized by a call to the
63+ * {@link Throwable#initCause(java.lang.Throwable)} method.
64+ * <p>
65+ *
66+ * @param reason a description of the error
67+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
68+ * @param vendorCode an exception code used by a particular
69+ * database vendor
70+ * @param updateCounts an array of <code>int</code>, with each element
71+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
72+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
73+ * the batch for JDBC drivers that continue processing
74+ * after a command failure; an update count or
75+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
76+ * prior to the failure for JDBC drivers that stop processing after a command
77+ * failure
78+ * @since 1.2
79+ */
80+ public BatchUpdateException( String reason, String SQLState, int vendorCode,
81+ int[] updateCounts ) {
82+ super(reason, SQLState, vendorCode);
83+ this.updateCounts = (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length);
84+ }
85+
86+ /**
87+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
88+ * <code>reason</code>, <code>SQLState</code> and
89+ * <code>updateCounts</code>.
90+ * The <code>cause</code> is not initialized, and may subsequently be
91+ * initialized by a call to the
92+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
93+ * is initialized to 0.
94+ * <p>
95+ *
96+ * @param reason a description of the exception
97+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
98+ * @param updateCounts an array of <code>int</code>, with each element
99+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
100+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
101+ * the batch for JDBC drivers that continue processing
102+ * after a command failure; an update count or
103+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
104+ * prior to the failure for JDBC drivers that stop processing after a command
105+ * failure
106+ * @since 1.2
107+ */
108+ public BatchUpdateException(String reason, String SQLState,
109+ int[] updateCounts) {
110+ this(reason, SQLState, 0, updateCounts);
111+ }
112+
113+ /**
114+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
115+ * <code>reason</code> and <code>updateCounts</code>.
116+ * The <code>cause</code> is not initialized, and may subsequently be
117+ * initialized by a call to the
118+ * {@link Throwable#initCause(java.lang.Throwable)} method. The
119+ * <code>SQLState</code> is initialized to <code>null</code>
120+ * and the vender code is initialized to 0.
121+ * <p>
122+ *
123+ *
124+ * @param reason a description of the exception
125+ * @param updateCounts an array of <code>int</code>, with each element
126+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
127+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
128+ * the batch for JDBC drivers that continue processing
129+ * after a command failure; an update count or
130+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
131+ * prior to the failure for JDBC drivers that stop processing after a command
132+ * failure
133+ * @since 1.2
134+ */
135+ public BatchUpdateException(String reason, int[] updateCounts) {
136+ this(reason, null, 0, updateCounts);
137+ }
138+
139+ /**
140+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
141+ * <code>updateCounts</code>.
142+ * initialized by a call to the
143+ * {@link Throwable#initCause(java.lang.Throwable)} method. The <code>reason</code>
144+ * and <code>SQLState</code> are initialized to null and the vendor code
145+ * is initialized to 0.
146+ * <p>
147+ *
148+ * @param updateCounts an array of <code>int</code>, with each element
149+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
150+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
151+ * the batch for JDBC drivers that continue processing
152+ * after a command failure; an update count or
153+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
154+ * prior to the failure for JDBC drivers that stop processing after a command
155+ * failure
156+ * @since 1.2
157+ */
158+ public BatchUpdateException(int[] updateCounts) {
159+ this(null, null, 0, updateCounts);
160+ }
161+
162+ /**
163+ * Constructs a <code>BatchUpdateException</code> object.
164+ * The <code>reason</code>, <code>SQLState</code> and <code>updateCounts</code>
165+ * are initialized to <code>null</code> and the vendor code is initialized to 0.
166+ * The <code>cause</code> is not initialized, and may subsequently be
167+ * initialized by a call to the
168+ * {@link Throwable#initCause(java.lang.Throwable)} method.
169+ * <p>
170+ *
171+ * @since 1.2
172+ */
173+ public BatchUpdateException() {
174+ this(null, null, 0, null);
175+ }
176+
177+ /**
178+ * Constructs a <code>BatchUpdateException</code> object initialized with
179+ * a given <code>cause</code>.
180+ * The <code>SQLState</code> and <code>updateCounts</code>
181+ * are initialized
182+ * to <code>null</code> and the vendor code is initialized to 0.
183+ * The <code>reason</code> is initialized to <code>null</code> if
184+ * <code>cause==null</code> or to <code>cause.toString()</code> if
185+ * <code>cause!=null</code>.
186+ * @param cause the underlying reason for this <code>SQLException</code>
187+ * (which is saved for later retrieval by the <code>getCause()</code> method);
188+ * may be null indicating the cause is non-existent or unknown.
189+ * @since 1.6
190+ */
191+ public BatchUpdateException(Throwable cause) {
192+ this((cause == null ? null : cause.toString()), null, 0, null, cause);
193+ }
194+
195+ /**
196+ * Constructs a <code>BatchUpdateException</code> object initialized with a
197+ * given <code>cause</code> and <code>updateCounts</code>.
198+ * The <code>SQLState</code> is initialized
199+ * to <code>null</code> and the vendor code is initialized to 0.
200+ * The <code>reason</code> is initialized to <code>null</code> if
201+ * <code>cause==null</code> or to <code>cause.toString()</code> if
202+ * <code>cause!=null</code>.
203+ *
204+ * @param updateCounts an array of <code>int</code>, with each element
205+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
206+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
207+ * the batch for JDBC drivers that continue processing
208+ * after a command failure; an update count or
209+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
210+ * prior to the failure for JDBC drivers that stop processing after a command
211+ * failure
212+ * @param cause the underlying reason for this <code>SQLException</code>
213+ * (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
214+ * the cause is non-existent or unknown.
215+ * @since 1.6
216+ */
217+ public BatchUpdateException(int []updateCounts , Throwable cause) {
218+ this((cause == null ? null : cause.toString()), null, 0, updateCounts, cause);
219+ }
220+
221+ /**
222+ * Constructs a <code>BatchUpdateException</code> object initialized with
223+ * a given <code>reason</code>, <code>cause</code>
224+ * and <code>updateCounts</code>. The <code>SQLState</code> is initialized
225+ * to <code>null</code> and the vendor code is initialized to 0.
226+ *
227+ * @param reason a description of the exception
228+ * @param updateCounts an array of <code>int</code>, with each element
229+ *indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
230+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
231+ * the batch for JDBC drivers that continue processing
232+ * after a command failure; an update count or
233+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
234+ * prior to the failure for JDBC drivers that stop processing after a command
235+ * failure
236+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method);
237+ * may be null indicating
238+ * the cause is non-existent or unknown.
239+ * @since 1.6
240+ */
241+ public BatchUpdateException(String reason, int []updateCounts, Throwable cause) {
242+ this(reason, null, 0, updateCounts, cause);
243+ }
244+
245+ /**
246+ * Constructs a <code>BatchUpdateException</code> object initialized with
247+ * a given <code>reason</code>, <code>SQLState</code>,<code>cause</code>, and
248+ * <code>updateCounts</code>. The vendor code is initialized to 0.
249+ *
250+ * @param reason a description of the exception
251+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
252+ * @param updateCounts an array of <code>int</code>, with each element
253+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
254+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
255+ * the batch for JDBC drivers that continue processing
256+ * after a command failure; an update count or
257+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
258+ * prior to the failure for JDBC drivers that stop processing after a command
259+ * failure
260+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method);
261+ * may be null indicating
262+ * the cause is non-existent or unknown.
263+ * @since 1.6
264+ */
265+ public BatchUpdateException(String reason, String SQLState,
266+ int []updateCounts, Throwable cause) {
267+ this(reason, SQLState, 0, updateCounts, cause);
268+ }
269+
270+ /**
271+ * Constructs a <code>BatchUpdateException</code> object initialized with
272+ * a given <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
273+ * <code>cause</code> and <code>updateCounts</code>.
274+ *
275+ * @param reason a description of the error
276+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
277+ * @param vendorCode an exception code used by a particular
278+ * database vendor
279+ * @param updateCounts an array of <code>int</code>, with each element
280+ *indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
281+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
282+ * the batch for JDBC drivers that continue processing
283+ * after a command failure; an update count or
284+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
285+ * prior to the failure for JDBC drivers that stop processing after a command
286+ * failure
287+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method);
288+ * may be null indicating
289+ * the cause is non-existent or unknown.
290+ * @since 1.6
291+ */
292+ public BatchUpdateException(String reason, String SQLState, int vendorCode,
293+ int []updateCounts,Throwable cause) {
294+ super(reason, SQLState, vendorCode, cause);
295+ this.updateCounts = (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length);
296+ }
297+
298+ /**
299+ * Retrieves the update count for each update statement in the batch
300+ * update that executed successfully before this exception occurred.
301+ * A driver that implements batch updates may or may not continue to
302+ * process the remaining commands in a batch when one of the commands
303+ * fails to execute properly. If the driver continues processing commands,
304+ * the array returned by this method will have as many elements as
305+ * there are commands in the batch; otherwise, it will contain an
306+ * update count for each command that executed successfully before
307+ * the <code>BatchUpdateException</code> was thrown.
308+ *<P>
309+ * The possible return values for this method were modified for
310+ * the Java 2 SDK, Standard Edition, version 1.3. This was done to
311+ * accommodate the new option of continuing to process commands
312+ * in a batch update after a <code>BatchUpdateException</code> object
313+ * has been thrown.
314+ *
315+ * @return an array of <code>int</code> containing the update counts
316+ * for the updates that were executed successfully before this error
317+ * occurred. Or, if the driver continues to process commands after an
318+ * error, one of the following for every command in the batch:
319+ * <OL>
320+ * <LI>an update count
321+ * <LI><code>Statement.SUCCESS_NO_INFO</code> to indicate that the command
322+ * executed successfully but the number of rows affected is unknown
323+ * <LI><code>Statement.EXECUTE_FAILED</code> to indicate that the command
324+ * failed to execute successfully
325+ * </OL>
326+ * @since 1.3
327+ */
328+ public int[] getUpdateCounts() {
329+ return (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length);
330+ }
331+
332+ /**
333+ * The array that describes the outcome of a batch execution.
334+ * @serial
335+ * @since 1.2
336+ */
337+ private final int[] updateCounts;
338+
339+ private static final long serialVersionUID = 5977529877145521757L;
340+}
java/pkg/java/sql/Blob.class+0−0

Binary file not shown.

java/pkg/java/sql/Blob.java+304−0
@@ -0,0 +1,304 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.io.InputStream;
29+
30+/**
31+ * The representation (mapping) in
32+ * the Java<sup><font size=-2>TM</font></sup> programming
33+ * language of an SQL
34+ * <code>BLOB</code> value. An SQL <code>BLOB</code> is a built-in type
35+ * that stores a Binary Large Object as a column value in a row of
36+ * a database table. By default drivers implement <code>Blob</code> using
37+ * an SQL <code>locator(BLOB)</code>, which means that a
38+ * <code>Blob</code> object contains a logical pointer to the
39+ * SQL <code>BLOB</code> data rather than the data itself.
40+ * A <code>Blob</code> object is valid for the duration of the
41+ * transaction in which is was created.
42+ *
43+ * <P>Methods in the interfaces {@link ResultSet},
44+ * {@link CallableStatement}, and {@link PreparedStatement}, such as
45+ * <code>getBlob</code> and <code>setBlob</code> allow a programmer to
46+ * access an SQL <code>BLOB</code> value.
47+ * The <code>Blob</code> interface provides methods for getting the
48+ * length of an SQL <code>BLOB</code> (Binary Large Object) value,
49+ * for materializing a <code>BLOB</code> value on the client, and for
50+ * determining the position of a pattern of bytes within a
51+ * <code>BLOB</code> value. In addition, this interface has methods for updating
52+ * a <code>BLOB</code> value.
53+ * <p>
54+ * All methods on the <code>Blob</code> interface must be fully implemented if the
55+ * JDBC driver supports the data type.
56+ *
57+ * @since 1.2
58+ */
59+
60+public interface Blob {
61+
62+ /**
63+ * Returns the number of bytes in the <code>BLOB</code> value
64+ * designated by this <code>Blob</code> object.
65+ * @return length of the <code>BLOB</code> in bytes
66+ * @exception SQLException if there is an error accessing the
67+ * length of the <code>BLOB</code>
68+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
69+ * this method
70+ * @since 1.2
71+ */
72+ long length() throws SQLException;
73+
74+ /**
75+ * Retrieves all or part of the <code>BLOB</code>
76+ * value that this <code>Blob</code> object represents, as an array of
77+ * bytes. This <code>byte</code> array contains up to <code>length</code>
78+ * consecutive bytes starting at position <code>pos</code>.
79+ *
80+ * @param pos the ordinal position of the first byte in the
81+ * <code>BLOB</code> value to be extracted; the first byte is at
82+ * position 1
83+ * @param length the number of consecutive bytes to be copied; the value
84+ * for length must be 0 or greater
85+ * @return a byte array containing up to <code>length</code>
86+ * consecutive bytes from the <code>BLOB</code> value designated
87+ * by this <code>Blob</code> object, starting with the
88+ * byte at position <code>pos</code>
89+ * @exception SQLException if there is an error accessing the
90+ * <code>BLOB</code> value; if pos is less than 1 or length is
91+ * less than 0
92+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
93+ * this method
94+ * @see #setBytes
95+ * @since 1.2
96+ */
97+ byte[] getBytes(long pos, int length) throws SQLException;
98+
99+ /**
100+ * Retrieves the <code>BLOB</code> value designated by this
101+ * <code>Blob</code> instance as a stream.
102+ *
103+ * @return a stream containing the <code>BLOB</code> data
104+ * @exception SQLException if there is an error accessing the
105+ * <code>BLOB</code> value
106+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
107+ * this method
108+ * @see #setBinaryStream
109+ * @since 1.2
110+ */
111+ java.io.InputStream getBinaryStream () throws SQLException;
112+
113+ /**
114+ * Retrieves the byte position at which the specified byte array
115+ * <code>pattern</code> begins within the <code>BLOB</code>
116+ * value that this <code>Blob</code> object represents. The
117+ * search for <code>pattern</code> begins at position
118+ * <code>start</code>.
119+ *
120+ * @param pattern the byte array for which to search
121+ * @param start the position at which to begin searching; the
122+ * first position is 1
123+ * @return the position at which the pattern appears, else -1
124+ * @exception SQLException if there is an error accessing the
125+ * <code>BLOB</code> or if start is less than 1
126+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
127+ * this method
128+ * @since 1.2
129+ */
130+ long position(byte pattern[], long start) throws SQLException;
131+
132+ /**
133+ * Retrieves the byte position in the <code>BLOB</code> value
134+ * designated by this <code>Blob</code> object at which
135+ * <code>pattern</code> begins. The search begins at position
136+ * <code>start</code>.
137+ *
138+ * @param pattern the <code>Blob</code> object designating
139+ * the <code>BLOB</code> value for which to search
140+ * @param start the position in the <code>BLOB</code> value
141+ * at which to begin searching; the first position is 1
142+ * @return the position at which the pattern begins, else -1
143+ * @exception SQLException if there is an error accessing the
144+ * <code>BLOB</code> value or if start is less than 1
145+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
146+ * this method
147+ * @since 1.2
148+ */
149+ long position(Blob pattern, long start) throws SQLException;
150+
151+ // -------------------------- JDBC 3.0 -----------------------------------
152+
153+ /**
154+ * Writes the given array of bytes to the <code>BLOB</code> value that
155+ * this <code>Blob</code> object represents, starting at position
156+ * <code>pos</code>, and returns the number of bytes written.
157+ * The array of bytes will overwrite the existing bytes
158+ * in the <code>Blob</code> object starting at the position
159+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
160+ * while writing the array of bytes, then the length of the <code>Blob</code>
161+ * value will be increased to accomodate the extra bytes.
162+ * <p>
163+ * <b>Note:</b> If the value specified for <code>pos</code>
164+ * is greater then the length+1 of the <code>BLOB</code> value then the
165+ * behavior is undefined. Some JDBC drivers may throw a
166+ * <code>SQLException</code> while other drivers may support this
167+ * operation.
168+ *
169+ * @param pos the position in the <code>BLOB</code> object at which
170+ * to start writing; the first position is 1
171+ * @param bytes the array of bytes to be written to the <code>BLOB</code>
172+ * value that this <code>Blob</code> object represents
173+ * @return the number of bytes written
174+ * @exception SQLException if there is an error accessing the
175+ * <code>BLOB</code> value or if pos is less than 1
176+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
177+ * this method
178+ * @see #getBytes
179+ * @since 1.4
180+ */
181+ int setBytes(long pos, byte[] bytes) throws SQLException;
182+
183+ /**
184+ * Writes all or part of the given <code>byte</code> array to the
185+ * <code>BLOB</code> value that this <code>Blob</code> object represents
186+ * and returns the number of bytes written.
187+ * Writing starts at position <code>pos</code> in the <code>BLOB</code>
188+ * value; <code>len</code> bytes from the given byte array are written.
189+ * The array of bytes will overwrite the existing bytes
190+ * in the <code>Blob</code> object starting at the position
191+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
192+ * while writing the array of bytes, then the length of the <code>Blob</code>
193+ * value will be increased to accomodate the extra bytes.
194+ * <p>
195+ * <b>Note:</b> If the value specified for <code>pos</code>
196+ * is greater then the length+1 of the <code>BLOB</code> value then the
197+ * behavior is undefined. Some JDBC drivers may throw a
198+ * <code>SQLException</code> while other drivers may support this
199+ * operation.
200+ *
201+ * @param pos the position in the <code>BLOB</code> object at which
202+ * to start writing; the first position is 1
203+ * @param bytes the array of bytes to be written to this <code>BLOB</code>
204+ * object
205+ * @param offset the offset into the array <code>bytes</code> at which
206+ * to start reading the bytes to be set
207+ * @param len the number of bytes to be written to the <code>BLOB</code>
208+ * value from the array of bytes <code>bytes</code>
209+ * @return the number of bytes written
210+ * @exception SQLException if there is an error accessing the
211+ * <code>BLOB</code> value or if pos is less than 1
212+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
213+ * this method
214+ * @see #getBytes
215+ * @since 1.4
216+ */
217+ int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException;
218+
219+ /**
220+ * Retrieves a stream that can be used to write to the <code>BLOB</code>
221+ * value that this <code>Blob</code> object represents. The stream begins
222+ * at position <code>pos</code>.
223+ * The bytes written to the stream will overwrite the existing bytes
224+ * in the <code>Blob</code> object starting at the position
225+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
226+ * while writing to the stream, then the length of the <code>Blob</code>
227+ * value will be increased to accomodate the extra bytes.
228+ * <p>
229+ * <b>Note:</b> If the value specified for <code>pos</code>
230+ * is greater then the length+1 of the <code>BLOB</code> value then the
231+ * behavior is undefined. Some JDBC drivers may throw a
232+ * <code>SQLException</code> while other drivers may support this
233+ * operation.
234+ *
235+ * @param pos the position in the <code>BLOB</code> value at which
236+ * to start writing; the first position is 1
237+ * @return a <code>java.io.OutputStream</code> object to which data can
238+ * be written
239+ * @exception SQLException if there is an error accessing the
240+ * <code>BLOB</code> value or if pos is less than 1
241+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
242+ * this method
243+ * @see #getBinaryStream
244+ * @since 1.4
245+ */
246+ java.io.OutputStream setBinaryStream(long pos) throws SQLException;
247+
248+ /**
249+ * Truncates the <code>BLOB</code> value that this <code>Blob</code>
250+ * object represents to be <code>len</code> bytes in length.
251+ * <p>
252+ * <b>Note:</b> If the value specified for <code>pos</code>
253+ * is greater then the length+1 of the <code>BLOB</code> value then the
254+ * behavior is undefined. Some JDBC drivers may throw a
255+ * <code>SQLException</code> while other drivers may support this
256+ * operation.
257+ *
258+ * @param len the length, in bytes, to which the <code>BLOB</code> value
259+ * that this <code>Blob</code> object represents should be truncated
260+ * @exception SQLException if there is an error accessing the
261+ * <code>BLOB</code> value or if len is less than 0
262+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
263+ * this method
264+ * @since 1.4
265+ */
266+ void truncate(long len) throws SQLException;
267+
268+ /**
269+ * This method frees the <code>Blob</code> object and releases the resources that
270+ * it holds. The object is invalid once the <code>free</code>
271+ * method is called.
272+ *<p>
273+ * After <code>free</code> has been called, any attempt to invoke a
274+ * method other than <code>free</code> will result in a <code>SQLException</code>
275+ * being thrown. If <code>free</code> is called multiple times, the subsequent
276+ * calls to <code>free</code> are treated as a no-op.
277+ *<p>
278+ *
279+ * @throws SQLException if an error occurs releasing
280+ * the Blob's resources
281+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
282+ * this method
283+ * @since 1.6
284+ */
285+ void free() throws SQLException;
286+
287+ /**
288+ * Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
289+ * starting with the byte specified by pos, which is length bytes in length.
290+ *
291+ * @param pos the offset to the first byte of the partial value to be retrieved.
292+ * The first byte in the <code>Blob</code> is at position 1
293+ * @param length the length in bytes of the partial value to be retrieved
294+ * @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
295+ * @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
296+ * in the <code>Blob</code> or if pos + length is greater than the number of bytes
297+ * in the <code>Blob</code>
298+ *
299+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
300+ * this method
301+ * @since 1.6
302+ */
303+ InputStream getBinaryStream(long pos, long length) throws SQLException;
304+}
java/pkg/java/sql/CallableStatement.class+0−0

Binary file not shown.

java/pkg/java/sql/CallableStatement.java+2499−0
@@ -0,0 +1,2499 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.math.BigDecimal;
29+import java.util.Calendar;
30+import java.io.Reader;
31+import java.io.InputStream;
32+
33+/**
34+ * The interface used to execute SQL stored procedures. The JDBC API
35+ * provides a stored procedure SQL escape syntax that allows stored procedures
36+ * to be called in a standard way for all RDBMSs. This escape syntax has one
37+ * form that includes a result parameter and one that does not. If used, the result
38+ * parameter must be registered as an OUT parameter. The other parameters
39+ * can be used for input, output or both. Parameters are referred to
40+ * sequentially, by number, with the first parameter being 1.
41+ * <PRE>
42+ * {?= call &lt;procedure-name&gt;[(&lt;arg1&gt;,&lt;arg2&gt;, ...)]}
43+ * {call &lt;procedure-name&gt;[(&lt;arg1&gt;,&lt;arg2&gt;, ...)]}
44+ * </PRE>
45+ * <P>
46+ * IN parameter values are set using the <code>set</code> methods inherited from
47+ * {@link PreparedStatement}. The type of all OUT parameters must be
48+ * registered prior to executing the stored procedure; their values
49+ * are retrieved after execution via the <code>get</code> methods provided here.
50+ * <P>
51+ * A <code>CallableStatement</code> can return one {@link ResultSet} object or
52+ * multiple <code>ResultSet</code> objects. Multiple
53+ * <code>ResultSet</code> objects are handled using operations
54+ * inherited from {@link Statement}.
55+ * <P>
56+ * For maximum portability, a call's <code>ResultSet</code> objects and
57+ * update counts should be processed prior to getting the values of output
58+ * parameters.
59+ * <P>
60+ *
61+ * @see Connection#prepareCall
62+ * @see ResultSet
63+ */
64+
65+public interface CallableStatement extends PreparedStatement {
66+
67+ /**
68+ * Registers the OUT parameter in ordinal position
69+ * <code>parameterIndex</code> to the JDBC type
70+ * <code>sqlType</code>. All OUT parameters must be registered
71+ * before a stored procedure is executed.
72+ * <p>
73+ * The JDBC type specified by <code>sqlType</code> for an OUT
74+ * parameter determines the Java type that must be used
75+ * in the <code>get</code> method to read the value of that parameter.
76+ * <p>
77+ * If the JDBC type expected to be returned to this output parameter
78+ * is specific to this particular database, <code>sqlType</code>
79+ * should be <code>java.sql.Types.OTHER</code>. The method
80+ * {@link #getObject} retrieves the value.
81+ *
82+ * @param parameterIndex the first parameter is 1, the second is 2,
83+ * and so on
84+ * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.
85+ * If the parameter is of JDBC type <code>NUMERIC</code>
86+ * or <code>DECIMAL</code>, the version of
87+ * <code>registerOutParameter</code> that accepts a scale value
88+ * should be used.
89+ *
90+ * @exception SQLException if the parameterIndex is not valid;
91+ * if a database access error occurs or
92+ * this method is called on a closed <code>CallableStatement</code>
93+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
94+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
95+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
96+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
97+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
98+ * or <code>STRUCT</code> data type and the JDBC driver does not support
99+ * this data type
100+ * @see Types
101+ */
102+ void registerOutParameter(int parameterIndex, int sqlType)
103+ throws SQLException;
104+
105+ /**
106+ * Registers the parameter in ordinal position
107+ * <code>parameterIndex</code> to be of JDBC type
108+ * <code>sqlType</code>. All OUT parameters must be registered
109+ * before a stored procedure is executed.
110+ * <p>
111+ * The JDBC type specified by <code>sqlType</code> for an OUT
112+ * parameter determines the Java type that must be used
113+ * in the <code>get</code> method to read the value of that parameter.
114+ * <p>
115+ * This version of <code>registerOutParameter</code> should be
116+ * used when the parameter is of JDBC type <code>NUMERIC</code>
117+ * or <code>DECIMAL</code>.
118+ *
119+ * @param parameterIndex the first parameter is 1, the second is 2,
120+ * and so on
121+ * @param sqlType the SQL type code defined by <code>java.sql.Types</code>.
122+ * @param scale the desired number of digits to the right of the
123+ * decimal point. It must be greater than or equal to zero.
124+ * @exception SQLException if the parameterIndex is not valid;
125+ * if a database access error occurs or
126+ * this method is called on a closed <code>CallableStatement</code>
127+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
128+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
129+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
130+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
131+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
132+ * or <code>STRUCT</code> data type and the JDBC driver does not support
133+ * this data type
134+ * @see Types
135+ */
136+ void registerOutParameter(int parameterIndex, int sqlType, int scale)
137+ throws SQLException;
138+
139+ /**
140+ * Retrieves whether the last OUT parameter read had the value of
141+ * SQL <code>NULL</code>. Note that this method should be called only after
142+ * calling a getter method; otherwise, there is no value to use in
143+ * determining whether it is <code>null</code> or not.
144+ *
145+ * @return <code>true</code> if the last parameter read was SQL
146+ * <code>NULL</code>; <code>false</code> otherwise
147+ * @exception SQLException if a database access error occurs or
148+ * this method is called on a closed <code>CallableStatement</code>
149+ */
150+ boolean wasNull() throws SQLException;
151+
152+ /**
153+ * Retrieves the value of the designated JDBC <code>CHAR</code>,
154+ * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> parameter as a
155+ * <code>String</code> in the Java programming language.
156+ * <p>
157+ * For the fixed-length type JDBC <code>CHAR</code>,
158+ * the <code>String</code> object
159+ * returned has exactly the same value the SQL
160+ * <code>CHAR</code> value had in the
161+ * database, including any padding added by the database.
162+ *
163+ * @param parameterIndex the first parameter is 1, the second is 2,
164+ * and so on
165+ * @return the parameter value. If the value is SQL <code>NULL</code>,
166+ * the result
167+ * is <code>null</code>.
168+ * @exception SQLException if the parameterIndex is not valid;
169+ * if a database access error occurs or
170+ * this method is called on a closed <code>CallableStatement</code>
171+ * @see #setString
172+ */
173+ String getString(int parameterIndex) throws SQLException;
174+
175+ /**
176+ * Retrieves the value of the designated JDBC <code>BIT</code>
177+ * or <code>BOOLEAN</code> parameter as a
178+ * <code>boolean</code> in the Java programming language.
179+ *
180+ * @param parameterIndex the first parameter is 1, the second is 2,
181+ * and so on
182+ * @return the parameter value. If the value is SQL <code>NULL</code>,
183+ * the result is <code>false</code>.
184+ * @exception SQLException if the parameterIndex is not valid;
185+ * if a database access error occurs or
186+ * this method is called on a closed <code>CallableStatement</code>
187+ * @see #setBoolean
188+ */
189+ boolean getBoolean(int parameterIndex) throws SQLException;
190+
191+ /**
192+ * Retrieves the value of the designated JDBC <code>TINYINT</code> parameter
193+ * as a <code>byte</code> in the Java programming language.
194+ *
195+ * @param parameterIndex the first parameter is 1, the second is 2,
196+ * and so on
197+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
198+ * is <code>0</code>.
199+ * @exception SQLException if the parameterIndex is not valid;
200+ * if a database access error occurs or
201+ * this method is called on a closed <code>CallableStatement</code>
202+ * @see #setByte
203+ */
204+ byte getByte(int parameterIndex) throws SQLException;
205+
206+ /**
207+ * Retrieves the value of the designated JDBC <code>SMALLINT</code> parameter
208+ * as a <code>short</code> in the Java programming language.
209+ *
210+ * @param parameterIndex the first parameter is 1, the second is 2,
211+ * and so on
212+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
213+ * is <code>0</code>.
214+ * @exception SQLException if the parameterIndex is not valid;
215+ * if a database access error occurs or
216+ * this method is called on a closed <code>CallableStatement</code>
217+ * @see #setShort
218+ */
219+ short getShort(int parameterIndex) throws SQLException;
220+
221+ /**
222+ * Retrieves the value of the designated JDBC <code>INTEGER</code> parameter
223+ * as an <code>int</code> in the Java programming language.
224+ *
225+ * @param parameterIndex the first parameter is 1, the second is 2,
226+ * and so on
227+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
228+ * is <code>0</code>.
229+ * @exception SQLException if the parameterIndex is not valid;
230+ * if a database access error occurs or
231+ * this method is called on a closed <code>CallableStatement</code>
232+ * @see #setInt
233+ */
234+ int getInt(int parameterIndex) throws SQLException;
235+
236+ /**
237+ * Retrieves the value of the designated JDBC <code>BIGINT</code> parameter
238+ * as a <code>long</code> in the Java programming language.
239+ *
240+ * @param parameterIndex the first parameter is 1, the second is 2,
241+ * and so on
242+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
243+ * is <code>0</code>.
244+ * @exception SQLException if the parameterIndex is not valid;
245+ * if a database access error occurs or
246+ * this method is called on a closed <code>CallableStatement</code>
247+ * @see #setLong
248+ */
249+ long getLong(int parameterIndex) throws SQLException;
250+
251+ /**
252+ * Retrieves the value of the designated JDBC <code>FLOAT</code> parameter
253+ * as a <code>float</code> in the Java programming language.
254+ *
255+ * @param parameterIndex the first parameter is 1, the second is 2,
256+ * and so on
257+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
258+ * is <code>0</code>.
259+ * @exception SQLException if the parameterIndex is not valid;
260+ * if a database access error occurs or
261+ * this method is called on a closed <code>CallableStatement</code>
262+ * @see #setFloat
263+ */
264+ float getFloat(int parameterIndex) throws SQLException;
265+
266+ /**
267+ * Retrieves the value of the designated JDBC <code>DOUBLE</code> parameter as a <code>double</code>
268+ * in the Java programming language.
269+ * @param parameterIndex the first parameter is 1, the second is 2,
270+ * and so on
271+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
272+ * is <code>0</code>.
273+ * @exception SQLException if the parameterIndex is not valid;
274+ * if a database access error occurs or
275+ * this method is called on a closed <code>CallableStatement</code>
276+ * @see #setDouble
277+ */
278+ double getDouble(int parameterIndex) throws SQLException;
279+
280+ /**
281+ * Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a
282+ * <code>java.math.BigDecimal</code> object with <i>scale</i> digits to
283+ * the right of the decimal point.
284+ * @param parameterIndex the first parameter is 1, the second is 2,
285+ * and so on
286+ * @param scale the number of digits to the right of the decimal point
287+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
288+ * is <code>null</code>.
289+ * @exception SQLException if the parameterIndex is not valid;
290+ * if a database access error occurs or
291+ * this method is called on a closed <code>CallableStatement</code>
292+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
293+ * this method
294+ * @deprecated use <code>getBigDecimal(int parameterIndex)</code>
295+ * or <code>getBigDecimal(String parameterName)</code>
296+ * @see #setBigDecimal
297+ */
298+ BigDecimal getBigDecimal(int parameterIndex, int scale)
299+ throws SQLException;
300+
301+ /**
302+ * Retrieves the value of the designated JDBC <code>BINARY</code> or
303+ * <code>VARBINARY</code> parameter as an array of <code>byte</code>
304+ * values in the Java programming language.
305+ * @param parameterIndex the first parameter is 1, the second is 2,
306+ * and so on
307+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
308+ * is <code>null</code>.
309+ * @exception SQLException if the parameterIndex is not valid;
310+ * if a database access error occurs or
311+ * this method is called on a closed <code>CallableStatement</code>
312+ * @see #setBytes
313+ */
314+ byte[] getBytes(int parameterIndex) throws SQLException;
315+
316+ /**
317+ * Retrieves the value of the designated JDBC <code>DATE</code> parameter as a
318+ * <code>java.sql.Date</code> object.
319+ * @param parameterIndex the first parameter is 1, the second is 2,
320+ * and so on
321+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
322+ * is <code>null</code>.
323+ * @exception SQLException if the parameterIndex is not valid;
324+ * if a database access error occurs or
325+ * this method is called on a closed <code>CallableStatement</code>
326+ * @see #setDate
327+ */
328+ java.sql.Date getDate(int parameterIndex) throws SQLException;
329+
330+ /**
331+ * Retrieves the value of the designated JDBC <code>TIME</code> parameter as a
332+ * <code>java.sql.Time</code> object.
333+ *
334+ * @param parameterIndex the first parameter is 1, the second is 2,
335+ * and so on
336+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
337+ * is <code>null</code>.
338+ * @exception SQLException if the parameterIndex is not valid;
339+ * if a database access error occurs or
340+ * this method is called on a closed <code>CallableStatement</code>
341+ * @see #setTime
342+ */
343+ java.sql.Time getTime(int parameterIndex) throws SQLException;
344+
345+ /**
346+ * Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a
347+ * <code>java.sql.Timestamp</code> object.
348+ *
349+ * @param parameterIndex the first parameter is 1, the second is 2,
350+ * and so on
351+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
352+ * is <code>null</code>.
353+ * @exception SQLException if the parameterIndex is not valid;
354+ * if a database access error occurs or
355+ * this method is called on a closed <code>CallableStatement</code>
356+ * @see #setTimestamp
357+ */
358+ java.sql.Timestamp getTimestamp(int parameterIndex)
359+ throws SQLException;
360+
361+ //----------------------------------------------------------------------
362+ // Advanced features:
363+
364+
365+ /**
366+ * Retrieves the value of the designated parameter as an <code>Object</code>
367+ * in the Java programming language. If the value is an SQL <code>NULL</code>,
368+ * the driver returns a Java <code>null</code>.
369+ * <p>
370+ * This method returns a Java object whose type corresponds to the JDBC
371+ * type that was registered for this parameter using the method
372+ * <code>registerOutParameter</code>. By registering the target JDBC
373+ * type as <code>java.sql.Types.OTHER</code>, this method can be used
374+ * to read database-specific abstract data types.
375+ *
376+ * @param parameterIndex the first parameter is 1, the second is 2,
377+ * and so on
378+ * @return A <code>java.lang.Object</code> holding the OUT parameter value
379+ * @exception SQLException if the parameterIndex is not valid;
380+ * if a database access error occurs or
381+ * this method is called on a closed <code>CallableStatement</code>
382+ * @see Types
383+ * @see #setObject
384+ */
385+ Object getObject(int parameterIndex) throws SQLException;
386+
387+
388+ //--------------------------JDBC 2.0-----------------------------
389+
390+ /**
391+ * Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a
392+ * <code>java.math.BigDecimal</code> object with as many digits to the
393+ * right of the decimal point as the value contains.
394+ * @param parameterIndex the first parameter is 1, the second is 2,
395+ * and so on
396+ * @return the parameter value in full precision. If the value is
397+ * SQL <code>NULL</code>, the result is <code>null</code>.
398+ * @exception SQLException if the parameterIndex is not valid;
399+ * if a database access error occurs or
400+ * this method is called on a closed <code>CallableStatement</code>
401+ * @see #setBigDecimal
402+ * @since 1.2
403+ */
404+ BigDecimal getBigDecimal(int parameterIndex) throws SQLException;
405+
406+ /**
407+ * Returns an object representing the value of OUT parameter
408+ * <code>parameterIndex</code> and uses <code>map</code> for the custom
409+ * mapping of the parameter value.
410+ * <p>
411+ * This method returns a Java object whose type corresponds to the
412+ * JDBC type that was registered for this parameter using the method
413+ * <code>registerOutParameter</code>. By registering the target
414+ * JDBC type as <code>java.sql.Types.OTHER</code>, this method can
415+ * be used to read database-specific abstract data types.
416+ * @param parameterIndex the first parameter is 1, the second is 2, and so on
417+ * @param map the mapping from SQL type names to Java classes
418+ * @return a <code>java.lang.Object</code> holding the OUT parameter value
419+ * @exception SQLException if the parameterIndex is not valid;
420+ * if a database access error occurs or
421+ * this method is called on a closed <code>CallableStatement</code>
422+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
423+ * this method
424+ * @see #setObject
425+ * @since 1.2
426+ */
427+ Object getObject(int parameterIndex, java.util.Map<String,Class<?>> map)
428+ throws SQLException;
429+
430+ /**
431+ * Retrieves the value of the designated JDBC <code>REF(&lt;structured-type&gt;)</code>
432+ * parameter as a {@link java.sql.Ref} object in the Java programming language.
433+ * @param parameterIndex the first parameter is 1, the second is 2,
434+ * and so on
435+ * @return the parameter value as a <code>Ref</code> object in the
436+ * Java programming language. If the value was SQL <code>NULL</code>, the value
437+ * <code>null</code> is returned.
438+ * @exception SQLException if the parameterIndex is not valid;
439+ * if a database access error occurs or
440+ * this method is called on a closed <code>CallableStatement</code>
441+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
442+ * this method
443+ * @since 1.2
444+ */
445+ Ref getRef (int parameterIndex) throws SQLException;
446+
447+ /**
448+ * Retrieves the value of the designated JDBC <code>BLOB</code> parameter as a
449+ * {@link java.sql.Blob} object in the Java programming language.
450+ * @param parameterIndex the first parameter is 1, the second is 2, and so on
451+ * @return the parameter value as a <code>Blob</code> object in the
452+ * Java programming language. If the value was SQL <code>NULL</code>, the value
453+ * <code>null</code> is returned.
454+ * @exception SQLException if the parameterIndex is not valid;
455+ * if a database access error occurs or
456+ * this method is called on a closed <code>CallableStatement</code>
457+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
458+ * this method
459+ * @since 1.2
460+ */
461+ Blob getBlob (int parameterIndex) throws SQLException;
462+
463+ /**
464+ * Retrieves the value of the designated JDBC <code>CLOB</code> parameter as a
465+ * <code>java.sql.Clob</code> object in the Java programming language.
466+ * @param parameterIndex the first parameter is 1, the second is 2, and
467+ * so on
468+ * @return the parameter value as a <code>Clob</code> object in the
469+ * Java programming language. If the value was SQL <code>NULL</code>, the
470+ * value <code>null</code> is returned.
471+ * @exception SQLException if the parameterIndex is not valid;
472+ * if a database access error occurs or
473+ * this method is called on a closed <code>CallableStatement</code>
474+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
475+ * this method
476+ * @since 1.2
477+ */
478+ Clob getClob (int parameterIndex) throws SQLException;
479+
480+ /**
481+ *
482+ * Retrieves the value of the designated JDBC <code>ARRAY</code> parameter as an
483+ * {@link java.sql.Array} object in the Java programming language.
484+ * @param parameterIndex the first parameter is 1, the second is 2, and
485+ * so on
486+ * @return the parameter value as an <code>Array</code> object in
487+ * the Java programming language. If the value was SQL <code>NULL</code>, the
488+ * value <code>null</code> is returned.
489+ * @exception SQLException if the parameterIndex is not valid;
490+ * if a database access error occurs or
491+ * this method is called on a closed <code>CallableStatement</code>
492+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
493+ * this method
494+ * @since 1.2
495+ */
496+ Array getArray (int parameterIndex) throws SQLException;
497+
498+ /**
499+ * Retrieves the value of the designated JDBC <code>DATE</code> parameter as a
500+ * <code>java.sql.Date</code> object, using
501+ * the given <code>Calendar</code> object
502+ * to construct the date.
503+ * With a <code>Calendar</code> object, the driver
504+ * can calculate the date taking into account a custom timezone and locale.
505+ * If no <code>Calendar</code> object is specified, the driver uses the
506+ * default timezone and locale.
507+ *
508+ * @param parameterIndex the first parameter is 1, the second is 2,
509+ * and so on
510+ * @param cal the <code>Calendar</code> object the driver will use
511+ * to construct the date
512+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
513+ * is <code>null</code>.
514+ * @exception SQLException if the parameterIndex is not valid;
515+ * if a database access error occurs or
516+ * this method is called on a closed <code>CallableStatement</code>
517+ * @see #setDate
518+ * @since 1.2
519+ */
520+ java.sql.Date getDate(int parameterIndex, Calendar cal)
521+ throws SQLException;
522+
523+ /**
524+ * Retrieves the value of the designated JDBC <code>TIME</code> parameter as a
525+ * <code>java.sql.Time</code> object, using
526+ * the given <code>Calendar</code> object
527+ * to construct the time.
528+ * With a <code>Calendar</code> object, the driver
529+ * can calculate the time taking into account a custom timezone and locale.
530+ * If no <code>Calendar</code> object is specified, the driver uses the
531+ * default timezone and locale.
532+ *
533+ * @param parameterIndex the first parameter is 1, the second is 2,
534+ * and so on
535+ * @param cal the <code>Calendar</code> object the driver will use
536+ * to construct the time
537+ * @return the parameter value; if the value is SQL <code>NULL</code>, the result
538+ * is <code>null</code>.
539+ * @exception SQLException if the parameterIndex is not valid;
540+ * if a database access error occurs or
541+ * this method is called on a closed <code>CallableStatement</code>
542+ * @see #setTime
543+ * @since 1.2
544+ */
545+ java.sql.Time getTime(int parameterIndex, Calendar cal)
546+ throws SQLException;
547+
548+ /**
549+ * Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a
550+ * <code>java.sql.Timestamp</code> object, using
551+ * the given <code>Calendar</code> object to construct
552+ * the <code>Timestamp</code> object.
553+ * With a <code>Calendar</code> object, the driver
554+ * can calculate the timestamp taking into account a custom timezone and locale.
555+ * If no <code>Calendar</code> object is specified, the driver uses the
556+ * default timezone and locale.
557+ *
558+ *
559+ * @param parameterIndex the first parameter is 1, the second is 2,
560+ * and so on
561+ * @param cal the <code>Calendar</code> object the driver will use
562+ * to construct the timestamp
563+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
564+ * is <code>null</code>.
565+ * @exception SQLException if the parameterIndex is not valid;
566+ * if a database access error occurs or
567+ * this method is called on a closed <code>CallableStatement</code>
568+ * @see #setTimestamp
569+ * @since 1.2
570+ */
571+ java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal)
572+ throws SQLException;
573+
574+
575+ /**
576+ * Registers the designated output parameter.
577+ * This version of
578+ * the method <code>registerOutParameter</code>
579+ * should be used for a user-defined or <code>REF</code> output parameter. Examples
580+ * of user-defined types include: <code>STRUCT</code>, <code>DISTINCT</code>,
581+ * <code>JAVA_OBJECT</code>, and named array types.
582+ *<p>
583+ * All OUT parameters must be registered
584+ * before a stored procedure is executed.
585+ * <p> For a user-defined parameter, the fully-qualified SQL
586+ * type name of the parameter should also be given, while a <code>REF</code>
587+ * parameter requires that the fully-qualified type name of the
588+ * referenced type be given. A JDBC driver that does not need the
589+ * type code and type name information may ignore it. To be portable,
590+ * however, applications should always provide these values for
591+ * user-defined and <code>REF</code> parameters.
592+ *
593+ * Although it is intended for user-defined and <code>REF</code> parameters,
594+ * this method may be used to register a parameter of any JDBC type.
595+ * If the parameter does not have a user-defined or <code>REF</code> type, the
596+ * <i>typeName</i> parameter is ignored.
597+ *
598+ * <P><B>Note:</B> When reading the value of an out parameter, you
599+ * must use the getter method whose Java type corresponds to the
600+ * parameter's registered SQL type.
601+ *
602+ * @param parameterIndex the first parameter is 1, the second is 2,...
603+ * @param sqlType a value from {@link java.sql.Types}
604+ * @param typeName the fully-qualified name of an SQL structured type
605+ * @exception SQLException if the parameterIndex is not valid;
606+ * if a database access error occurs or
607+ * this method is called on a closed <code>CallableStatement</code>
608+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
609+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
610+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
611+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
612+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
613+ * or <code>STRUCT</code> data type and the JDBC driver does not support
614+ * this data type
615+ * @see Types
616+ * @since 1.2
617+ */
618+ void registerOutParameter (int parameterIndex, int sqlType, String typeName)
619+ throws SQLException;
620+
621+ //--------------------------JDBC 3.0-----------------------------
622+
623+ /**
624+ * Registers the OUT parameter named
625+ * <code>parameterName</code> to the JDBC type
626+ * <code>sqlType</code>. All OUT parameters must be registered
627+ * before a stored procedure is executed.
628+ * <p>
629+ * The JDBC type specified by <code>sqlType</code> for an OUT
630+ * parameter determines the Java type that must be used
631+ * in the <code>get</code> method to read the value of that parameter.
632+ * <p>
633+ * If the JDBC type expected to be returned to this output parameter
634+ * is specific to this particular database, <code>sqlType</code>
635+ * should be <code>java.sql.Types.OTHER</code>. The method
636+ * {@link #getObject} retrieves the value.
637+ * @param parameterName the name of the parameter
638+ * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.
639+ * If the parameter is of JDBC type <code>NUMERIC</code>
640+ * or <code>DECIMAL</code>, the version of
641+ * <code>registerOutParameter</code> that accepts a scale value
642+ * should be used.
643+ * @exception SQLException if parameterName does not correspond to a named
644+ * parameter; if a database access error occurs or
645+ * this method is called on a closed <code>CallableStatement</code>
646+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
647+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
648+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
649+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
650+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
651+ * or <code>STRUCT</code> data type and the JDBC driver does not support
652+ * this data type or if the JDBC driver does not support
653+ * this method
654+ * @since 1.4
655+ * @see Types
656+ */
657+ void registerOutParameter(String parameterName, int sqlType)
658+ throws SQLException;
659+
660+ /**
661+ * Registers the parameter named
662+ * <code>parameterName</code> to be of JDBC type
663+ * <code>sqlType</code>. All OUT parameters must be registered
664+ * before a stored procedure is executed.
665+ * <p>
666+ * The JDBC type specified by <code>sqlType</code> for an OUT
667+ * parameter determines the Java type that must be used
668+ * in the <code>get</code> method to read the value of that parameter.
669+ * <p>
670+ * This version of <code>registerOutParameter</code> should be
671+ * used when the parameter is of JDBC type <code>NUMERIC</code>
672+ * or <code>DECIMAL</code>.
673+ *
674+ * @param parameterName the name of the parameter
675+ * @param sqlType SQL type code defined by <code>java.sql.Types</code>.
676+ * @param scale the desired number of digits to the right of the
677+ * decimal point. It must be greater than or equal to zero.
678+ * @exception SQLException if parameterName does not correspond to a named
679+ * parameter; if a database access error occurs or
680+ * this method is called on a closed <code>CallableStatement</code>
681+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
682+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
683+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
684+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
685+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
686+ * or <code>STRUCT</code> data type and the JDBC driver does not support
687+ * this data type or if the JDBC driver does not support
688+ * this method
689+ * @since 1.4
690+ * @see Types
691+ */
692+ void registerOutParameter(String parameterName, int sqlType, int scale)
693+ throws SQLException;
694+
695+ /**
696+ * Registers the designated output parameter. This version of
697+ * the method <code>registerOutParameter</code>
698+ * should be used for a user-named or REF output parameter. Examples
699+ * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
700+ * named array types.
701+ *<p>
702+ * All OUT parameters must be registered
703+ * before a stored procedure is executed.
704+ * <p>
705+ * For a user-named parameter the fully-qualified SQL
706+ * type name of the parameter should also be given, while a REF
707+ * parameter requires that the fully-qualified type name of the
708+ * referenced type be given. A JDBC driver that does not need the
709+ * type code and type name information may ignore it. To be portable,
710+ * however, applications should always provide these values for
711+ * user-named and REF parameters.
712+ *
713+ * Although it is intended for user-named and REF parameters,
714+ * this method may be used to register a parameter of any JDBC type.
715+ * If the parameter does not have a user-named or REF type, the
716+ * typeName parameter is ignored.
717+ *
718+ * <P><B>Note:</B> When reading the value of an out parameter, you
719+ * must use the <code>getXXX</code> method whose Java type XXX corresponds to the
720+ * parameter's registered SQL type.
721+ *
722+ * @param parameterName the name of the parameter
723+ * @param sqlType a value from {@link java.sql.Types}
724+ * @param typeName the fully-qualified name of an SQL structured type
725+ * @exception SQLException if parameterName does not correspond to a named
726+ * parameter; if a database access error occurs or
727+ * this method is called on a closed <code>CallableStatement</code>
728+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
729+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
730+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
731+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
732+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
733+ * or <code>STRUCT</code> data type and the JDBC driver does not support
734+ * this data type or if the JDBC driver does not support
735+ * this method
736+ * @see Types
737+ * @since 1.4
738+ */
739+ void registerOutParameter (String parameterName, int sqlType, String typeName)
740+ throws SQLException;
741+
742+ /**
743+ * Retrieves the value of the designated JDBC <code>DATALINK</code> parameter as a
744+ * <code>java.net.URL</code> object.
745+ *
746+ * @param parameterIndex the first parameter is 1, the second is 2,...
747+ * @return a <code>java.net.URL</code> object that represents the
748+ * JDBC <code>DATALINK</code> value used as the designated
749+ * parameter
750+ * @exception SQLException if the parameterIndex is not valid;
751+ * if a database access error occurs,
752+ * this method is called on a closed <code>CallableStatement</code>,
753+ * or if the URL being returned is
754+ * not a valid URL on the Java platform
755+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
756+ * this method
757+ * @see #setURL
758+ * @since 1.4
759+ */
760+ java.net.URL getURL(int parameterIndex) throws SQLException;
761+
762+ /**
763+ * Sets the designated parameter to the given <code>java.net.URL</code> object.
764+ * The driver converts this to an SQL <code>DATALINK</code> value when
765+ * it sends it to the database.
766+ *
767+ * @param parameterName the name of the parameter
768+ * @param val the parameter value
769+ * @exception SQLException if parameterName does not correspond to a named
770+ * parameter; if a database access error occurs;
771+ * this method is called on a closed <code>CallableStatement</code>
772+ * or if a URL is malformed
773+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
774+ * this method
775+ * @see #getURL
776+ * @since 1.4
777+ */
778+ void setURL(String parameterName, java.net.URL val) throws SQLException;
779+
780+ /**
781+ * Sets the designated parameter to SQL <code>NULL</code>.
782+ *
783+ * <P><B>Note:</B> You must specify the parameter's SQL type.
784+ *
785+ * @param parameterName the name of the parameter
786+ * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
787+ * @exception SQLException if parameterName does not correspond to a named
788+ * parameter; if a database access error occurs or
789+ * this method is called on a closed <code>CallableStatement</code>
790+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
791+ * this method
792+ * @since 1.4
793+ */
794+ void setNull(String parameterName, int sqlType) throws SQLException;
795+
796+ /**
797+ * Sets the designated parameter to the given Java <code>boolean</code> value.
798+ * The driver converts this
799+ * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.
800+ *
801+ * @param parameterName the name of the parameter
802+ * @param x the parameter value
803+ * @exception SQLException if parameterName does not correspond to a named
804+ * parameter; if a database access error occurs or
805+ * this method is called on a closed <code>CallableStatement</code>
806+ * @see #getBoolean
807+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
808+ * this method
809+ * @since 1.4
810+ */
811+ void setBoolean(String parameterName, boolean x) throws SQLException;
812+
813+ /**
814+ * Sets the designated parameter to the given Java <code>byte</code> value.
815+ * The driver converts this
816+ * to an SQL <code>TINYINT</code> value when it sends it to the database.
817+ *
818+ * @param parameterName the name of the parameter
819+ * @param x the parameter value
820+ * @exception SQLException if parameterName does not correspond to a named
821+ * parameter; if a database access error occurs or
822+ * this method is called on a closed <code>CallableStatement</code>
823+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
824+ * this method
825+ * @see #getByte
826+ * @since 1.4
827+ */
828+ void setByte(String parameterName, byte x) throws SQLException;
829+
830+ /**
831+ * Sets the designated parameter to the given Java <code>short</code> value.
832+ * The driver converts this
833+ * to an SQL <code>SMALLINT</code> value when it sends it to the database.
834+ *
835+ * @param parameterName the name of the parameter
836+ * @param x the parameter value
837+ * @exception SQLException if parameterName does not correspond to a named
838+ * parameter; if a database access error occurs or
839+ * this method is called on a closed <code>CallableStatement</code>
840+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
841+ * this method
842+ * @see #getShort
843+ * @since 1.4
844+ */
845+ void setShort(String parameterName, short x) throws SQLException;
846+
847+ /**
848+ * Sets the designated parameter to the given Java <code>int</code> value.
849+ * The driver converts this
850+ * to an SQL <code>INTEGER</code> value when it sends it to the database.
851+ *
852+ * @param parameterName the name of the parameter
853+ * @param x the parameter value
854+ * @exception SQLException if parameterName does not correspond to a named
855+ * parameter; if a database access error occurs or
856+ * this method is called on a closed <code>CallableStatement</code>
857+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
858+ * this method
859+ * @see #getInt
860+ * @since 1.4
861+ */
862+ void setInt(String parameterName, int x) throws SQLException;
863+
864+ /**
865+ * Sets the designated parameter to the given Java <code>long</code> value.
866+ * The driver converts this
867+ * to an SQL <code>BIGINT</code> value when it sends it to the database.
868+ *
869+ * @param parameterName the name of the parameter
870+ * @param x the parameter value
871+ * @exception SQLException if parameterName does not correspond to a named
872+ * parameter; if a database access error occurs or
873+ * this method is called on a closed <code>CallableStatement</code>
874+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
875+ * this method
876+ * @see #getLong
877+ * @since 1.4
878+ */
879+ void setLong(String parameterName, long x) throws SQLException;
880+
881+ /**
882+ * Sets the designated parameter to the given Java <code>float</code> value.
883+ * The driver converts this
884+ * to an SQL <code>FLOAT</code> value when it sends it to the database.
885+ *
886+ * @param parameterName the name of the parameter
887+ * @param x the parameter value
888+ * @exception SQLException if parameterName does not correspond to a named
889+ * parameter; if a database access error occurs or
890+ * this method is called on a closed <code>CallableStatement</code>
891+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
892+ * this method
893+ * @see #getFloat
894+ * @since 1.4
895+ */
896+ void setFloat(String parameterName, float x) throws SQLException;
897+
898+ /**
899+ * Sets the designated parameter to the given Java <code>double</code> value.
900+ * The driver converts this
901+ * to an SQL <code>DOUBLE</code> value when it sends it to the database.
902+ *
903+ * @param parameterName the name of the parameter
904+ * @param x the parameter value
905+ * @exception SQLException if parameterName does not correspond to a named
906+ * parameter; if a database access error occurs or
907+ * this method is called on a closed <code>CallableStatement</code>
908+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
909+ * this method
910+ * @see #getDouble
911+ * @since 1.4
912+ */
913+ void setDouble(String parameterName, double x) throws SQLException;
914+
915+ /**
916+ * Sets the designated parameter to the given
917+ * <code>java.math.BigDecimal</code> value.
918+ * The driver converts this to an SQL <code>NUMERIC</code> value when
919+ * it sends it to the database.
920+ *
921+ * @param parameterName the name of the parameter
922+ * @param x the parameter value
923+ * @exception SQLException if parameterName does not correspond to a named
924+ * parameter; if a database access error occurs or
925+ * this method is called on a closed <code>CallableStatement</code>
926+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
927+ * this method
928+ * @see #getBigDecimal
929+ * @since 1.4
930+ */
931+ void setBigDecimal(String parameterName, BigDecimal x) throws SQLException;
932+
933+ /**
934+ * Sets the designated parameter to the given Java <code>String</code> value.
935+ * The driver converts this
936+ * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
937+ * (depending on the argument's
938+ * size relative to the driver's limits on <code>VARCHAR</code> values)
939+ * when it sends it to the database.
940+ *
941+ * @param parameterName the name of the parameter
942+ * @param x the parameter value
943+ * @exception SQLException if parameterName does not correspond to a named
944+ * parameter; if a database access error occurs or
945+ * this method is called on a closed <code>CallableStatement</code>
946+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
947+ * this method
948+ * @see #getString
949+ * @since 1.4
950+ */
951+ void setString(String parameterName, String x) throws SQLException;
952+
953+ /**
954+ * Sets the designated parameter to the given Java array of bytes.
955+ * The driver converts this to an SQL <code>VARBINARY</code> or
956+ * <code>LONGVARBINARY</code> (depending on the argument's size relative
957+ * to the driver's limits on <code>VARBINARY</code> values) when it sends
958+ * it to the database.
959+ *
960+ * @param parameterName the name of the parameter
961+ * @param x the parameter value
962+ * @exception SQLException if parameterName does not correspond to a named
963+ * parameter; if a database access error occurs or
964+ * this method is called on a closed <code>CallableStatement</code>
965+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
966+ * this method
967+ * @see #getBytes
968+ * @since 1.4
969+ */
970+ void setBytes(String parameterName, byte x[]) throws SQLException;
971+
972+ /**
973+ * Sets the designated parameter to the given <code>java.sql.Date</code> value
974+ * using the default time zone of the virtual machine that is running
975+ * the application.
976+ * The driver converts this
977+ * to an SQL <code>DATE</code> value when it sends it to the database.
978+ *
979+ * @param parameterName the name of the parameter
980+ * @param x the parameter value
981+ * @exception SQLException if parameterName does not correspond to a named
982+ * parameter; if a database access error occurs or
983+ * this method is called on a closed <code>CallableStatement</code>
984+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
985+ * this method
986+ * @see #getDate
987+ * @since 1.4
988+ */
989+ void setDate(String parameterName, java.sql.Date x)
990+ throws SQLException;
991+
992+ /**
993+ * Sets the designated parameter to the given <code>java.sql.Time</code> value.
994+ * The driver converts this
995+ * to an SQL <code>TIME</code> value when it sends it to the database.
996+ *
997+ * @param parameterName the name of the parameter
998+ * @param x the parameter value
999+ * @exception SQLException if parameterName does not correspond to a named
1000+ * parameter; if a database access error occurs or
1001+ * this method is called on a closed <code>CallableStatement</code>
1002+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1003+ * this method
1004+ * @see #getTime
1005+ * @since 1.4
1006+ */
1007+ void setTime(String parameterName, java.sql.Time x)
1008+ throws SQLException;
1009+
1010+ /**
1011+ * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
1012+ * The driver
1013+ * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
1014+ * database.
1015+ *
1016+ * @param parameterName the name of the parameter
1017+ * @param x the parameter value
1018+ * @exception SQLException if parameterName does not correspond to a named
1019+ * parameter; if a database access error occurs or
1020+ * this method is called on a closed <code>CallableStatement</code>
1021+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1022+ * this method
1023+ * @see #getTimestamp
1024+ * @since 1.4
1025+ */
1026+ void setTimestamp(String parameterName, java.sql.Timestamp x)
1027+ throws SQLException;
1028+
1029+ /**
1030+ * Sets the designated parameter to the given input stream, which will have
1031+ * the specified number of bytes.
1032+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
1033+ * parameter, it may be more practical to send it via a
1034+ * <code>java.io.InputStream</code>. Data will be read from the stream
1035+ * as needed until end-of-file is reached. The JDBC driver will
1036+ * do any necessary conversion from ASCII to the database char format.
1037+ *
1038+ * <P><B>Note:</B> This stream object can either be a standard
1039+ * Java stream object or your own subclass that implements the
1040+ * standard interface.
1041+ *
1042+ * @param parameterName the name of the parameter
1043+ * @param x the Java input stream that contains the ASCII parameter value
1044+ * @param length the number of bytes in the stream
1045+ * @exception SQLException if parameterName does not correspond to a named
1046+ * parameter; if a database access error occurs or
1047+ * this method is called on a closed <code>CallableStatement</code>
1048+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1049+ * this method
1050+ * @since 1.4
1051+ */
1052+ void setAsciiStream(String parameterName, java.io.InputStream x, int length)
1053+ throws SQLException;
1054+
1055+ /**
1056+ * Sets the designated parameter to the given input stream, which will have
1057+ * the specified number of bytes.
1058+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
1059+ * parameter, it may be more practical to send it via a
1060+ * <code>java.io.InputStream</code> object. The data will be read from the stream
1061+ * as needed until end-of-file is reached.
1062+ *
1063+ * <P><B>Note:</B> This stream object can either be a standard
1064+ * Java stream object or your own subclass that implements the
1065+ * standard interface.
1066+ *
1067+ * @param parameterName the name of the parameter
1068+ * @param x the java input stream which contains the binary parameter value
1069+ * @param length the number of bytes in the stream
1070+ * @exception SQLException if parameterName does not correspond to a named
1071+ * parameter; if a database access error occurs or
1072+ * this method is called on a closed <code>CallableStatement</code>
1073+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1074+ * this method
1075+ * @since 1.4
1076+ */
1077+ void setBinaryStream(String parameterName, java.io.InputStream x,
1078+ int length) throws SQLException;
1079+
1080+ /**
1081+ * Sets the value of the designated parameter with the given object. The second
1082+ * argument must be an object type; for integral values, the
1083+ * <code>java.lang</code> equivalent objects should be used.
1084+ *
1085+ * <p>The given Java object will be converted to the given targetSqlType
1086+ * before being sent to the database.
1087+ *
1088+ * If the object has a custom mapping (is of a class implementing the
1089+ * interface <code>SQLData</code>),
1090+ * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it
1091+ * to the SQL data stream.
1092+ * If, on the other hand, the object is of a class implementing
1093+ * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
1094+ * <code>Struct</code>, <code>java.net.URL</code>,
1095+ * or <code>Array</code>, the driver should pass it to the database as a
1096+ * value of the corresponding SQL type.
1097+ * <P>
1098+ * Note that this method may be used to pass datatabase-
1099+ * specific abstract data types.
1100+ *
1101+ * @param parameterName the name of the parameter
1102+ * @param x the object containing the input parameter value
1103+ * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
1104+ * sent to the database. The scale argument may further qualify this type.
1105+ * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
1106+ * this is the number of digits after the decimal point. For all other
1107+ * types, this value will be ignored.
1108+ * @exception SQLException if parameterName does not correspond to a named
1109+ * parameter; if a database access error occurs or
1110+ * this method is called on a closed <code>CallableStatement</code>
1111+ * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
1112+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
1113+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
1114+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
1115+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
1116+ * or <code>STRUCT</code> data type and the JDBC driver does not support
1117+ * this data type
1118+ * @see Types
1119+ * @see #getObject
1120+ * @since 1.4
1121+ */
1122+ void setObject(String parameterName, Object x, int targetSqlType, int scale)
1123+ throws SQLException;
1124+
1125+ /**
1126+ * Sets the value of the designated parameter with the given object.
1127+ * This method is like the method <code>setObject</code>
1128+ * above, except that it assumes a scale of zero.
1129+ *
1130+ * @param parameterName the name of the parameter
1131+ * @param x the object containing the input parameter value
1132+ * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
1133+ * sent to the database
1134+ * @exception SQLException if parameterName does not correspond to a named
1135+ * parameter; if a database access error occurs or
1136+ * this method is called on a closed <code>CallableStatement</code>
1137+ * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
1138+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
1139+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
1140+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
1141+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
1142+ * or <code>STRUCT</code> data type and the JDBC driver does not support
1143+ * this data type
1144+ * @see #getObject
1145+ * @since 1.4
1146+ */
1147+ void setObject(String parameterName, Object x, int targetSqlType)
1148+ throws SQLException;
1149+
1150+ /**
1151+ * Sets the value of the designated parameter with the given object.
1152+ * The second parameter must be of type <code>Object</code>; therefore, the
1153+ * <code>java.lang</code> equivalent objects should be used for built-in types.
1154+ *
1155+ * <p>The JDBC specification specifies a standard mapping from
1156+ * Java <code>Object</code> types to SQL types. The given argument
1157+ * will be converted to the corresponding SQL type before being
1158+ * sent to the database.
1159+ * <p>Note that this method may be used to pass datatabase-
1160+ * specific abstract data types, by using a driver-specific Java
1161+ * type.
1162+ *
1163+ * If the object is of a class implementing the interface <code>SQLData</code>,
1164+ * the JDBC driver should call the method <code>SQLData.writeSQL</code>
1165+ * to write it to the SQL data stream.
1166+ * If, on the other hand, the object is of a class implementing
1167+ * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
1168+ * <code>Struct</code>, <code>java.net.URL</code>,
1169+ * or <code>Array</code>, the driver should pass it to the database as a
1170+ * value of the corresponding SQL type.
1171+ * <P>
1172+ * This method throws an exception if there is an ambiguity, for example, if the
1173+ * object is of a class implementing more than one of the interfaces named above.
1174+ *<p>
1175+ *<b>Note:</b> Not all databases allow for a non-typed Null to be sent to
1176+ * the backend. For maximum portability, the <code>setNull</code> or the
1177+ * <code>setObject(String parameterName, Object x, int sqlType)</code>
1178+ * method should be used
1179+ * instead of <code>setObject(String parameterName, Object x)</code>.
1180+ *<p>
1181+ * @param parameterName the name of the parameter
1182+ * @param x the object containing the input parameter value
1183+ * @exception SQLException if parameterName does not correspond to a named
1184+ * parameter; if a database access error occurs,
1185+ * this method is called on a closed <code>CallableStatement</code> or if the given
1186+ * <code>Object</code> parameter is ambiguous
1187+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1188+ * this method
1189+ * @see #getObject
1190+ * @since 1.4
1191+ */
1192+ void setObject(String parameterName, Object x) throws SQLException;
1193+
1194+
1195+ /**
1196+ * Sets the designated parameter to the given <code>Reader</code>
1197+ * object, which is the given number of characters long.
1198+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
1199+ * parameter, it may be more practical to send it via a
1200+ * <code>java.io.Reader</code> object. The data will be read from the stream
1201+ * as needed until end-of-file is reached. The JDBC driver will
1202+ * do any necessary conversion from UNICODE to the database char format.
1203+ *
1204+ * <P><B>Note:</B> This stream object can either be a standard
1205+ * Java stream object or your own subclass that implements the
1206+ * standard interface.
1207+ *
1208+ * @param parameterName the name of the parameter
1209+ * @param reader the <code>java.io.Reader</code> object that
1210+ * contains the UNICODE data used as the designated parameter
1211+ * @param length the number of characters in the stream
1212+ * @exception SQLException if parameterName does not correspond to a named
1213+ * parameter; if a database access error occurs or
1214+ * this method is called on a closed <code>CallableStatement</code>
1215+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1216+ * this method
1217+ * @since 1.4
1218+ */
1219+ void setCharacterStream(String parameterName,
1220+ java.io.Reader reader,
1221+ int length) throws SQLException;
1222+
1223+ /**
1224+ * Sets the designated parameter to the given <code>java.sql.Date</code> value,
1225+ * using the given <code>Calendar</code> object. The driver uses
1226+ * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
1227+ * which the driver then sends to the database. With a
1228+ * a <code>Calendar</code> object, the driver can calculate the date
1229+ * taking into account a custom timezone. If no
1230+ * <code>Calendar</code> object is specified, the driver uses the default
1231+ * timezone, which is that of the virtual machine running the application.
1232+ *
1233+ * @param parameterName the name of the parameter
1234+ * @param x the parameter value
1235+ * @param cal the <code>Calendar</code> object the driver will use
1236+ * to construct the date
1237+ * @exception SQLException if parameterName does not correspond to a named
1238+ * parameter; if a database access error occurs or
1239+ * this method is called on a closed <code>CallableStatement</code>
1240+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1241+ * this method
1242+ * @see #getDate
1243+ * @since 1.4
1244+ */
1245+ void setDate(String parameterName, java.sql.Date x, Calendar cal)
1246+ throws SQLException;
1247+
1248+ /**
1249+ * Sets the designated parameter to the given <code>java.sql.Time</code> value,
1250+ * using the given <code>Calendar</code> object. The driver uses
1251+ * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
1252+ * which the driver then sends to the database. With a
1253+ * a <code>Calendar</code> object, the driver can calculate the time
1254+ * taking into account a custom timezone. If no
1255+ * <code>Calendar</code> object is specified, the driver uses the default
1256+ * timezone, which is that of the virtual machine running the application.
1257+ *
1258+ * @param parameterName the name of the parameter
1259+ * @param x the parameter value
1260+ * @param cal the <code>Calendar</code> object the driver will use
1261+ * to construct the time
1262+ * @exception SQLException if parameterName does not correspond to a named
1263+ * parameter; if a database access error occurs or
1264+ * this method is called on a closed <code>CallableStatement</code>
1265+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1266+ * this method
1267+ * @see #getTime
1268+ * @since 1.4
1269+ */
1270+ void setTime(String parameterName, java.sql.Time x, Calendar cal)
1271+ throws SQLException;
1272+
1273+ /**
1274+ * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
1275+ * using the given <code>Calendar</code> object. The driver uses
1276+ * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
1277+ * which the driver then sends to the database. With a
1278+ * a <code>Calendar</code> object, the driver can calculate the timestamp
1279+ * taking into account a custom timezone. If no
1280+ * <code>Calendar</code> object is specified, the driver uses the default
1281+ * timezone, which is that of the virtual machine running the application.
1282+ *
1283+ * @param parameterName the name of the parameter
1284+ * @param x the parameter value
1285+ * @param cal the <code>Calendar</code> object the driver will use
1286+ * to construct the timestamp
1287+ * @exception SQLException if parameterName does not correspond to a named
1288+ * parameter; if a database access error occurs or
1289+ * this method is called on a closed <code>CallableStatement</code>
1290+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1291+ * this method
1292+ * @see #getTimestamp
1293+ * @since 1.4
1294+ */
1295+ void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)
1296+ throws SQLException;
1297+
1298+ /**
1299+ * Sets the designated parameter to SQL <code>NULL</code>.
1300+ * This version of the method <code>setNull</code> should
1301+ * be used for user-defined types and REF type parameters. Examples
1302+ * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
1303+ * named array types.
1304+ *
1305+ * <P><B>Note:</B> To be portable, applications must give the
1306+ * SQL type code and the fully-qualified SQL type name when specifying
1307+ * a NULL user-defined or REF parameter. In the case of a user-defined type
1308+ * the name is the type name of the parameter itself. For a REF
1309+ * parameter, the name is the type name of the referenced type.
1310+ * <p>
1311+ * Although it is intended for user-defined and Ref parameters,
1312+ * this method may be used to set a null parameter of any JDBC type.
1313+ * If the parameter does not have a user-defined or REF type, the given
1314+ * typeName is ignored.
1315+ *
1316+ *
1317+ * @param parameterName the name of the parameter
1318+ * @param sqlType a value from <code>java.sql.Types</code>
1319+ * @param typeName the fully-qualified name of an SQL user-defined type;
1320+ * ignored if the parameter is not a user-defined type or
1321+ * SQL <code>REF</code> value
1322+ * @exception SQLException if parameterName does not correspond to a named
1323+ * parameter; if a database access error occurs or
1324+ * this method is called on a closed <code>CallableStatement</code>
1325+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1326+ * this method
1327+ * @since 1.4
1328+ */
1329+ void setNull (String parameterName, int sqlType, String typeName)
1330+ throws SQLException;
1331+
1332+ /**
1333+ * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>,
1334+ * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in
1335+ * the Java programming language.
1336+ * <p>
1337+ * For the fixed-length type JDBC <code>CHAR</code>,
1338+ * the <code>String</code> object
1339+ * returned has exactly the same value the SQL
1340+ * <code>CHAR</code> value had in the
1341+ * database, including any padding added by the database.
1342+ * @param parameterName the name of the parameter
1343+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1344+ * is <code>null</code>.
1345+ * @exception SQLException if parameterName does not correspond to a named
1346+ * parameter; if a database access error occurs or
1347+ * this method is called on a closed <code>CallableStatement</code>
1348+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1349+ * this method
1350+ * @see #setString
1351+ * @since 1.4
1352+ */
1353+ String getString(String parameterName) throws SQLException;
1354+
1355+ /**
1356+ * Retrieves the value of a JDBC <code>BIT</code> or <code>BOOLEAN</code>
1357+ * parameter as a
1358+ * <code>boolean</code> in the Java programming language.
1359+ * @param parameterName the name of the parameter
1360+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1361+ * is <code>false</code>.
1362+ * @exception SQLException if parameterName does not correspond to a named
1363+ * parameter; if a database access error occurs or
1364+ * this method is called on a closed <code>CallableStatement</code>
1365+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1366+ * this method
1367+ * @see #setBoolean
1368+ * @since 1.4
1369+ */
1370+ boolean getBoolean(String parameterName) throws SQLException;
1371+
1372+ /**
1373+ * Retrieves the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code>
1374+ * in the Java programming language.
1375+ * @param parameterName the name of the parameter
1376+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1377+ * is <code>0</code>.
1378+ * @exception SQLException if parameterName does not correspond to a named
1379+ * parameter; if a database access error occurs or
1380+ * this method is called on a closed <code>CallableStatement</code>
1381+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1382+ * this method
1383+ * @see #setByte
1384+ * @since 1.4
1385+ */
1386+ byte getByte(String parameterName) throws SQLException;
1387+
1388+ /**
1389+ * Retrieves the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code>
1390+ * in the Java programming language.
1391+ * @param parameterName the name of the parameter
1392+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1393+ * is <code>0</code>.
1394+ * @exception SQLException if parameterName does not correspond to a named
1395+ * parameter; if a database access error occurs or
1396+ * this method is called on a closed <code>CallableStatement</code>
1397+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1398+ * this method
1399+ * @see #setShort
1400+ * @since 1.4
1401+ */
1402+ short getShort(String parameterName) throws SQLException;
1403+
1404+ /**
1405+ * Retrieves the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code>
1406+ * in the Java programming language.
1407+ *
1408+ * @param parameterName the name of the parameter
1409+ * @return the parameter value. If the value is SQL <code>NULL</code>,
1410+ * the result is <code>0</code>.
1411+ * @exception SQLException if parameterName does not correspond to a named
1412+ * parameter; if a database access error occurs or
1413+ * this method is called on a closed <code>CallableStatement</code>
1414+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1415+ * this method
1416+ * @see #setInt
1417+ * @since 1.4
1418+ */
1419+ int getInt(String parameterName) throws SQLException;
1420+
1421+ /**
1422+ * Retrieves the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code>
1423+ * in the Java programming language.
1424+ *
1425+ * @param parameterName the name of the parameter
1426+ * @return the parameter value. If the value is SQL <code>NULL</code>,
1427+ * the result is <code>0</code>.
1428+ * @exception SQLException if parameterName does not correspond to a named
1429+ * parameter; if a database access error occurs or
1430+ * this method is called on a closed <code>CallableStatement</code>
1431+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1432+ * this method
1433+ * @see #setLong
1434+ * @since 1.4
1435+ */
1436+ long getLong(String parameterName) throws SQLException;
1437+
1438+ /**
1439+ * Retrieves the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code>
1440+ * in the Java programming language.
1441+ * @param parameterName the name of the parameter
1442+ * @return the parameter value. If the value is SQL <code>NULL</code>,
1443+ * the result is <code>0</code>.
1444+ * @exception SQLException if parameterName does not correspond to a named
1445+ * parameter; if a database access error occurs or
1446+ * this method is called on a closed <code>CallableStatement</code>
1447+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1448+ * this method
1449+ * @see #setFloat
1450+ * @since 1.4
1451+ */
1452+ float getFloat(String parameterName) throws SQLException;
1453+
1454+ /**
1455+ * Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code>
1456+ * in the Java programming language.
1457+ * @param parameterName the name of the parameter
1458+ * @return the parameter value. If the value is SQL <code>NULL</code>,
1459+ * the result is <code>0</code>.
1460+ * @exception SQLException if parameterName does not correspond to a named
1461+ * parameter; if a database access error occurs or
1462+ * this method is called on a closed <code>CallableStatement</code>
1463+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1464+ * this method
1465+ * @see #setDouble
1466+ * @since 1.4
1467+ */
1468+ double getDouble(String parameterName) throws SQLException;
1469+
1470+ /**
1471+ * Retrieves the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code>
1472+ * parameter as an array of <code>byte</code> values in the Java
1473+ * programming language.
1474+ * @param parameterName the name of the parameter
1475+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result is
1476+ * <code>null</code>.
1477+ * @exception SQLException if parameterName does not correspond to a named
1478+ * parameter; if a database access error occurs or
1479+ * this method is called on a closed <code>CallableStatement</code>
1480+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1481+ * this method
1482+ * @see #setBytes
1483+ * @since 1.4
1484+ */
1485+ byte[] getBytes(String parameterName) throws SQLException;
1486+
1487+ /**
1488+ * Retrieves the value of a JDBC <code>DATE</code> parameter as a
1489+ * <code>java.sql.Date</code> object.
1490+ * @param parameterName the name of the parameter
1491+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1492+ * is <code>null</code>.
1493+ * @exception SQLException if parameterName does not correspond to a named
1494+ * parameter; if a database access error occurs or
1495+ * this method is called on a closed <code>CallableStatement</code>
1496+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1497+ * this method
1498+ * @see #setDate
1499+ * @since 1.4
1500+ */
1501+ java.sql.Date getDate(String parameterName) throws SQLException;
1502+
1503+ /**
1504+ * Retrieves the value of a JDBC <code>TIME</code> parameter as a
1505+ * <code>java.sql.Time</code> object.
1506+ * @param parameterName the name of the parameter
1507+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1508+ * is <code>null</code>.
1509+ * @exception SQLException if parameterName does not correspond to a named
1510+ * parameter; if a database access error occurs or
1511+ * this method is called on a closed <code>CallableStatement</code>
1512+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1513+ * this method
1514+ * @see #setTime
1515+ * @since 1.4
1516+ */
1517+ java.sql.Time getTime(String parameterName) throws SQLException;
1518+
1519+ /**
1520+ * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a
1521+ * <code>java.sql.Timestamp</code> object.
1522+ * @param parameterName the name of the parameter
1523+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result
1524+ * is <code>null</code>.
1525+ * @exception SQLException if parameterName does not correspond to a named
1526+ * parameter; if a database access error occurs or
1527+ * this method is called on a closed <code>CallableStatement</code>
1528+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1529+ * this method
1530+ * @see #setTimestamp
1531+ * @since 1.4
1532+ */
1533+ java.sql.Timestamp getTimestamp(String parameterName) throws SQLException;
1534+
1535+ /**
1536+ * Retrieves the value of a parameter as an <code>Object</code> in the Java
1537+ * programming language. If the value is an SQL <code>NULL</code>, the
1538+ * driver returns a Java <code>null</code>.
1539+ * <p>
1540+ * This method returns a Java object whose type corresponds to the JDBC
1541+ * type that was registered for this parameter using the method
1542+ * <code>registerOutParameter</code>. By registering the target JDBC
1543+ * type as <code>java.sql.Types.OTHER</code>, this method can be used
1544+ * to read database-specific abstract data types.
1545+ * @param parameterName the name of the parameter
1546+ * @return A <code>java.lang.Object</code> holding the OUT parameter value.
1547+ * @exception SQLException if parameterName does not correspond to a named
1548+ * parameter; if a database access error occurs or
1549+ * this method is called on a closed <code>CallableStatement</code>
1550+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1551+ * this method
1552+ * @see Types
1553+ * @see #setObject
1554+ * @since 1.4
1555+ */
1556+ Object getObject(String parameterName) throws SQLException;
1557+
1558+ /**
1559+ * Retrieves the value of a JDBC <code>NUMERIC</code> parameter as a
1560+ * <code>java.math.BigDecimal</code> object with as many digits to the
1561+ * right of the decimal point as the value contains.
1562+ * @param parameterName the name of the parameter
1563+ * @return the parameter value in full precision. If the value is
1564+ * SQL <code>NULL</code>, the result is <code>null</code>.
1565+ * @exception SQLExceptionif parameterName does not correspond to a named
1566+ * parameter; if a database access error occurs or
1567+ * this method is called on a closed <code>CallableStatement</code>
1568+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1569+ * this method
1570+ * @see #setBigDecimal
1571+ * @since 1.4
1572+ */
1573+ BigDecimal getBigDecimal(String parameterName) throws SQLException;
1574+
1575+ /**
1576+ * Returns an object representing the value of OUT parameter
1577+ * <code>parameterName</code> and uses <code>map</code> for the custom
1578+ * mapping of the parameter value.
1579+ * <p>
1580+ * This method returns a Java object whose type corresponds to the
1581+ * JDBC type that was registered for this parameter using the method
1582+ * <code>registerOutParameter</code>. By registering the target
1583+ * JDBC type as <code>java.sql.Types.OTHER</code>, this method can
1584+ * be used to read database-specific abstract data types.
1585+ * @param parameterName the name of the parameter
1586+ * @param map the mapping from SQL type names to Java classes
1587+ * @return a <code>java.lang.Object</code> holding the OUT parameter value
1588+ * @exception SQLException if parameterName does not correspond to a named
1589+ * parameter; if a database access error occurs or
1590+ * this method is called on a closed <code>CallableStatement</code>
1591+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1592+ * this method
1593+ * @see #setObject
1594+ * @since 1.4
1595+ */
1596+ Object getObject(String parameterName, java.util.Map<String,Class<?>> map)
1597+ throws SQLException;
1598+
1599+ /**
1600+ * Retrieves the value of a JDBC <code>REF(&lt;structured-type&gt;)</code>
1601+ * parameter as a {@link java.sql.Ref} object in the Java programming language.
1602+ *
1603+ * @param parameterName the name of the parameter
1604+ * @return the parameter value as a <code>Ref</code> object in the
1605+ * Java programming language. If the value was SQL <code>NULL</code>,
1606+ * the value <code>null</code> is returned.
1607+ * @exception SQLException if parameterName does not correspond to a named
1608+ * parameter; if a database access error occurs or
1609+ * this method is called on a closed <code>CallableStatement</code>
1610+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1611+ * this method
1612+ * @since 1.4
1613+ */
1614+ Ref getRef (String parameterName) throws SQLException;
1615+
1616+ /**
1617+ * Retrieves the value of a JDBC <code>BLOB</code> parameter as a
1618+ * {@link java.sql.Blob} object in the Java programming language.
1619+ *
1620+ * @param parameterName the name of the parameter
1621+ * @return the parameter value as a <code>Blob</code> object in the
1622+ * Java programming language. If the value was SQL <code>NULL</code>,
1623+ * the value <code>null</code> is returned.
1624+ * @exception SQLException if parameterName does not correspond to a named
1625+ * parameter; if a database access error occurs or
1626+ * this method is called on a closed <code>CallableStatement</code>
1627+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1628+ * this method
1629+ * @since 1.4
1630+ */
1631+ Blob getBlob (String parameterName) throws SQLException;
1632+
1633+ /**
1634+ * Retrieves the value of a JDBC <code>CLOB</code> parameter as a
1635+ * <code>java.sql.Clob</code> object in the Java programming language.
1636+ * @param parameterName the name of the parameter
1637+ * @return the parameter value as a <code>Clob</code> object in the
1638+ * Java programming language. If the value was SQL <code>NULL</code>,
1639+ * the value <code>null</code> is returned.
1640+ * @exception SQLException if parameterName does not correspond to a named
1641+ * parameter; if a database access error occurs or
1642+ * this method is called on a closed <code>CallableStatement</code>
1643+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1644+ * this method
1645+ * @since 1.4
1646+ */
1647+ Clob getClob (String parameterName) throws SQLException;
1648+
1649+ /**
1650+ * Retrieves the value of a JDBC <code>ARRAY</code> parameter as an
1651+ * {@link java.sql.Array} object in the Java programming language.
1652+ *
1653+ * @param parameterName the name of the parameter
1654+ * @return the parameter value as an <code>Array</code> object in
1655+ * Java programming language. If the value was SQL <code>NULL</code>,
1656+ * the value <code>null</code> is returned.
1657+ * @exception SQLException if parameterName does not correspond to a named
1658+ * parameter; if a database access error occurs or
1659+ * this method is called on a closed <code>CallableStatement</code>
1660+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1661+ * this method
1662+ * @since 1.4
1663+ */
1664+ Array getArray (String parameterName) throws SQLException;
1665+
1666+ /**
1667+ * Retrieves the value of a JDBC <code>DATE</code> parameter as a
1668+ * <code>java.sql.Date</code> object, using
1669+ * the given <code>Calendar</code> object
1670+ * to construct the date.
1671+ * With a <code>Calendar</code> object, the driver
1672+ * can calculate the date taking into account a custom timezone and locale.
1673+ * If no <code>Calendar</code> object is specified, the driver uses the
1674+ * default timezone and locale.
1675+ *
1676+ * @param parameterName the name of the parameter
1677+ * @param cal the <code>Calendar</code> object the driver will use
1678+ * to construct the date
1679+ * @return the parameter value. If the value is SQL <code>NULL</code>,
1680+ * the result is <code>null</code>.
1681+ * @exception SQLException if parameterName does not correspond to a named
1682+ * parameter; if a database access error occurs or
1683+ * this method is called on a closed <code>CallableStatement</code>
1684+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1685+ * this method
1686+ * @see #setDate
1687+ * @since 1.4
1688+ */
1689+ java.sql.Date getDate(String parameterName, Calendar cal)
1690+ throws SQLException;
1691+
1692+ /**
1693+ * Retrieves the value of a JDBC <code>TIME</code> parameter as a
1694+ * <code>java.sql.Time</code> object, using
1695+ * the given <code>Calendar</code> object
1696+ * to construct the time.
1697+ * With a <code>Calendar</code> object, the driver
1698+ * can calculate the time taking into account a custom timezone and locale.
1699+ * If no <code>Calendar</code> object is specified, the driver uses the
1700+ * default timezone and locale.
1701+ *
1702+ * @param parameterName the name of the parameter
1703+ * @param cal the <code>Calendar</code> object the driver will use
1704+ * to construct the time
1705+ * @return the parameter value; if the value is SQL <code>NULL</code>, the result is
1706+ * <code>null</code>.
1707+ * @exception SQLException if parameterName does not correspond to a named
1708+ * parameter; if a database access error occurs or
1709+ * this method is called on a closed <code>CallableStatement</code>
1710+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1711+ * this method
1712+ * @see #setTime
1713+ * @since 1.4
1714+ */
1715+ java.sql.Time getTime(String parameterName, Calendar cal)
1716+ throws SQLException;
1717+
1718+ /**
1719+ * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a
1720+ * <code>java.sql.Timestamp</code> object, using
1721+ * the given <code>Calendar</code> object to construct
1722+ * the <code>Timestamp</code> object.
1723+ * With a <code>Calendar</code> object, the driver
1724+ * can calculate the timestamp taking into account a custom timezone and locale.
1725+ * If no <code>Calendar</code> object is specified, the driver uses the
1726+ * default timezone and locale.
1727+ *
1728+ *
1729+ * @param parameterName the name of the parameter
1730+ * @param cal the <code>Calendar</code> object the driver will use
1731+ * to construct the timestamp
1732+ * @return the parameter value. If the value is SQL <code>NULL</code>, the result is
1733+ * <code>null</code>.
1734+ * @exception SQLException if parameterName does not correspond to a named
1735+ * parameter; if a database access error occurs or
1736+ * this method is called on a closed <code>CallableStatement</code>
1737+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1738+ * this method
1739+ * @see #setTimestamp
1740+ * @since 1.4
1741+ */
1742+ java.sql.Timestamp getTimestamp(String parameterName, Calendar cal)
1743+ throws SQLException;
1744+
1745+ /**
1746+ * Retrieves the value of a JDBC <code>DATALINK</code> parameter as a
1747+ * <code>java.net.URL</code> object.
1748+ *
1749+ * @param parameterName the name of the parameter
1750+ * @return the parameter value as a <code>java.net.URL</code> object in the
1751+ * Java programming language. If the value was SQL <code>NULL</code>, the
1752+ * value <code>null</code> is returned.
1753+ * @exception SQLException if parameterName does not correspond to a named
1754+ * parameter; if a database access error occurs,
1755+ * this method is called on a closed <code>CallableStatement</code>,
1756+ * or if there is a problem with the URL
1757+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1758+ * this method
1759+ * @see #setURL
1760+ * @since 1.4
1761+ */
1762+ java.net.URL getURL(String parameterName) throws SQLException;
1763+
1764+ //------------------------- JDBC 4.0 -----------------------------------
1765+
1766+ /**
1767+ * Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a
1768+ * <code>java.sql.RowId</code> object.
1769+ *
1770+ * @param parameterIndex the first parameter is 1, the second is 2,...
1771+ * @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code>
1772+ * value is used as the designated parameter. If the parameter contains
1773+ * a SQL <code>NULL</code>, then a <code>null</code> value is returned.
1774+ * @throws SQLException if the parameterIndex is not valid;
1775+ * if a database access error occurs or
1776+ * this method is called on a closed <code>CallableStatement</code>
1777+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1778+ * this method
1779+ * @since 1.6
1780+ */
1781+ RowId getRowId(int parameterIndex) throws SQLException;
1782+
1783+ /**
1784+ * Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a
1785+ * <code>java.sql.RowId</code> object.
1786+ *
1787+ * @param parameterName the name of the parameter
1788+ * @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code>
1789+ * value is used as the designated parameter. If the parameter contains
1790+ * a SQL <code>NULL</code>, then a <code>null</code> value is returned.
1791+ * @throws SQLException if parameterName does not correspond to a named
1792+ * parameter; if a database access error occurs or
1793+ * this method is called on a closed <code>CallableStatement</code>
1794+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1795+ * this method
1796+ * @since 1.6
1797+ */
1798+ RowId getRowId(String parameterName) throws SQLException;
1799+
1800+ /**
1801+ * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
1802+ * driver converts this to a SQL <code>ROWID</code> when it sends it to the
1803+ * database.
1804+ *
1805+ * @param parameterName the name of the parameter
1806+ * @param x the parameter value
1807+ * @throws SQLException if parameterName does not correspond to a named
1808+ * parameter; if a database access error occurs or
1809+ * this method is called on a closed <code>CallableStatement</code>
1810+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1811+ * this method
1812+ * @since 1.6
1813+ */
1814+ void setRowId(String parameterName, RowId x) throws SQLException;
1815+
1816+ /**
1817+ * Sets the designated parameter to the given <code>String</code> object.
1818+ * The driver converts this to a SQL <code>NCHAR</code> or
1819+ * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
1820+ * @param parameterName the name of the parameter to be set
1821+ * @param value the parameter value
1822+ * @throws SQLException if parameterName does not correspond to a named
1823+ * parameter; if the driver does not support national
1824+ * character sets; if the driver can detect that a data conversion
1825+ * error could occur; if a database access error occurs or
1826+ * this method is called on a closed <code>CallableStatement</code>
1827+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1828+ * this method
1829+ * @since 1.6
1830+ */
1831+ void setNString(String parameterName, String value)
1832+ throws SQLException;
1833+
1834+ /**
1835+ * Sets the designated parameter to a <code>Reader</code> object. The
1836+ * <code>Reader</code> reads the data till end-of-file is reached. The
1837+ * driver does the necessary conversion from Java character format to
1838+ * the national character set in the database.
1839+ * @param parameterName the name of the parameter to be set
1840+ * @param value the parameter value
1841+ * @param length the number of characters in the parameter data.
1842+ * @throws SQLException if parameterName does not correspond to a named
1843+ * parameter; if the driver does not support national
1844+ * character sets; if the driver can detect that a data conversion
1845+ * error could occur; if a database access error occurs or
1846+ * this method is called on a closed <code>CallableStatement</code>
1847+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1848+ * this method
1849+ * @since 1.6
1850+ */
1851+ void setNCharacterStream(String parameterName, Reader value, long length)
1852+ throws SQLException;
1853+
1854+ /**
1855+ * Sets the designated parameter to a <code>java.sql.NClob</code> object. The object
1856+ * implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>
1857+ * object maps to a SQL <code>NCLOB</code>.
1858+ * @param parameterName the name of the parameter to be set
1859+ * @param value the parameter value
1860+ * @throws SQLException if parameterName does not correspond to a named
1861+ * parameter; if the driver does not support national
1862+ * character sets; if the driver can detect that a data conversion
1863+ * error could occur; if a database access error occurs or
1864+ * this method is called on a closed <code>CallableStatement</code>
1865+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1866+ * this method
1867+ * @since 1.6
1868+ */
1869+ void setNClob(String parameterName, NClob value) throws SQLException;
1870+
1871+ /**
1872+ * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number
1873+ * of characters specified by length otherwise a <code>SQLException</code> will be
1874+ * generated when the <code>CallableStatement</code> is executed.
1875+ * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
1876+ * because it informs the driver that the parameter value should be sent to
1877+ * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
1878+ * driver may have to do extra work to determine whether the parameter
1879+ * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
1880+ * @param parameterName the name of the parameter to be set
1881+ * @param reader An object that contains the data to set the parameter value to.
1882+ * @param length the number of characters in the parameter data.
1883+ * @throws SQLException if parameterName does not correspond to a named
1884+ * parameter; if the length specified is less than zero;
1885+ * a database access error occurs or
1886+ * this method is called on a closed <code>CallableStatement</code>
1887+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1888+ * this method
1889+ *
1890+ * @since 1.6
1891+ */
1892+ void setClob(String parameterName, Reader reader, long length)
1893+ throws SQLException;
1894+
1895+ /**
1896+ * Sets the designated parameter to a <code>InputStream</code> object. The <code>inputstream</code> must contain the number
1897+ * of characters specified by length, otherwise a <code>SQLException</code> will be
1898+ * generated when the <code>CallableStatement</code> is executed.
1899+ * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
1900+ * method because it informs the driver that the parameter value should be
1901+ * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
1902+ * the driver may have to do extra work to determine whether the parameter
1903+ * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
1904+ *
1905+ * @param parameterName the name of the parameter to be set
1906+ * the second is 2, ...
1907+ *
1908+ * @param inputStream An object that contains the data to set the parameter
1909+ * value to.
1910+ * @param length the number of bytes in the parameter data.
1911+ * @throws SQLException if parameterName does not correspond to a named
1912+ * parameter; if the length specified
1913+ * is less than zero; if the number of bytes in the inputstream does not match
1914+ * the specfied length; if a database access error occurs or
1915+ * this method is called on a closed <code>CallableStatement</code>
1916+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1917+ * this method
1918+ *
1919+ * @since 1.6
1920+ */
1921+ void setBlob(String parameterName, InputStream inputStream, long length)
1922+ throws SQLException;
1923+ /**
1924+ * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number
1925+ * of characters specified by length otherwise a <code>SQLException</code> will be
1926+ * generated when the <code>CallableStatement</code> is executed.
1927+ * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
1928+ * because it informs the driver that the parameter value should be sent to
1929+ * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
1930+ * driver may have to do extra work to determine whether the parameter
1931+ * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
1932+ *
1933+ * @param parameterName the name of the parameter to be set
1934+ * @param reader An object that contains the data to set the parameter value to.
1935+ * @param length the number of characters in the parameter data.
1936+ * @throws SQLException if parameterName does not correspond to a named
1937+ * parameter; if the length specified is less than zero;
1938+ * if the driver does not support national
1939+ * character sets; if the driver can detect that a data conversion
1940+ * error could occur; if a database access error occurs or
1941+ * this method is called on a closed <code>CallableStatement</code>
1942+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1943+ * this method
1944+ * @since 1.6
1945+ */
1946+ void setNClob(String parameterName, Reader reader, long length)
1947+ throws SQLException;
1948+
1949+ /**
1950+ * Retrieves the value of the designated JDBC <code>NCLOB</code> parameter as a
1951+ * <code>java.sql.NClob</code> object in the Java programming language.
1952+ *
1953+ * @param parameterIndex the first parameter is 1, the second is 2, and
1954+ * so on
1955+ * @return the parameter value as a <code>NClob</code> object in the
1956+ * Java programming language. If the value was SQL <code>NULL</code>, the
1957+ * value <code>null</code> is returned.
1958+ * @exception SQLException if the parameterIndex is not valid;
1959+ * if the driver does not support national
1960+ * character sets; if the driver can detect that a data conversion
1961+ * error could occur; if a database access error occurs or
1962+ * this method is called on a closed <code>CallableStatement</code>
1963+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1964+ * this method
1965+ * @since 1.6
1966+ */
1967+ NClob getNClob (int parameterIndex) throws SQLException;
1968+
1969+
1970+ /**
1971+ * Retrieves the value of a JDBC <code>NCLOB</code> parameter as a
1972+ * <code>java.sql.NClob</code> object in the Java programming language.
1973+ * @param parameterName the name of the parameter
1974+ * @return the parameter value as a <code>NClob</code> object in the
1975+ * Java programming language. If the value was SQL <code>NULL</code>,
1976+ * the value <code>null</code> is returned.
1977+ * @exception SQLException if parameterName does not correspond to a named
1978+ * parameter; if the driver does not support national
1979+ * character sets; if the driver can detect that a data conversion
1980+ * error could occur; if a database access error occurs or
1981+ * this method is called on a closed <code>CallableStatement</code>
1982+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1983+ * this method
1984+ * @since 1.6
1985+ */
1986+ NClob getNClob (String parameterName) throws SQLException;
1987+
1988+ /**
1989+ * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
1990+ * <code>SQL XML</code> value when it sends it to the database.
1991+ *
1992+ * @param parameterName the name of the parameter
1993+ * @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
1994+ * @throws SQLException if parameterName does not correspond to a named
1995+ * parameter; if a database access error occurs;
1996+ * this method is called on a closed <code>CallableStatement</code> or
1997+ * the <code>java.xml.transform.Result</code>,
1998+ * <code>Writer</code> or <code>OutputStream</code> has not been closed for the <code>SQLXML</code> object
1999+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2000+ * this method
2001+ *
2002+ * @since 1.6
2003+ */
2004+ void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException;
2005+
2006+ /**
2007+ * Retrieves the value of the designated <code>SQL XML</code> parameter as a
2008+ * <code>java.sql.SQLXML</code> object in the Java programming language.
2009+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
2010+ * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
2011+ * @throws SQLException if the parameterIndex is not valid;
2012+ * if a database access error occurs or
2013+ * this method is called on a closed <code>CallableStatement</code>
2014+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2015+ * this method
2016+ * @since 1.6
2017+ */
2018+ SQLXML getSQLXML(int parameterIndex) throws SQLException;
2019+
2020+ /**
2021+ * Retrieves the value of the designated <code>SQL XML</code> parameter as a
2022+ * <code>java.sql.SQLXML</code> object in the Java programming language.
2023+ * @param parameterName the name of the parameter
2024+ * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
2025+ * @throws SQLException if parameterName does not correspond to a named
2026+ * parameter; if a database access error occurs or
2027+ * this method is called on a closed <code>CallableStatement</code>
2028+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2029+ * this method
2030+ * @since 1.6
2031+ */
2032+ SQLXML getSQLXML(String parameterName) throws SQLException;
2033+
2034+ /**
2035+ * Retrieves the value of the designated <code>NCHAR</code>,
2036+ * <code>NVARCHAR</code>
2037+ * or <code>LONGNVARCHAR</code> parameter as
2038+ * a <code>String</code> in the Java programming language.
2039+ * <p>
2040+ * For the fixed-length type JDBC <code>NCHAR</code>,
2041+ * the <code>String</code> object
2042+ * returned has exactly the same value the SQL
2043+ * <code>NCHAR</code> value had in the
2044+ * database, including any padding added by the database.
2045+ *
2046+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
2047+ * @return a <code>String</code> object that maps an
2048+ * <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
2049+ * @exception SQLException if the parameterIndex is not valid;
2050+ * if a database access error occurs or
2051+ * this method is called on a closed <code>CallableStatement</code>
2052+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2053+ * this method
2054+ * @since 1.6
2055+ * @see #setNString
2056+ */
2057+ String getNString(int parameterIndex) throws SQLException;
2058+
2059+
2060+ /**
2061+ * Retrieves the value of the designated <code>NCHAR</code>,
2062+ * <code>NVARCHAR</code>
2063+ * or <code>LONGNVARCHAR</code> parameter as
2064+ * a <code>String</code> in the Java programming language.
2065+ * <p>
2066+ * For the fixed-length type JDBC <code>NCHAR</code>,
2067+ * the <code>String</code> object
2068+ * returned has exactly the same value the SQL
2069+ * <code>NCHAR</code> value had in the
2070+ * database, including any padding added by the database.
2071+ *
2072+ * @param parameterName the name of the parameter
2073+ * @return a <code>String</code> object that maps an
2074+ * <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
2075+ * @exception SQLException if parameterName does not correspond to a named
2076+ * parameter;
2077+ * if a database access error occurs or
2078+ * this method is called on a closed <code>CallableStatement</code>
2079+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2080+ * this method
2081+ * @since 1.6
2082+ * @see #setNString
2083+ */
2084+ String getNString(String parameterName) throws SQLException;
2085+
2086+ /**
2087+ * Retrieves the value of the designated parameter as a
2088+ * <code>java.io.Reader</code> object in the Java programming language.
2089+ * It is intended for use when
2090+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
2091+ * and <code>LONGNVARCHAR</code> parameters.
2092+ *
2093+ * @return a <code>java.io.Reader</code> object that contains the parameter
2094+ * value; if the value is SQL <code>NULL</code>, the value returned is
2095+ * <code>null</code> in the Java programming language.
2096+ * @param parameterIndex the first parameter is 1, the second is 2, ...
2097+ * @exception SQLException if the parameterIndex is not valid;
2098+ * if a database access error occurs or
2099+ * this method is called on a closed <code>CallableStatement</code>
2100+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2101+ * this method
2102+ * @since 1.6
2103+ */
2104+ java.io.Reader getNCharacterStream(int parameterIndex) throws SQLException;
2105+
2106+ /**
2107+ * Retrieves the value of the designated parameter as a
2108+ * <code>java.io.Reader</code> object in the Java programming language.
2109+ * It is intended for use when
2110+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
2111+ * and <code>LONGNVARCHAR</code> parameters.
2112+ *
2113+ * @param parameterName the name of the parameter
2114+ * @return a <code>java.io.Reader</code> object that contains the parameter
2115+ * value; if the value is SQL <code>NULL</code>, the value returned is
2116+ * <code>null</code> in the Java programming language
2117+ * @exception SQLException if parameterName does not correspond to a named
2118+ * parameter; if a database access error occurs or
2119+ * this method is called on a closed <code>CallableStatement</code>
2120+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2121+ * this method
2122+ * @since 1.6
2123+ */
2124+ java.io.Reader getNCharacterStream(String parameterName) throws SQLException;
2125+
2126+ /**
2127+ * Retrieves the value of the designated parameter as a
2128+ * <code>java.io.Reader</code> object in the Java programming language.
2129+ *
2130+ * @return a <code>java.io.Reader</code> object that contains the parameter
2131+ * value; if the value is SQL <code>NULL</code>, the value returned is
2132+ * <code>null</code> in the Java programming language.
2133+ * @param parameterIndex the first parameter is 1, the second is 2, ...
2134+ * @exception SQLException if the parameterIndex is not valid; if a database access error occurs or
2135+ * this method is called on a closed <code>CallableStatement</code>
2136+ * @since 1.6
2137+ */
2138+ java.io.Reader getCharacterStream(int parameterIndex) throws SQLException;
2139+
2140+ /**
2141+ * Retrieves the value of the designated parameter as a
2142+ * <code>java.io.Reader</code> object in the Java programming language.
2143+ *
2144+ * @param parameterName the name of the parameter
2145+ * @return a <code>java.io.Reader</code> object that contains the parameter
2146+ * value; if the value is SQL <code>NULL</code>, the value returned is
2147+ * <code>null</code> in the Java programming language
2148+ * @exception SQLException if parameterName does not correspond to a named
2149+ * parameter; if a database access error occurs or
2150+ * this method is called on a closed <code>CallableStatement</code>
2151+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2152+ * this method
2153+ * @since 1.6
2154+ */
2155+ java.io.Reader getCharacterStream(String parameterName) throws SQLException;
2156+
2157+ /**
2158+ * Sets the designated parameter to the given <code>java.sql.Blob</code> object.
2159+ * The driver converts this to an SQL <code>BLOB</code> value when it
2160+ * sends it to the database.
2161+ *
2162+ * @param parameterName the name of the parameter
2163+ * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value
2164+ * @exception SQLException if parameterName does not correspond to a named
2165+ * parameter; if a database access error occurs or
2166+ * this method is called on a closed <code>CallableStatement</code>
2167+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2168+ * this method
2169+ * @since 1.6
2170+ */
2171+ void setBlob (String parameterName, Blob x) throws SQLException;
2172+
2173+ /**
2174+ * Sets the designated parameter to the given <code>java.sql.Clob</code> object.
2175+ * The driver converts this to an SQL <code>CLOB</code> value when it
2176+ * sends it to the database.
2177+ *
2178+ * @param parameterName the name of the parameter
2179+ * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value
2180+ * @exception SQLException if parameterName does not correspond to a named
2181+ * parameter; if a database access error occurs or
2182+ * this method is called on a closed <code>CallableStatement</code>
2183+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2184+ * this method
2185+ * @since 1.6
2186+ */
2187+ void setClob (String parameterName, Clob x) throws SQLException;
2188+ /**
2189+ * Sets the designated parameter to the given input stream, which will have
2190+ * the specified number of bytes.
2191+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
2192+ * parameter, it may be more practical to send it via a
2193+ * <code>java.io.InputStream</code>. Data will be read from the stream
2194+ * as needed until end-of-file is reached. The JDBC driver will
2195+ * do any necessary conversion from ASCII to the database char format.
2196+ *
2197+ * <P><B>Note:</B> This stream object can either be a standard
2198+ * Java stream object or your own subclass that implements the
2199+ * standard interface.
2200+ *
2201+ * @param parameterName the name of the parameter
2202+ * @param x the Java input stream that contains the ASCII parameter value
2203+ * @param length the number of bytes in the stream
2204+ * @exception SQLException if parameterName does not correspond to a named
2205+ * parameter; if a database access error occurs or
2206+ * this method is called on a closed <code>CallableStatement</code>
2207+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2208+ * this method
2209+ * @since 1.6
2210+ */
2211+ void setAsciiStream(String parameterName, java.io.InputStream x, long length)
2212+ throws SQLException;
2213+
2214+ /**
2215+ * Sets the designated parameter to the given input stream, which will have
2216+ * the specified number of bytes.
2217+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
2218+ * parameter, it may be more practical to send it via a
2219+ * <code>java.io.InputStream</code> object. The data will be read from the stream
2220+ * as needed until end-of-file is reached.
2221+ *
2222+ * <P><B>Note:</B> This stream object can either be a standard
2223+ * Java stream object or your own subclass that implements the
2224+ * standard interface.
2225+ *
2226+ * @param parameterName the name of the parameter
2227+ * @param x the java input stream which contains the binary parameter value
2228+ * @param length the number of bytes in the stream
2229+ * @exception SQLException if parameterName does not correspond to a named
2230+ * parameter; if a database access error occurs or
2231+ * this method is called on a closed <code>CallableStatement</code>
2232+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2233+ * this method
2234+ * @since 1.6
2235+ */
2236+ void setBinaryStream(String parameterName, java.io.InputStream x,
2237+ long length) throws SQLException;
2238+ /**
2239+ * Sets the designated parameter to the given <code>Reader</code>
2240+ * object, which is the given number of characters long.
2241+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
2242+ * parameter, it may be more practical to send it via a
2243+ * <code>java.io.Reader</code> object. The data will be read from the stream
2244+ * as needed until end-of-file is reached. The JDBC driver will
2245+ * do any necessary conversion from UNICODE to the database char format.
2246+ *
2247+ * <P><B>Note:</B> This stream object can either be a standard
2248+ * Java stream object or your own subclass that implements the
2249+ * standard interface.
2250+ *
2251+ * @param parameterName the name of the parameter
2252+ * @param reader the <code>java.io.Reader</code> object that
2253+ * contains the UNICODE data used as the designated parameter
2254+ * @param length the number of characters in the stream
2255+ * @exception SQLException if parameterName does not correspond to a named
2256+ * parameter; if a database access error occurs or
2257+ * this method is called on a closed <code>CallableStatement</code>
2258+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2259+ * this method
2260+ * @since 1.6
2261+ */
2262+ void setCharacterStream(String parameterName,
2263+ java.io.Reader reader,
2264+ long length) throws SQLException;
2265+ //--
2266+ /**
2267+ * Sets the designated parameter to the given input stream.
2268+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
2269+ * parameter, it may be more practical to send it via a
2270+ * <code>java.io.InputStream</code>. Data will be read from the stream
2271+ * as needed until end-of-file is reached. The JDBC driver will
2272+ * do any necessary conversion from ASCII to the database char format.
2273+ *
2274+ * <P><B>Note:</B> This stream object can either be a standard
2275+ * Java stream object or your own subclass that implements the
2276+ * standard interface.
2277+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2278+ * it might be more efficient to use a version of
2279+ * <code>setAsciiStream</code> which takes a length parameter.
2280+ *
2281+ * @param parameterName the name of the parameter
2282+ * @param x the Java input stream that contains the ASCII parameter value
2283+ * @exception SQLException if parameterName does not correspond to a named
2284+ * parameter; if a database access error occurs or
2285+ * this method is called on a closed <code>CallableStatement</code>
2286+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2287+ * @since 1.6
2288+ */
2289+ void setAsciiStream(String parameterName, java.io.InputStream x)
2290+ throws SQLException;
2291+ /**
2292+ * Sets the designated parameter to the given input stream.
2293+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
2294+ * parameter, it may be more practical to send it via a
2295+ * <code>java.io.InputStream</code> object. The data will be read from the
2296+ * stream as needed until end-of-file is reached.
2297+ *
2298+ * <P><B>Note:</B> This stream object can either be a standard
2299+ * Java stream object or your own subclass that implements the
2300+ * standard interface.
2301+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2302+ * it might be more efficient to use a version of
2303+ * <code>setBinaryStream</code> which takes a length parameter.
2304+ *
2305+ * @param parameterName the name of the parameter
2306+ * @param x the java input stream which contains the binary parameter value
2307+ * @exception SQLException if parameterName does not correspond to a named
2308+ * parameter; if a database access error occurs or
2309+ * this method is called on a closed <code>CallableStatement</code>
2310+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2311+ * @since 1.6
2312+ */
2313+ void setBinaryStream(String parameterName, java.io.InputStream x)
2314+ throws SQLException;
2315+ /**
2316+ * Sets the designated parameter to the given <code>Reader</code>
2317+ * object.
2318+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
2319+ * parameter, it may be more practical to send it via a
2320+ * <code>java.io.Reader</code> object. The data will be read from the stream
2321+ * as needed until end-of-file is reached. The JDBC driver will
2322+ * do any necessary conversion from UNICODE to the database char format.
2323+ *
2324+ * <P><B>Note:</B> This stream object can either be a standard
2325+ * Java stream object or your own subclass that implements the
2326+ * standard interface.
2327+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2328+ * it might be more efficient to use a version of
2329+ * <code>setCharacterStream</code> which takes a length parameter.
2330+ *
2331+ * @param parameterName the name of the parameter
2332+ * @param reader the <code>java.io.Reader</code> object that contains the
2333+ * Unicode data
2334+ * @exception SQLException if parameterName does not correspond to a named
2335+ * parameter; if a database access error occurs or
2336+ * this method is called on a closed <code>CallableStatement</code>
2337+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2338+ * @since 1.6
2339+ */
2340+ void setCharacterStream(String parameterName,
2341+ java.io.Reader reader) throws SQLException;
2342+ /**
2343+ * Sets the designated parameter to a <code>Reader</code> object. The
2344+ * <code>Reader</code> reads the data till end-of-file is reached. The
2345+ * driver does the necessary conversion from Java character format to
2346+ * the national character set in the database.
2347+
2348+ * <P><B>Note:</B> This stream object can either be a standard
2349+ * Java stream object or your own subclass that implements the
2350+ * standard interface.
2351+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2352+ * it might be more efficient to use a version of
2353+ * <code>setNCharacterStream</code> which takes a length parameter.
2354+ *
2355+ * @param parameterName the name of the parameter
2356+ * @param value the parameter value
2357+ * @throws SQLException if parameterName does not correspond to a named
2358+ * parameter; if the driver does not support national
2359+ * character sets; if the driver can detect that a data conversion
2360+ * error could occur; if a database access error occurs; or
2361+ * this method is called on a closed <code>CallableStatement</code>
2362+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2363+ * @since 1.6
2364+ */
2365+ void setNCharacterStream(String parameterName, Reader value) throws SQLException;
2366+
2367+ /**
2368+ * Sets the designated parameter to a <code>Reader</code> object.
2369+ * This method differs from the <code>setCharacterStream (int, Reader)</code> method
2370+ * because it informs the driver that the parameter value should be sent to
2371+ * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
2372+ * driver may have to do extra work to determine whether the parameter
2373+ * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
2374+ *
2375+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2376+ * it might be more efficient to use a version of
2377+ * <code>setClob</code> which takes a length parameter.
2378+ *
2379+ * @param parameterName the name of the parameter
2380+ * @param reader An object that contains the data to set the parameter value to.
2381+ * @throws SQLException if parameterName does not correspond to a named
2382+ * parameter; if a database access error occurs or this method is called on
2383+ * a closed <code>CallableStatement</code>
2384+ *
2385+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2386+ * @since 1.6
2387+ */
2388+ void setClob(String parameterName, Reader reader)
2389+ throws SQLException;
2390+
2391+ /**
2392+ * Sets the designated parameter to a <code>InputStream</code> object.
2393+ * This method differs from the <code>setBinaryStream (int, InputStream)</code>
2394+ * method because it informs the driver that the parameter value should be
2395+ * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
2396+ * the driver may have to do extra work to determine whether the parameter
2397+ * data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
2398+ *
2399+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2400+ * it might be more efficient to use a version of
2401+ * <code>setBlob</code> which takes a length parameter.
2402+ *
2403+ * @param parameterName the name of the parameter
2404+ * @param inputStream An object that contains the data to set the parameter
2405+ * value to.
2406+ * @throws SQLException if parameterName does not correspond to a named
2407+ * parameter; if a database access error occurs or
2408+ * this method is called on a closed <code>CallableStatement</code>
2409+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2410+ *
2411+ * @since 1.6
2412+ */
2413+ void setBlob(String parameterName, InputStream inputStream)
2414+ throws SQLException;
2415+ /**
2416+ * Sets the designated parameter to a <code>Reader</code> object.
2417+ * This method differs from the <code>setCharacterStream (int, Reader)</code> method
2418+ * because it informs the driver that the parameter value should be sent to
2419+ * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
2420+ * driver may have to do extra work to determine whether the parameter
2421+ * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
2422+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
2423+ * it might be more efficient to use a version of
2424+ * <code>setNClob</code> which takes a length parameter.
2425+ *
2426+ * @param parameterName the name of the parameter
2427+ * @param reader An object that contains the data to set the parameter value to.
2428+ * @throws SQLException if parameterName does not correspond to a named
2429+ * parameter; if the driver does not support national character sets;
2430+ * if the driver can detect that a data conversion
2431+ * error could occur; if a database access error occurs or
2432+ * this method is called on a closed <code>CallableStatement</code>
2433+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
2434+ *
2435+ * @since 1.6
2436+ */
2437+ void setNClob(String parameterName, Reader reader)
2438+ throws SQLException;
2439+
2440+ //------------------------- JDBC 4.1 -----------------------------------
2441+
2442+
2443+ /**
2444+ *<p>Returns an object representing the value of OUT parameter
2445+ * {@code parameterIndex} and will convert from the
2446+ * SQL type of the parameter to the requested Java data type, if the
2447+ * conversion is supported. If the conversion is not
2448+ * supported or null is specified for the type, a
2449+ * <code>SQLException</code> is thrown.
2450+ *<p>
2451+ * At a minimum, an implementation must support the conversions defined in
2452+ * Appendix B, Table B-3 and conversion of appropriate user defined SQL
2453+ * types to a Java type which implements {@code SQLData}, or {@code Struct}.
2454+ * Additional conversions may be supported and are vendor defined.
2455+ *
2456+ * @param parameterIndex the first parameter is 1, the second is 2, and so on
2457+ * @param type Class representing the Java data type to convert the
2458+ * designated parameter to.
2459+ * @return an instance of {@code type} holding the OUT parameter value
2460+ * @throws SQLException if conversion is not supported, type is null or
2461+ * another error occurs. The getCause() method of the
2462+ * exception may provide a more detailed exception, for example, if
2463+ * a conversion error occurs
2464+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support
2465+ * this method
2466+ * @since 1.7
2467+ */
2468+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException;
2469+
2470+
2471+ /**
2472+ *<p>Returns an object representing the value of OUT parameter
2473+ * {@code parameterName} and will convert from the
2474+ * SQL type of the parameter to the requested Java data type, if the
2475+ * conversion is supported. If the conversion is not
2476+ * supported or null is specified for the type, a
2477+ * <code>SQLException</code> is thrown.
2478+ *<p>
2479+ * At a minimum, an implementation must support the conversions defined in
2480+ * Appendix B, Table B-3 and conversion of appropriate user defined SQL
2481+ * types to a Java type which implements {@code SQLData}, or {@code Struct}.
2482+ * Additional conversions may be supported and are vendor defined.
2483+ *
2484+ * @param parameterName the name of the parameter
2485+ * @param type Class representing the Java data type to convert
2486+ * the designated parameter to.
2487+ * @return an instance of {@code type} holding the OUT parameter
2488+ * value
2489+ * @throws SQLException if conversion is not supported, type is null or
2490+ * another error occurs. The getCause() method of the
2491+ * exception may provide a more detailed exception, for example, if
2492+ * a conversion error occurs
2493+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support
2494+ * this method
2495+ * @since 1.7
2496+ */
2497+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException;
2498+
2499+}
java/pkg/java/sql/ClientInfoStatus.class+0−0

Binary file not shown.

java/pkg/java/sql/ClientInfoStatus.java+62−0
@@ -0,0 +1,62 @@
1+/*
2+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.*;
29+
30+/**
31+ * Enumeration for status of the reason that a property could not be set
32+ * via a call to <code>Connection.setClientInfo</code>
33+ * @since 1.6
34+ */
35+
36+public enum ClientInfoStatus {
37+
38+ /**
39+ * The client info property could not be set for some unknown reason
40+ * @since 1.6
41+ */
42+ REASON_UNKNOWN,
43+
44+ /**
45+ * The client info property name specified was not a recognized property
46+ * name.
47+ * @since 1.6
48+ */
49+ REASON_UNKNOWN_PROPERTY,
50+
51+ /**
52+ * The value specified for the client info property was not valid.
53+ * @since 1.6
54+ */
55+ REASON_VALUE_INVALID,
56+
57+ /**
58+ * The value specified for the client info property was too large.
59+ * @since 1.6
60+ */
61+ REASON_VALUE_TRUNCATED
62+}
java/pkg/java/sql/Clob.class+0−0

Binary file not shown.

java/pkg/java/sql/Clob.java+348−0
@@ -0,0 +1,348 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.io.Reader;
29+
30+/**
31+ * The mapping in the Java<sup><font size=-2>TM</font></sup> programming language
32+ * for the SQL <code>CLOB</code> type.
33+ * An SQL <code>CLOB</code> is a built-in type
34+ * that stores a Character Large Object as a column value in a row of
35+ * a database table.
36+ * By default drivers implement a <code>Clob</code> object using an SQL
37+ * <code>locator(CLOB)</code>, which means that a <code>Clob</code> object
38+ * contains a logical pointer to the SQL <code>CLOB</code> data rather than
39+ * the data itself. A <code>Clob</code> object is valid for the duration
40+ * of the transaction in which it was created.
41+ * <P>The <code>Clob</code> interface provides methods for getting the
42+ * length of an SQL <code>CLOB</code> (Character Large Object) value,
43+ * for materializing a <code>CLOB</code> value on the client, and for
44+ * searching for a substring or <code>CLOB</code> object within a
45+ * <code>CLOB</code> value.
46+ * Methods in the interfaces {@link ResultSet},
47+ * {@link CallableStatement}, and {@link PreparedStatement}, such as
48+ * <code>getClob</code> and <code>setClob</code> allow a programmer to
49+ * access an SQL <code>CLOB</code> value. In addition, this interface
50+ * has methods for updating a <code>CLOB</code> value.
51+ * <p>
52+ * All methods on the <code>Clob</code> interface must be fully implemented if the
53+ * JDBC driver supports the data type.
54+ *
55+ * @since 1.2
56+ */
57+
58+public interface Clob {
59+
60+ /**
61+ * Retrieves the number of characters
62+ * in the <code>CLOB</code> value
63+ * designated by this <code>Clob</code> object.
64+ *
65+ * @return length of the <code>CLOB</code> in characters
66+ * @exception SQLException if there is an error accessing the
67+ * length of the <code>CLOB</code> value
68+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
69+ * this method
70+ * @since 1.2
71+ */
72+ long length() throws SQLException;
73+
74+ /**
75+ * Retrieves a copy of the specified substring
76+ * in the <code>CLOB</code> value
77+ * designated by this <code>Clob</code> object.
78+ * The substring begins at position
79+ * <code>pos</code> and has up to <code>length</code> consecutive
80+ * characters.
81+ *
82+ * @param pos the first character of the substring to be extracted.
83+ * The first character is at position 1.
84+ * @param length the number of consecutive characters to be copied;
85+ * the value for length must be 0 or greater
86+ * @return a <code>String</code> that is the specified substring in
87+ * the <code>CLOB</code> value designated by this <code>Clob</code> object
88+ * @exception SQLException if there is an error accessing the
89+ * <code>CLOB</code> value; if pos is less than 1 or length is
90+ * less than 0
91+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
92+ * this method
93+ * @since 1.2
94+ */
95+ String getSubString(long pos, int length) throws SQLException;
96+
97+ /**
98+ * Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
99+ * object as a <code>java.io.Reader</code> object (or as a stream of
100+ * characters).
101+ *
102+ * @return a <code>java.io.Reader</code> object containing the
103+ * <code>CLOB</code> data
104+ * @exception SQLException if there is an error accessing the
105+ * <code>CLOB</code> value
106+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
107+ * this method
108+ * @see #setCharacterStream
109+ * @since 1.2
110+ */
111+ java.io.Reader getCharacterStream() throws SQLException;
112+
113+ /**
114+ * Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
115+ * object as an ascii stream.
116+ *
117+ * @return a <code>java.io.InputStream</code> object containing the
118+ * <code>CLOB</code> data
119+ * @exception SQLException if there is an error accessing the
120+ * <code>CLOB</code> value
121+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
122+ * this method
123+ * @see #setAsciiStream
124+ * @since 1.2
125+ */
126+ java.io.InputStream getAsciiStream() throws SQLException;
127+
128+ /**
129+ * Retrieves the character position at which the specified substring
130+ * <code>searchstr</code> appears in the SQL <code>CLOB</code> value
131+ * represented by this <code>Clob</code> object. The search
132+ * begins at position <code>start</code>.
133+ *
134+ * @param searchstr the substring for which to search
135+ * @param start the position at which to begin searching; the first position
136+ * is 1
137+ * @return the position at which the substring appears or -1 if it is not
138+ * present; the first position is 1
139+ * @exception SQLException if there is an error accessing the
140+ * <code>CLOB</code> value or if pos is less than 1
141+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
142+ * this method
143+ * @since 1.2
144+ */
145+ long position(String searchstr, long start) throws SQLException;
146+
147+ /**
148+ * Retrieves the character position at which the specified
149+ * <code>Clob</code> object <code>searchstr</code> appears in this
150+ * <code>Clob</code> object. The search begins at position
151+ * <code>start</code>.
152+ *
153+ * @param searchstr the <code>Clob</code> object for which to search
154+ * @param start the position at which to begin searching; the first
155+ * position is 1
156+ * @return the position at which the <code>Clob</code> object appears
157+ * or -1 if it is not present; the first position is 1
158+ * @exception SQLException if there is an error accessing the
159+ * <code>CLOB</code> value or if start is less than 1
160+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
161+ * this method
162+ * @since 1.2
163+ */
164+ long position(Clob searchstr, long start) throws SQLException;
165+
166+ //---------------------------- jdbc 3.0 -----------------------------------
167+
168+ /**
169+ * Writes the given Java <code>String</code> to the <code>CLOB</code>
170+ * value that this <code>Clob</code> object designates at the position
171+ * <code>pos</code>. The string will overwrite the existing characters
172+ * in the <code>Clob</code> object starting at the position
173+ * <code>pos</code>. If the end of the <code>Clob</code> value is reached
174+ * while writing the given string, then the length of the <code>Clob</code>
175+ * value will be increased to accomodate the extra characters.
176+ * <p>
177+ * <b>Note:</b> If the value specified for <code>pos</code>
178+ * is greater then the length+1 of the <code>CLOB</code> value then the
179+ * behavior is undefined. Some JDBC drivers may throw a
180+ * <code>SQLException</code> while other drivers may support this
181+ * operation.
182+ *
183+ * @param pos the position at which to start writing to the <code>CLOB</code>
184+ * value that this <code>Clob</code> object represents;
185+ * The first position is 1
186+ * @param str the string to be written to the <code>CLOB</code>
187+ * value that this <code>Clob</code> designates
188+ * @return the number of characters written
189+ * @exception SQLException if there is an error accessing the
190+ * <code>CLOB</code> value or if pos is less than 1
191+ *
192+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
193+ * this method
194+ * @since 1.4
195+ */
196+ int setString(long pos, String str) throws SQLException;
197+
198+ /**
199+ * Writes <code>len</code> characters of <code>str</code>, starting
200+ * at character <code>offset</code>, to the <code>CLOB</code> value
201+ * that this <code>Clob</code> represents. The string will overwrite the existing characters
202+ * in the <code>Clob</code> object starting at the position
203+ * <code>pos</code>. If the end of the <code>Clob</code> value is reached
204+ * while writing the given string, then the length of the <code>Clob</code>
205+ * value will be increased to accomodate the extra characters.
206+ * <p>
207+ * <b>Note:</b> If the value specified for <code>pos</code>
208+ * is greater then the length+1 of the <code>CLOB</code> value then the
209+ * behavior is undefined. Some JDBC drivers may throw a
210+ * <code>SQLException</code> while other drivers may support this
211+ * operation.
212+ *
213+ * @param pos the position at which to start writing to this
214+ * <code>CLOB</code> object; The first position is 1
215+ * @param str the string to be written to the <code>CLOB</code>
216+ * value that this <code>Clob</code> object represents
217+ * @param offset the offset into <code>str</code> to start reading
218+ * the characters to be written
219+ * @param len the number of characters to be written
220+ * @return the number of characters written
221+ * @exception SQLException if there is an error accessing the
222+ * <code>CLOB</code> value or if pos is less than 1
223+ *
224+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
225+ * this method
226+ * @since 1.4
227+ */
228+ int setString(long pos, String str, int offset, int len) throws SQLException;
229+
230+ /**
231+ * Retrieves a stream to be used to write Ascii characters to the
232+ * <code>CLOB</code> value that this <code>Clob</code> object represents,
233+ * starting at position <code>pos</code>. Characters written to the stream
234+ * will overwrite the existing characters
235+ * in the <code>Clob</code> object starting at the position
236+ * <code>pos</code>. If the end of the <code>Clob</code> value is reached
237+ * while writing characters to the stream, then the length of the <code>Clob</code>
238+ * value will be increased to accomodate the extra characters.
239+ * <p>
240+ * <b>Note:</b> If the value specified for <code>pos</code>
241+ * is greater then the length+1 of the <code>CLOB</code> value then the
242+ * behavior is undefined. Some JDBC drivers may throw a
243+ * <code>SQLException</code> while other drivers may support this
244+ * operation.
245+ *
246+ * @param pos the position at which to start writing to this
247+ * <code>CLOB</code> object; The first position is 1
248+ * @return the stream to which ASCII encoded characters can be written
249+ * @exception SQLException if there is an error accessing the
250+ * <code>CLOB</code> value or if pos is less than 1
251+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
252+ * this method
253+ * @see #getAsciiStream
254+ *
255+ * @since 1.4
256+ */
257+ java.io.OutputStream setAsciiStream(long pos) throws SQLException;
258+
259+ /**
260+ * Retrieves a stream to be used to write a stream of Unicode characters
261+ * to the <code>CLOB</code> value that this <code>Clob</code> object
262+ * represents, at position <code>pos</code>. Characters written to the stream
263+ * will overwrite the existing characters
264+ * in the <code>Clob</code> object starting at the position
265+ * <code>pos</code>. If the end of the <code>Clob</code> value is reached
266+ * while writing characters to the stream, then the length of the <code>Clob</code>
267+ * value will be increased to accomodate the extra characters.
268+ * <p>
269+ * <b>Note:</b> If the value specified for <code>pos</code>
270+ * is greater then the length+1 of the <code>CLOB</code> value then the
271+ * behavior is undefined. Some JDBC drivers may throw a
272+ * <code>SQLException</code> while other drivers may support this
273+ * operation.
274+ *
275+ * @param pos the position at which to start writing to the
276+ * <code>CLOB</code> value; The first position is 1
277+ *
278+ * @return a stream to which Unicode encoded characters can be written
279+ * @exception SQLException if there is an error accessing the
280+ * <code>CLOB</code> value or if pos is less than 1
281+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
282+ * this method
283+ * @see #getCharacterStream
284+ *
285+ * @since 1.4
286+ */
287+ java.io.Writer setCharacterStream(long pos) throws SQLException;
288+
289+ /**
290+ * Truncates the <code>CLOB</code> value that this <code>Clob</code>
291+ * designates to have a length of <code>len</code>
292+ * characters.
293+ * <p>
294+ * <b>Note:</b> If the value specified for <code>pos</code>
295+ * is greater then the length+1 of the <code>CLOB</code> value then the
296+ * behavior is undefined. Some JDBC drivers may throw a
297+ * <code>SQLException</code> while other drivers may support this
298+ * operation.
299+ *
300+ * @param len the length, in characters, to which the <code>CLOB</code> value
301+ * should be truncated
302+ * @exception SQLException if there is an error accessing the
303+ * <code>CLOB</code> value or if len is less than 0
304+ *
305+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
306+ * this method
307+ * @since 1.4
308+ */
309+ void truncate(long len) throws SQLException;
310+
311+ /**
312+ * This method frees the <code>Clob</code> object and releases the resources the resources
313+ * that it holds. The object is invalid once the <code>free</code> method
314+ * is called.
315+ * <p>
316+ * After <code>free</code> has been called, any attempt to invoke a
317+ * method other than <code>free</code> will result in a <code>SQLException</code>
318+ * being thrown. If <code>free</code> is called multiple times, the subsequent
319+ * calls to <code>free</code> are treated as a no-op.
320+ * <p>
321+ * @throws SQLException if an error occurs releasing
322+ * the Clob's resources
323+ *
324+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
325+ * this method
326+ * @since 1.6
327+ */
328+ void free() throws SQLException;
329+
330+ /**
331+ * Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
332+ * with the character specified by pos, which is length characters in length.
333+ *
334+ * @param pos the offset to the first character of the partial value to
335+ * be retrieved. The first character in the Clob is at position 1.
336+ * @param length the length in characters of the partial value to be retrieved.
337+ * @return <code>Reader</code> through which the partial <code>Clob</code> value can be read.
338+ * @throws SQLException if pos is less than 1 or if pos is greater than the number of
339+ * characters in the <code>Clob</code> or if pos + length is greater than the number of
340+ * characters in the <code>Clob</code>
341+ *
342+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
343+ * this method
344+ * @since 1.6
345+ */
346+ Reader getCharacterStream(long pos, long length) throws SQLException;
347+
348+}
java/pkg/java/sql/Connection.class+0−0

Binary file not shown.

java/pkg/java/sql/Connection.java+1486−0
@@ -0,0 +1,1486 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.Properties;
29+import java.util.concurrent.Executor;
30+
31+/**
32+ * <P>A connection (session) with a specific
33+ * database. SQL statements are executed and results are returned
34+ * within the context of a connection.
35+ * <P>
36+ * A <code>Connection</code> object's database is able to provide information
37+ * describing its tables, its supported SQL grammar, its stored
38+ * procedures, the capabilities of this connection, and so on. This
39+ * information is obtained with the <code>getMetaData</code> method.
40+ *
41+ * <P><B>Note:</B> When configuring a <code>Connection</code>, JDBC applications
42+ * should use the appropriate <code>Connection</code> method such as
43+ * <code>setAutoCommit</code> or <code>setTransactionIsolation</code>.
44+ * Applications should not invoke SQL commands directly to change the connection's
45+ * configuration when there is a JDBC method available. By default a <code>Connection</code> object is in
46+ * auto-commit mode, which means that it automatically commits changes
47+ * after executing each statement. If auto-commit mode has been
48+ * disabled, the method <code>commit</code> must be called explicitly in
49+ * order to commit changes; otherwise, database changes will not be saved.
50+ * <P>
51+ * A new <code>Connection</code> object created using the JDBC 2.1 core API
52+ * has an initially empty type map associated with it. A user may enter a
53+ * custom mapping for a UDT in this type map.
54+ * When a UDT is retrieved from a data source with the
55+ * method <code>ResultSet.getObject</code>, the <code>getObject</code> method
56+ * will check the connection's type map to see if there is an entry for that
57+ * UDT. If so, the <code>getObject</code> method will map the UDT to the
58+ * class indicated. If there is no entry, the UDT will be mapped using the
59+ * standard mapping.
60+ * <p>
61+ * A user may create a new type map, which is a <code>java.util.Map</code>
62+ * object, make an entry in it, and pass it to the <code>java.sql</code>
63+ * methods that can perform custom mapping. In this case, the method
64+ * will use the given type map instead of the one associated with
65+ * the connection.
66+ * <p>
67+ * For example, the following code fragment specifies that the SQL
68+ * type <code>ATHLETES</code> will be mapped to the class
69+ * <code>Athletes</code> in the Java programming language.
70+ * The code fragment retrieves the type map for the <code>Connection
71+ * </code> object <code>con</code>, inserts the entry into it, and then sets
72+ * the type map with the new entry as the connection's type map.
73+ * <pre>
74+ * java.util.Map map = con.getTypeMap();
75+ * map.put("mySchemaName.ATHLETES", Class.forName("Athletes"));
76+ * con.setTypeMap(map);
77+ * </pre>
78+ *
79+ * @see DriverManager#getConnection
80+ * @see Statement
81+ * @see ResultSet
82+ * @see DatabaseMetaData
83+ */
84+public interface Connection extends Wrapper, AutoCloseable {
85+
86+ /**
87+ * Creates a <code>Statement</code> object for sending
88+ * SQL statements to the database.
89+ * SQL statements without parameters are normally
90+ * executed using <code>Statement</code> objects. If the same SQL statement
91+ * is executed many times, it may be more efficient to use a
92+ * <code>PreparedStatement</code> object.
93+ * <P>
94+ * Result sets created using the returned <code>Statement</code>
95+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
96+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
97+ * The holdability of the created result sets can be determined by
98+ * calling {@link #getHoldability}.
99+ *
100+ * @return a new default <code>Statement</code> object
101+ * @exception SQLException if a database access error occurs
102+ * or this method is called on a closed connection
103+ */
104+ Statement createStatement() throws SQLException;
105+
106+ /**
107+ * Creates a <code>PreparedStatement</code> object for sending
108+ * parameterized SQL statements to the database.
109+ * <P>
110+ * A SQL statement with or without IN parameters can be
111+ * pre-compiled and stored in a <code>PreparedStatement</code> object. This
112+ * object can then be used to efficiently execute this statement
113+ * multiple times.
114+ *
115+ * <P><B>Note:</B> This method is optimized for handling
116+ * parametric SQL statements that benefit from precompilation. If
117+ * the driver supports precompilation,
118+ * the method <code>prepareStatement</code> will send
119+ * the statement to the database for precompilation. Some drivers
120+ * may not support precompilation. In this case, the statement may
121+ * not be sent to the database until the <code>PreparedStatement</code>
122+ * object is executed. This has no direct effect on users; however, it does
123+ * affect which methods throw certain <code>SQLException</code> objects.
124+ * <P>
125+ * Result sets created using the returned <code>PreparedStatement</code>
126+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
127+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
128+ * The holdability of the created result sets can be determined by
129+ * calling {@link #getHoldability}.
130+ *
131+ * @param sql an SQL statement that may contain one or more '?' IN
132+ * parameter placeholders
133+ * @return a new default <code>PreparedStatement</code> object containing the
134+ * pre-compiled SQL statement
135+ * @exception SQLException if a database access error occurs
136+ * or this method is called on a closed connection
137+ */
138+ PreparedStatement prepareStatement(String sql)
139+ throws SQLException;
140+
141+ /**
142+ * Creates a <code>CallableStatement</code> object for calling
143+ * database stored procedures.
144+ * The <code>CallableStatement</code> object provides
145+ * methods for setting up its IN and OUT parameters, and
146+ * methods for executing the call to a stored procedure.
147+ *
148+ * <P><B>Note:</B> This method is optimized for handling stored
149+ * procedure call statements. Some drivers may send the call
150+ * statement to the database when the method <code>prepareCall</code>
151+ * is done; others
152+ * may wait until the <code>CallableStatement</code> object
153+ * is executed. This has no
154+ * direct effect on users; however, it does affect which method
155+ * throws certain SQLExceptions.
156+ * <P>
157+ * Result sets created using the returned <code>CallableStatement</code>
158+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
159+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
160+ * The holdability of the created result sets can be determined by
161+ * calling {@link #getHoldability}.
162+ *
163+ * @param sql an SQL statement that may contain one or more '?'
164+ * parameter placeholders. Typically this statement is specified using JDBC
165+ * call escape syntax.
166+ * @return a new default <code>CallableStatement</code> object containing the
167+ * pre-compiled SQL statement
168+ * @exception SQLException if a database access error occurs
169+ * or this method is called on a closed connection
170+ */
171+ CallableStatement prepareCall(String sql) throws SQLException;
172+
173+ /**
174+ * Converts the given SQL statement into the system's native SQL grammar.
175+ * A driver may convert the JDBC SQL grammar into its system's
176+ * native SQL grammar prior to sending it. This method returns the
177+ * native form of the statement that the driver would have sent.
178+ *
179+ * @param sql an SQL statement that may contain one or more '?'
180+ * parameter placeholders
181+ * @return the native form of this statement
182+ * @exception SQLException if a database access error occurs
183+ * or this method is called on a closed connection
184+ */
185+ String nativeSQL(String sql) throws SQLException;
186+
187+ /**
188+ * Sets this connection's auto-commit mode to the given state.
189+ * If a connection is in auto-commit mode, then all its SQL
190+ * statements will be executed and committed as individual
191+ * transactions. Otherwise, its SQL statements are grouped into
192+ * transactions that are terminated by a call to either
193+ * the method <code>commit</code> or the method <code>rollback</code>.
194+ * By default, new connections are in auto-commit
195+ * mode.
196+ * <P>
197+ * The commit occurs when the statement completes. The time when the statement
198+ * completes depends on the type of SQL Statement:
199+ * <ul>
200+ * <li>For DML statements, such as Insert, Update or Delete, and DDL statements,
201+ * the statement is complete as soon as it has finished executing.
202+ * <li>For Select statements, the statement is complete when the associated result
203+ * set is closed.
204+ * <li>For <code>CallableStatement</code> objects or for statements that return
205+ * multiple results, the statement is complete
206+ * when all of the associated result sets have been closed, and all update
207+ * counts and output parameters have been retrieved.
208+ *</ul>
209+ * <P>
210+ * <B>NOTE:</B> If this method is called during a transaction and the
211+ * auto-commit mode is changed, the transaction is committed. If
212+ * <code>setAutoCommit</code> is called and the auto-commit mode is
213+ * not changed, the call is a no-op.
214+ *
215+ * @param autoCommit <code>true</code> to enable auto-commit mode;
216+ * <code>false</code> to disable it
217+ * @exception SQLException if a database access error occurs,
218+ * setAutoCommit(true) is called while participating in a distributed transaction,
219+ * or this method is called on a closed connection
220+ * @see #getAutoCommit
221+ */
222+ void setAutoCommit(boolean autoCommit) throws SQLException;
223+
224+ /**
225+ * Retrieves the current auto-commit mode for this <code>Connection</code>
226+ * object.
227+ *
228+ * @return the current state of this <code>Connection</code> object's
229+ * auto-commit mode
230+ * @exception SQLException if a database access error occurs
231+ * or this method is called on a closed connection
232+ * @see #setAutoCommit
233+ */
234+ boolean getAutoCommit() throws SQLException;
235+
236+ /**
237+ * Makes all changes made since the previous
238+ * commit/rollback permanent and releases any database locks
239+ * currently held by this <code>Connection</code> object.
240+ * This method should be
241+ * used only when auto-commit mode has been disabled.
242+ *
243+ * @exception SQLException if a database access error occurs,
244+ * this method is called while participating in a distributed transaction,
245+ * if this method is called on a closed conection or this
246+ * <code>Connection</code> object is in auto-commit mode
247+ * @see #setAutoCommit
248+ */
249+ void commit() throws SQLException;
250+
251+ /**
252+ * Undoes all changes made in the current transaction
253+ * and releases any database locks currently held
254+ * by this <code>Connection</code> object. This method should be
255+ * used only when auto-commit mode has been disabled.
256+ *
257+ * @exception SQLException if a database access error occurs,
258+ * this method is called while participating in a distributed transaction,
259+ * this method is called on a closed connection or this
260+ * <code>Connection</code> object is in auto-commit mode
261+ * @see #setAutoCommit
262+ */
263+ void rollback() throws SQLException;
264+
265+ /**
266+ * Releases this <code>Connection</code> object's database and JDBC resources
267+ * immediately instead of waiting for them to be automatically released.
268+ * <P>
269+ * Calling the method <code>close</code> on a <code>Connection</code>
270+ * object that is already closed is a no-op.
271+ * <P>
272+ * It is <b>strongly recommended</b> that an application explicitly
273+ * commits or rolls back an active transaction prior to calling the
274+ * <code>close</code> method. If the <code>close</code> method is called
275+ * and there is an active transaction, the results are implementation-defined.
276+ * <P>
277+ *
278+ * @exception SQLException SQLException if a database access error occurs
279+ */
280+ void close() throws SQLException;
281+
282+ /**
283+ * Retrieves whether this <code>Connection</code> object has been
284+ * closed. A connection is closed if the method <code>close</code>
285+ * has been called on it or if certain fatal errors have occurred.
286+ * This method is guaranteed to return <code>true</code> only when
287+ * it is called after the method <code>Connection.close</code> has
288+ * been called.
289+ * <P>
290+ * This method generally cannot be called to determine whether a
291+ * connection to a database is valid or invalid. A typical client
292+ * can determine that a connection is invalid by catching any
293+ * exceptions that might be thrown when an operation is attempted.
294+ *
295+ * @return <code>true</code> if this <code>Connection</code> object
296+ * is closed; <code>false</code> if it is still open
297+ * @exception SQLException if a database access error occurs
298+ */
299+ boolean isClosed() throws SQLException;
300+
301+ //======================================================================
302+ // Advanced features:
303+
304+ /**
305+ * Retrieves a <code>DatabaseMetaData</code> object that contains
306+ * metadata about the database to which this
307+ * <code>Connection</code> object represents a connection.
308+ * The metadata includes information about the database's
309+ * tables, its supported SQL grammar, its stored
310+ * procedures, the capabilities of this connection, and so on.
311+ *
312+ * @return a <code>DatabaseMetaData</code> object for this
313+ * <code>Connection</code> object
314+ * @exception SQLException if a database access error occurs
315+ * or this method is called on a closed connection
316+ */
317+ DatabaseMetaData getMetaData() throws SQLException;
318+
319+ /**
320+ * Puts this connection in read-only mode as a hint to the driver to enable
321+ * database optimizations.
322+ *
323+ * <P><B>Note:</B> This method cannot be called during a transaction.
324+ *
325+ * @param readOnly <code>true</code> enables read-only mode;
326+ * <code>false</code> disables it
327+ * @exception SQLException if a database access error occurs, this
328+ * method is called on a closed connection or this
329+ * method is called during a transaction
330+ */
331+ void setReadOnly(boolean readOnly) throws SQLException;
332+
333+ /**
334+ * Retrieves whether this <code>Connection</code>
335+ * object is in read-only mode.
336+ *
337+ * @return <code>true</code> if this <code>Connection</code> object
338+ * is read-only; <code>false</code> otherwise
339+ * @exception SQLException SQLException if a database access error occurs
340+ * or this method is called on a closed connection
341+ */
342+ boolean isReadOnly() throws SQLException;
343+
344+ /**
345+ * Sets the given catalog name in order to select
346+ * a subspace of this <code>Connection</code> object's database
347+ * in which to work.
348+ * <P>
349+ * If the driver does not support catalogs, it will
350+ * silently ignore this request.
351+ * <p>
352+ * Calling {@code setCatalog} has no effect on previously created or prepared
353+ * {@code Statement} objects. It is implementation defined whether a DBMS
354+ * prepare operation takes place immediately when the {@code Connection}
355+ * method {@code prepareStatement} or {@code prepareCall} is invoked.
356+ * For maximum portability, {@code setCatalog} should be called before a
357+ * {@code Statement} is created or prepared.
358+ *
359+ * @param catalog the name of a catalog (subspace in this
360+ * <code>Connection</code> object's database) in which to work
361+ * @exception SQLException if a database access error occurs
362+ * or this method is called on a closed connection
363+ * @see #getCatalog
364+ */
365+ void setCatalog(String catalog) throws SQLException;
366+
367+ /**
368+ * Retrieves this <code>Connection</code> object's current catalog name.
369+ *
370+ * @return the current catalog name or <code>null</code> if there is none
371+ * @exception SQLException if a database access error occurs
372+ * or this method is called on a closed connection
373+ * @see #setCatalog
374+ */
375+ String getCatalog() throws SQLException;
376+
377+ /**
378+ * A constant indicating that transactions are not supported.
379+ */
380+ int TRANSACTION_NONE = 0;
381+
382+ /**
383+ * A constant indicating that
384+ * dirty reads, non-repeatable reads and phantom reads can occur.
385+ * This level allows a row changed by one transaction to be read
386+ * by another transaction before any changes in that row have been
387+ * committed (a "dirty read"). If any of the changes are rolled back,
388+ * the second transaction will have retrieved an invalid row.
389+ */
390+ int TRANSACTION_READ_UNCOMMITTED = 1;
391+
392+ /**
393+ * A constant indicating that
394+ * dirty reads are prevented; non-repeatable reads and phantom
395+ * reads can occur. This level only prohibits a transaction
396+ * from reading a row with uncommitted changes in it.
397+ */
398+ int TRANSACTION_READ_COMMITTED = 2;
399+
400+ /**
401+ * A constant indicating that
402+ * dirty reads and non-repeatable reads are prevented; phantom
403+ * reads can occur. This level prohibits a transaction from
404+ * reading a row with uncommitted changes in it, and it also
405+ * prohibits the situation where one transaction reads a row,
406+ * a second transaction alters the row, and the first transaction
407+ * rereads the row, getting different values the second time
408+ * (a "non-repeatable read").
409+ */
410+ int TRANSACTION_REPEATABLE_READ = 4;
411+
412+ /**
413+ * A constant indicating that
414+ * dirty reads, non-repeatable reads and phantom reads are prevented.
415+ * This level includes the prohibitions in
416+ * <code>TRANSACTION_REPEATABLE_READ</code> and further prohibits the
417+ * situation where one transaction reads all rows that satisfy
418+ * a <code>WHERE</code> condition, a second transaction inserts a row that
419+ * satisfies that <code>WHERE</code> condition, and the first transaction
420+ * rereads for the same condition, retrieving the additional
421+ * "phantom" row in the second read.
422+ */
423+ int TRANSACTION_SERIALIZABLE = 8;
424+
425+ /**
426+ * Attempts to change the transaction isolation level for this
427+ * <code>Connection</code> object to the one given.
428+ * The constants defined in the interface <code>Connection</code>
429+ * are the possible transaction isolation levels.
430+ * <P>
431+ * <B>Note:</B> If this method is called during a transaction, the result
432+ * is implementation-defined.
433+ *
434+ * @param level one of the following <code>Connection</code> constants:
435+ * <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
436+ * <code>Connection.TRANSACTION_READ_COMMITTED</code>,
437+ * <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
438+ * <code>Connection.TRANSACTION_SERIALIZABLE</code>.
439+ * (Note that <code>Connection.TRANSACTION_NONE</code> cannot be used
440+ * because it specifies that transactions are not supported.)
441+ * @exception SQLException if a database access error occurs, this
442+ * method is called on a closed connection
443+ * or the given parameter is not one of the <code>Connection</code>
444+ * constants
445+ * @see DatabaseMetaData#supportsTransactionIsolationLevel
446+ * @see #getTransactionIsolation
447+ */
448+ void setTransactionIsolation(int level) throws SQLException;
449+
450+ /**
451+ * Retrieves this <code>Connection</code> object's current
452+ * transaction isolation level.
453+ *
454+ * @return the current transaction isolation level, which will be one
455+ * of the following constants:
456+ * <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
457+ * <code>Connection.TRANSACTION_READ_COMMITTED</code>,
458+ * <code>Connection.TRANSACTION_REPEATABLE_READ</code>,
459+ * <code>Connection.TRANSACTION_SERIALIZABLE</code>, or
460+ * <code>Connection.TRANSACTION_NONE</code>.
461+ * @exception SQLException if a database access error occurs
462+ * or this method is called on a closed connection
463+ * @see #setTransactionIsolation
464+ */
465+ int getTransactionIsolation() throws SQLException;
466+
467+ /**
468+ * Retrieves the first warning reported by calls on this
469+ * <code>Connection</code> object. If there is more than one
470+ * warning, subsequent warnings will be chained to the first one
471+ * and can be retrieved by calling the method
472+ * <code>SQLWarning.getNextWarning</code> on the warning
473+ * that was retrieved previously.
474+ * <P>
475+ * This method may not be
476+ * called on a closed connection; doing so will cause an
477+ * <code>SQLException</code> to be thrown.
478+ *
479+ * <P><B>Note:</B> Subsequent warnings will be chained to this
480+ * SQLWarning.
481+ *
482+ * @return the first <code>SQLWarning</code> object or <code>null</code>
483+ * if there are none
484+ * @exception SQLException if a database access error occurs or
485+ * this method is called on a closed connection
486+ * @see SQLWarning
487+ */
488+ SQLWarning getWarnings() throws SQLException;
489+
490+ /**
491+ * Clears all warnings reported for this <code>Connection</code> object.
492+ * After a call to this method, the method <code>getWarnings</code>
493+ * returns <code>null</code> until a new warning is
494+ * reported for this <code>Connection</code> object.
495+ *
496+ * @exception SQLException SQLException if a database access error occurs
497+ * or this method is called on a closed connection
498+ */
499+ void clearWarnings() throws SQLException;
500+
501+
502+ //--------------------------JDBC 2.0-----------------------------
503+
504+ /**
505+ * Creates a <code>Statement</code> object that will generate
506+ * <code>ResultSet</code> objects with the given type and concurrency.
507+ * This method is the same as the <code>createStatement</code> method
508+ * above, but it allows the default result set
509+ * type and concurrency to be overridden.
510+ * The holdability of the created result sets can be determined by
511+ * calling {@link #getHoldability}.
512+ *
513+ * @param resultSetType a result set type; one of
514+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
515+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
516+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
517+ * @param resultSetConcurrency a concurrency type; one of
518+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
519+ * <code>ResultSet.CONCUR_UPDATABLE</code>
520+ * @return a new <code>Statement</code> object that will generate
521+ * <code>ResultSet</code> objects with the given type and
522+ * concurrency
523+ * @exception SQLException if a database access error occurs, this
524+ * method is called on a closed connection
525+ * or the given parameters are not <code>ResultSet</code>
526+ * constants indicating type and concurrency
527+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
528+ * this method or this method is not supported for the specified result
529+ * set type and result set concurrency.
530+ * @since 1.2
531+ */
532+ Statement createStatement(int resultSetType, int resultSetConcurrency)
533+ throws SQLException;
534+
535+ /**
536+ *
537+ * Creates a <code>PreparedStatement</code> object that will generate
538+ * <code>ResultSet</code> objects with the given type and concurrency.
539+ * This method is the same as the <code>prepareStatement</code> method
540+ * above, but it allows the default result set
541+ * type and concurrency to be overridden.
542+ * The holdability of the created result sets can be determined by
543+ * calling {@link #getHoldability}.
544+ *
545+ * @param sql a <code>String</code> object that is the SQL statement to
546+ * be sent to the database; may contain one or more '?' IN
547+ * parameters
548+ * @param resultSetType a result set type; one of
549+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
550+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
551+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
552+ * @param resultSetConcurrency a concurrency type; one of
553+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
554+ * <code>ResultSet.CONCUR_UPDATABLE</code>
555+ * @return a new PreparedStatement object containing the
556+ * pre-compiled SQL statement that will produce <code>ResultSet</code>
557+ * objects with the given type and concurrency
558+ * @exception SQLException if a database access error occurs, this
559+ * method is called on a closed connection
560+ * or the given parameters are not <code>ResultSet</code>
561+ * constants indicating type and concurrency
562+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
563+ * this method or this method is not supported for the specified result
564+ * set type and result set concurrency.
565+ * @since 1.2
566+ */
567+ PreparedStatement prepareStatement(String sql, int resultSetType,
568+ int resultSetConcurrency)
569+ throws SQLException;
570+
571+ /**
572+ * Creates a <code>CallableStatement</code> object that will generate
573+ * <code>ResultSet</code> objects with the given type and concurrency.
574+ * This method is the same as the <code>prepareCall</code> method
575+ * above, but it allows the default result set
576+ * type and concurrency to be overridden.
577+ * The holdability of the created result sets can be determined by
578+ * calling {@link #getHoldability}.
579+ *
580+ * @param sql a <code>String</code> object that is the SQL statement to
581+ * be sent to the database; may contain on or more '?' parameters
582+ * @param resultSetType a result set type; one of
583+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
584+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
585+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
586+ * @param resultSetConcurrency a concurrency type; one of
587+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
588+ * <code>ResultSet.CONCUR_UPDATABLE</code>
589+ * @return a new <code>CallableStatement</code> object containing the
590+ * pre-compiled SQL statement that will produce <code>ResultSet</code>
591+ * objects with the given type and concurrency
592+ * @exception SQLException if a database access error occurs, this method
593+ * is called on a closed connection
594+ * or the given parameters are not <code>ResultSet</code>
595+ * constants indicating type and concurrency
596+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
597+ * this method or this method is not supported for the specified result
598+ * set type and result set concurrency.
599+ * @since 1.2
600+ */
601+ CallableStatement prepareCall(String sql, int resultSetType,
602+ int resultSetConcurrency) throws SQLException;
603+
604+ /**
605+ * Retrieves the <code>Map</code> object associated with this
606+ * <code>Connection</code> object.
607+ * Unless the application has added an entry, the type map returned
608+ * will be empty.
609+ * <p>
610+ * You must invoke <code>setTypeMap</code> after making changes to the
611+ * <code>Map</code> object returned from
612+ * <code>getTypeMap</code> as a JDBC driver may create an internal
613+ * copy of the <code>Map</code> object passed to <code>setTypeMap</code>:
614+ * <p>
615+ * <pre>
616+ * Map&lt;String,Class&lt;?&gt;&gt; myMap = con.getTypeMap();
617+ * myMap.put("mySchemaName.ATHLETES", Athletes.class);
618+ * con.setTypeMap(myMap);
619+ * </pre>
620+ * @return the <code>java.util.Map</code> object associated
621+ * with this <code>Connection</code> object
622+ * @exception SQLException if a database access error occurs
623+ * or this method is called on a closed connection
624+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
625+ * this method
626+ * @since 1.2
627+ * @see #setTypeMap
628+ */
629+ java.util.Map<String,Class<?>> getTypeMap() throws SQLException;
630+
631+ /**
632+ * Installs the given <code>TypeMap</code> object as the type map for
633+ * this <code>Connection</code> object. The type map will be used for the
634+ * custom mapping of SQL structured types and distinct types.
635+ *<p>
636+ * You must set the the values for the <code>TypeMap</code> prior to
637+ * callng <code>setMap</code> as a JDBC driver may create an internal copy
638+ * of the <code>TypeMap</code>:
639+ * <p>
640+ * <pre>
641+ * Map myMap&lt;String,Class&lt;?&gt;&gt; = new HashMap&lt;String,Class&lt;?&gt;&gt;();
642+ * myMap.put("mySchemaName.ATHLETES", Athletes.class);
643+ * con.setTypeMap(myMap);
644+ * </pre>
645+ * @param map the <code>java.util.Map</code> object to install
646+ * as the replacement for this <code>Connection</code>
647+ * object's default type map
648+ * @exception SQLException if a database access error occurs, this
649+ * method is called on a closed connection or
650+ * the given parameter is not a <code>java.util.Map</code>
651+ * object
652+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
653+ * this method
654+ * @since 1.2
655+ * @see #getTypeMap
656+ */
657+ void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException;
658+
659+ //--------------------------JDBC 3.0-----------------------------
660+
661+
662+ /**
663+ * Changes the default holdability of <code>ResultSet</code> objects
664+ * created using this <code>Connection</code> object to the given
665+ * holdability. The default holdability of <code>ResultSet</code> objects
666+ * can be be determined by invoking
667+ * {@link DatabaseMetaData#getResultSetHoldability}.
668+ *
669+ * @param holdability a <code>ResultSet</code> holdability constant; one of
670+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
671+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
672+ * @throws SQLException if a database access occurs, this method is called
673+ * on a closed connection, or the given parameter
674+ * is not a <code>ResultSet</code> constant indicating holdability
675+ * @exception SQLFeatureNotSupportedException if the given holdability is not supported
676+ * @see #getHoldability
677+ * @see DatabaseMetaData#getResultSetHoldability
678+ * @see ResultSet
679+ * @since 1.4
680+ */
681+ void setHoldability(int holdability) throws SQLException;
682+
683+ /**
684+ * Retrieves the current holdability of <code>ResultSet</code> objects
685+ * created using this <code>Connection</code> object.
686+ *
687+ * @return the holdability, one of
688+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
689+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
690+ * @throws SQLException if a database access error occurs
691+ * or this method is called on a closed connection
692+ * @see #setHoldability
693+ * @see DatabaseMetaData#getResultSetHoldability
694+ * @see ResultSet
695+ * @since 1.4
696+ */
697+ int getHoldability() throws SQLException;
698+
699+ /**
700+ * Creates an unnamed savepoint in the current transaction and
701+ * returns the new <code>Savepoint</code> object that represents it.
702+ *
703+ *<p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created
704+ *savepoint.
705+ *
706+ * @return the new <code>Savepoint</code> object
707+ * @exception SQLException if a database access error occurs,
708+ * this method is called while participating in a distributed transaction,
709+ * this method is called on a closed connection
710+ * or this <code>Connection</code> object is currently in
711+ * auto-commit mode
712+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
713+ * this method
714+ * @see Savepoint
715+ * @since 1.4
716+ */
717+ Savepoint setSavepoint() throws SQLException;
718+
719+ /**
720+ * Creates a savepoint with the given name in the current transaction
721+ * and returns the new <code>Savepoint</code> object that represents it.
722+ *
723+ * <p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created
724+ *savepoint.
725+ *
726+ * @param name a <code>String</code> containing the name of the savepoint
727+ * @return the new <code>Savepoint</code> object
728+ * @exception SQLException if a database access error occurs,
729+ * this method is called while participating in a distributed transaction,
730+ * this method is called on a closed connection
731+ * or this <code>Connection</code> object is currently in
732+ * auto-commit mode
733+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
734+ * this method
735+ * @see Savepoint
736+ * @since 1.4
737+ */
738+ Savepoint setSavepoint(String name) throws SQLException;
739+
740+ /**
741+ * Undoes all changes made after the given <code>Savepoint</code> object
742+ * was set.
743+ * <P>
744+ * This method should be used only when auto-commit has been disabled.
745+ *
746+ * @param savepoint the <code>Savepoint</code> object to roll back to
747+ * @exception SQLException if a database access error occurs,
748+ * this method is called while participating in a distributed transaction,
749+ * this method is called on a closed connection,
750+ * the <code>Savepoint</code> object is no longer valid,
751+ * or this <code>Connection</code> object is currently in
752+ * auto-commit mode
753+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
754+ * this method
755+ * @see Savepoint
756+ * @see #rollback
757+ * @since 1.4
758+ */
759+ void rollback(Savepoint savepoint) throws SQLException;
760+
761+ /**
762+ * Removes the specified <code>Savepoint</code> and subsequent <code>Savepoint</code> objects from the current
763+ * transaction. Any reference to the savepoint after it have been removed
764+ * will cause an <code>SQLException</code> to be thrown.
765+ *
766+ * @param savepoint the <code>Savepoint</code> object to be removed
767+ * @exception SQLException if a database access error occurs, this
768+ * method is called on a closed connection or
769+ * the given <code>Savepoint</code> object is not a valid
770+ * savepoint in the current transaction
771+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
772+ * this method
773+ * @since 1.4
774+ */
775+ void releaseSavepoint(Savepoint savepoint) throws SQLException;
776+
777+ /**
778+ * Creates a <code>Statement</code> object that will generate
779+ * <code>ResultSet</code> objects with the given type, concurrency,
780+ * and holdability.
781+ * This method is the same as the <code>createStatement</code> method
782+ * above, but it allows the default result set
783+ * type, concurrency, and holdability to be overridden.
784+ *
785+ * @param resultSetType one of the following <code>ResultSet</code>
786+ * constants:
787+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
788+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
789+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
790+ * @param resultSetConcurrency one of the following <code>ResultSet</code>
791+ * constants:
792+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
793+ * <code>ResultSet.CONCUR_UPDATABLE</code>
794+ * @param resultSetHoldability one of the following <code>ResultSet</code>
795+ * constants:
796+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
797+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
798+ * @return a new <code>Statement</code> object that will generate
799+ * <code>ResultSet</code> objects with the given type,
800+ * concurrency, and holdability
801+ * @exception SQLException if a database access error occurs, this
802+ * method is called on a closed connection
803+ * or the given parameters are not <code>ResultSet</code>
804+ * constants indicating type, concurrency, and holdability
805+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
806+ * this method or this method is not supported for the specified result
807+ * set type, result set holdability and result set concurrency.
808+ * @see ResultSet
809+ * @since 1.4
810+ */
811+ Statement createStatement(int resultSetType, int resultSetConcurrency,
812+ int resultSetHoldability) throws SQLException;
813+
814+ /**
815+ * Creates a <code>PreparedStatement</code> object that will generate
816+ * <code>ResultSet</code> objects with the given type, concurrency,
817+ * and holdability.
818+ * <P>
819+ * This method is the same as the <code>prepareStatement</code> method
820+ * above, but it allows the default result set
821+ * type, concurrency, and holdability to be overridden.
822+ *
823+ * @param sql a <code>String</code> object that is the SQL statement to
824+ * be sent to the database; may contain one or more '?' IN
825+ * parameters
826+ * @param resultSetType one of the following <code>ResultSet</code>
827+ * constants:
828+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
829+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
830+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
831+ * @param resultSetConcurrency one of the following <code>ResultSet</code>
832+ * constants:
833+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
834+ * <code>ResultSet.CONCUR_UPDATABLE</code>
835+ * @param resultSetHoldability one of the following <code>ResultSet</code>
836+ * constants:
837+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
838+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
839+ * @return a new <code>PreparedStatement</code> object, containing the
840+ * pre-compiled SQL statement, that will generate
841+ * <code>ResultSet</code> objects with the given type,
842+ * concurrency, and holdability
843+ * @exception SQLException if a database access error occurs, this
844+ * method is called on a closed connection
845+ * or the given parameters are not <code>ResultSet</code>
846+ * constants indicating type, concurrency, and holdability
847+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
848+ * this method or this method is not supported for the specified result
849+ * set type, result set holdability and result set concurrency.
850+ * @see ResultSet
851+ * @since 1.4
852+ */
853+ PreparedStatement prepareStatement(String sql, int resultSetType,
854+ int resultSetConcurrency, int resultSetHoldability)
855+ throws SQLException;
856+
857+ /**
858+ * Creates a <code>CallableStatement</code> object that will generate
859+ * <code>ResultSet</code> objects with the given type and concurrency.
860+ * This method is the same as the <code>prepareCall</code> method
861+ * above, but it allows the default result set
862+ * type, result set concurrency type and holdability to be overridden.
863+ *
864+ * @param sql a <code>String</code> object that is the SQL statement to
865+ * be sent to the database; may contain on or more '?' parameters
866+ * @param resultSetType one of the following <code>ResultSet</code>
867+ * constants:
868+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
869+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
870+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
871+ * @param resultSetConcurrency one of the following <code>ResultSet</code>
872+ * constants:
873+ * <code>ResultSet.CONCUR_READ_ONLY</code> or
874+ * <code>ResultSet.CONCUR_UPDATABLE</code>
875+ * @param resultSetHoldability one of the following <code>ResultSet</code>
876+ * constants:
877+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
878+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
879+ * @return a new <code>CallableStatement</code> object, containing the
880+ * pre-compiled SQL statement, that will generate
881+ * <code>ResultSet</code> objects with the given type,
882+ * concurrency, and holdability
883+ * @exception SQLException if a database access error occurs, this
884+ * method is called on a closed connection
885+ * or the given parameters are not <code>ResultSet</code>
886+ * constants indicating type, concurrency, and holdability
887+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
888+ * this method or this method is not supported for the specified result
889+ * set type, result set holdability and result set concurrency.
890+ * @see ResultSet
891+ * @since 1.4
892+ */
893+ CallableStatement prepareCall(String sql, int resultSetType,
894+ int resultSetConcurrency,
895+ int resultSetHoldability) throws SQLException;
896+
897+
898+ /**
899+ * Creates a default <code>PreparedStatement</code> object that has
900+ * the capability to retrieve auto-generated keys. The given constant
901+ * tells the driver whether it should make auto-generated keys
902+ * available for retrieval. This parameter is ignored if the SQL statement
903+ * is not an <code>INSERT</code> statement, or an SQL statement able to return
904+ * auto-generated keys (the list of such statements is vendor-specific).
905+ * <P>
906+ * <B>Note:</B> This method is optimized for handling
907+ * parametric SQL statements that benefit from precompilation. If
908+ * the driver supports precompilation,
909+ * the method <code>prepareStatement</code> will send
910+ * the statement to the database for precompilation. Some drivers
911+ * may not support precompilation. In this case, the statement may
912+ * not be sent to the database until the <code>PreparedStatement</code>
913+ * object is executed. This has no direct effect on users; however, it does
914+ * affect which methods throw certain SQLExceptions.
915+ * <P>
916+ * Result sets created using the returned <code>PreparedStatement</code>
917+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
918+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
919+ * The holdability of the created result sets can be determined by
920+ * calling {@link #getHoldability}.
921+ *
922+ * @param sql an SQL statement that may contain one or more '?' IN
923+ * parameter placeholders
924+ * @param autoGeneratedKeys a flag indicating whether auto-generated keys
925+ * should be returned; one of
926+ * <code>Statement.RETURN_GENERATED_KEYS</code> or
927+ * <code>Statement.NO_GENERATED_KEYS</code>
928+ * @return a new <code>PreparedStatement</code> object, containing the
929+ * pre-compiled SQL statement, that will have the capability of
930+ * returning auto-generated keys
931+ * @exception SQLException if a database access error occurs, this
932+ * method is called on a closed connection
933+ * or the given parameter is not a <code>Statement</code>
934+ * constant indicating whether auto-generated keys should be
935+ * returned
936+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
937+ * this method with a constant of Statement.RETURN_GENERATED_KEYS
938+ * @since 1.4
939+ */
940+ PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
941+ throws SQLException;
942+
943+ /**
944+ * Creates a default <code>PreparedStatement</code> object capable
945+ * of returning the auto-generated keys designated by the given array.
946+ * This array contains the indexes of the columns in the target
947+ * table that contain the auto-generated keys that should be made
948+ * available. The driver will ignore the array if the SQL statement
949+ * is not an <code>INSERT</code> statement, or an SQL statement able to return
950+ * auto-generated keys (the list of such statements is vendor-specific).
951+ *<p>
952+ * An SQL statement with or without IN parameters can be
953+ * pre-compiled and stored in a <code>PreparedStatement</code> object. This
954+ * object can then be used to efficiently execute this statement
955+ * multiple times.
956+ * <P>
957+ * <B>Note:</B> This method is optimized for handling
958+ * parametric SQL statements that benefit from precompilation. If
959+ * the driver supports precompilation,
960+ * the method <code>prepareStatement</code> will send
961+ * the statement to the database for precompilation. Some drivers
962+ * may not support precompilation. In this case, the statement may
963+ * not be sent to the database until the <code>PreparedStatement</code>
964+ * object is executed. This has no direct effect on users; however, it does
965+ * affect which methods throw certain SQLExceptions.
966+ * <P>
967+ * Result sets created using the returned <code>PreparedStatement</code>
968+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
969+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
970+ * The holdability of the created result sets can be determined by
971+ * calling {@link #getHoldability}.
972+ *
973+ * @param sql an SQL statement that may contain one or more '?' IN
974+ * parameter placeholders
975+ * @param columnIndexes an array of column indexes indicating the columns
976+ * that should be returned from the inserted row or rows
977+ * @return a new <code>PreparedStatement</code> object, containing the
978+ * pre-compiled statement, that is capable of returning the
979+ * auto-generated keys designated by the given array of column
980+ * indexes
981+ * @exception SQLException if a database access error occurs
982+ * or this method is called on a closed connection
983+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
984+ * this method
985+ *
986+ * @since 1.4
987+ */
988+ PreparedStatement prepareStatement(String sql, int columnIndexes[])
989+ throws SQLException;
990+
991+ /**
992+ * Creates a default <code>PreparedStatement</code> object capable
993+ * of returning the auto-generated keys designated by the given array.
994+ * This array contains the names of the columns in the target
995+ * table that contain the auto-generated keys that should be returned.
996+ * The driver will ignore the array if the SQL statement
997+ * is not an <code>INSERT</code> statement, or an SQL statement able to return
998+ * auto-generated keys (the list of such statements is vendor-specific).
999+ * <P>
1000+ * An SQL statement with or without IN parameters can be
1001+ * pre-compiled and stored in a <code>PreparedStatement</code> object. This
1002+ * object can then be used to efficiently execute this statement
1003+ * multiple times.
1004+ * <P>
1005+ * <B>Note:</B> This method is optimized for handling
1006+ * parametric SQL statements that benefit from precompilation. If
1007+ * the driver supports precompilation,
1008+ * the method <code>prepareStatement</code> will send
1009+ * the statement to the database for precompilation. Some drivers
1010+ * may not support precompilation. In this case, the statement may
1011+ * not be sent to the database until the <code>PreparedStatement</code>
1012+ * object is executed. This has no direct effect on users; however, it does
1013+ * affect which methods throw certain SQLExceptions.
1014+ * <P>
1015+ * Result sets created using the returned <code>PreparedStatement</code>
1016+ * object will by default be type <code>TYPE_FORWARD_ONLY</code>
1017+ * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
1018+ * The holdability of the created result sets can be determined by
1019+ * calling {@link #getHoldability}.
1020+ *
1021+ * @param sql an SQL statement that may contain one or more '?' IN
1022+ * parameter placeholders
1023+ * @param columnNames an array of column names indicating the columns
1024+ * that should be returned from the inserted row or rows
1025+ * @return a new <code>PreparedStatement</code> object, containing the
1026+ * pre-compiled statement, that is capable of returning the
1027+ * auto-generated keys designated by the given array of column
1028+ * names
1029+ * @exception SQLException if a database access error occurs
1030+ * or this method is called on a closed connection
1031+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1032+ * this method
1033+ *
1034+ * @since 1.4
1035+ */
1036+ PreparedStatement prepareStatement(String sql, String columnNames[])
1037+ throws SQLException;
1038+
1039+ /**
1040+ * Constructs an object that implements the <code>Clob</code> interface. The object
1041+ * returned initially contains no data. The <code>setAsciiStream</code>,
1042+ * <code>setCharacterStream</code> and <code>setString</code> methods of
1043+ * the <code>Clob</code> interface may be used to add data to the <code>Clob</code>.
1044+ * @return An object that implements the <code>Clob</code> interface
1045+ * @throws SQLException if an object that implements the
1046+ * <code>Clob</code> interface can not be constructed, this method is
1047+ * called on a closed connection or a database access error occurs.
1048+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1049+ * this data type
1050+ *
1051+ * @since 1.6
1052+ */
1053+ Clob createClob() throws SQLException;
1054+
1055+ /**
1056+ * Constructs an object that implements the <code>Blob</code> interface. The object
1057+ * returned initially contains no data. The <code>setBinaryStream</code> and
1058+ * <code>setBytes</code> methods of the <code>Blob</code> interface may be used to add data to
1059+ * the <code>Blob</code>.
1060+ * @return An object that implements the <code>Blob</code> interface
1061+ * @throws SQLException if an object that implements the
1062+ * <code>Blob</code> interface can not be constructed, this method is
1063+ * called on a closed connection or a database access error occurs.
1064+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1065+ * this data type
1066+ *
1067+ * @since 1.6
1068+ */
1069+ Blob createBlob() throws SQLException;
1070+
1071+ /**
1072+ * Constructs an object that implements the <code>NClob</code> interface. The object
1073+ * returned initially contains no data. The <code>setAsciiStream</code>,
1074+ * <code>setCharacterStream</code> and <code>setString</code> methods of the <code>NClob</code> interface may
1075+ * be used to add data to the <code>NClob</code>.
1076+ * @return An object that implements the <code>NClob</code> interface
1077+ * @throws SQLException if an object that implements the
1078+ * <code>NClob</code> interface can not be constructed, this method is
1079+ * called on a closed connection or a database access error occurs.
1080+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1081+ * this data type
1082+ *
1083+ * @since 1.6
1084+ */
1085+ NClob createNClob() throws SQLException;
1086+
1087+ /**
1088+ * Constructs an object that implements the <code>SQLXML</code> interface. The object
1089+ * returned initially contains no data. The <code>createXmlStreamWriter</code> object and
1090+ * <code>setString</code> method of the <code>SQLXML</code> interface may be used to add data to the <code>SQLXML</code>
1091+ * object.
1092+ * @return An object that implements the <code>SQLXML</code> interface
1093+ * @throws SQLException if an object that implements the <code>SQLXML</code> interface can not
1094+ * be constructed, this method is
1095+ * called on a closed connection or a database access error occurs.
1096+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1097+ * this data type
1098+ * @since 1.6
1099+ */
1100+ SQLXML createSQLXML() throws SQLException;
1101+
1102+ /**
1103+ * Returns true if the connection has not been closed and is still valid.
1104+ * The driver shall submit a query on the connection or use some other
1105+ * mechanism that positively verifies the connection is still valid when
1106+ * this method is called.
1107+ * <p>
1108+ * The query submitted by the driver to validate the connection shall be
1109+ * executed in the context of the current transaction.
1110+ *
1111+ * @param timeout - The time in seconds to wait for the database operation
1112+ * used to validate the connection to complete. If
1113+ * the timeout period expires before the operation
1114+ * completes, this method returns false. A value of
1115+ * 0 indicates a timeout is not applied to the
1116+ * database operation.
1117+ * <p>
1118+ * @return true if the connection is valid, false otherwise
1119+ * @exception SQLException if the value supplied for <code>timeout</code>
1120+ * is less then 0
1121+ * @since 1.6
1122+ * <p>
1123+ * @see java.sql.DatabaseMetaData#getClientInfoProperties
1124+ */
1125+ boolean isValid(int timeout) throws SQLException;
1126+
1127+ /**
1128+ * Sets the value of the client info property specified by name to the
1129+ * value specified by value.
1130+ * <p>
1131+ * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
1132+ * method to determine the client info properties supported by the driver
1133+ * and the maximum length that may be specified for each property.
1134+ * <p>
1135+ * The driver stores the value specified in a suitable location in the
1136+ * database. For example in a special register, session parameter, or
1137+ * system table column. For efficiency the driver may defer setting the
1138+ * value in the database until the next time a statement is executed or
1139+ * prepared. Other than storing the client information in the appropriate
1140+ * place in the database, these methods shall not alter the behavior of
1141+ * the connection in anyway. The values supplied to these methods are
1142+ * used for accounting, diagnostics and debugging purposes only.
1143+ * <p>
1144+ * The driver shall generate a warning if the client info name specified
1145+ * is not recognized by the driver.
1146+ * <p>
1147+ * If the value specified to this method is greater than the maximum
1148+ * length for the property the driver may either truncate the value and
1149+ * generate a warning or generate a <code>SQLClientInfoException</code>. If the driver
1150+ * generates a <code>SQLClientInfoException</code>, the value specified was not set on the
1151+ * connection.
1152+ * <p>
1153+ * The following are standard client info properties. Drivers are not
1154+ * required to support these properties however if the driver supports a
1155+ * client info property that can be described by one of the standard
1156+ * properties, the standard property name should be used.
1157+ * <p>
1158+ * <ul>
1159+ * <li>ApplicationName - The name of the application currently utilizing
1160+ * the connection</li>
1161+ * <li>ClientUser - The name of the user that the application using
1162+ * the connection is performing work for. This may
1163+ * not be the same as the user name that was used
1164+ * in establishing the connection.</li>
1165+ * <li>ClientHostname - The hostname of the computer the application
1166+ * using the connection is running on.</li>
1167+ * </ul>
1168+ * <p>
1169+ * @param name The name of the client info property to set
1170+ * @param value The value to set the client info property to. If the
1171+ * value is null, the current value of the specified
1172+ * property is cleared.
1173+ * <p>
1174+ * @throws SQLClientInfoException if the database server returns an error while
1175+ * setting the client info value on the database server or this method
1176+ * is called on a closed connection
1177+ * <p>
1178+ * @since 1.6
1179+ */
1180+ void setClientInfo(String name, String value)
1181+ throws SQLClientInfoException;
1182+
1183+ /**
1184+ * Sets the value of the connection's client info properties. The
1185+ * <code>Properties</code> object contains the names and values of the client info
1186+ * properties to be set. The set of client info properties contained in
1187+ * the properties list replaces the current set of client info properties
1188+ * on the connection. If a property that is currently set on the
1189+ * connection is not present in the properties list, that property is
1190+ * cleared. Specifying an empty properties list will clear all of the
1191+ * properties on the connection. See <code>setClientInfo (String, String)</code> for
1192+ * more information.
1193+ * <p>
1194+ * If an error occurs in setting any of the client info properties, a
1195+ * <code>SQLClientInfoException</code> is thrown. The <code>SQLClientInfoException</code>
1196+ * contains information indicating which client info properties were not set.
1197+ * The state of the client information is unknown because
1198+ * some databases do not allow multiple client info properties to be set
1199+ * atomically. For those databases, one or more properties may have been
1200+ * set before the error occurred.
1201+ * <p>
1202+ *
1203+ * @param properties the list of client info properties to set
1204+ * <p>
1205+ * @see java.sql.Connection#setClientInfo(String, String) setClientInfo(String, String)
1206+ * @since 1.6
1207+ * <p>
1208+ * @throws SQLClientInfoException if the database server returns an error while
1209+ * setting the clientInfo values on the database server or this method
1210+ * is called on a closed connection
1211+ * <p>
1212+ */
1213+ void setClientInfo(Properties properties)
1214+ throws SQLClientInfoException;
1215+
1216+ /**
1217+ * Returns the value of the client info property specified by name. This
1218+ * method may return null if the specified client info property has not
1219+ * been set and does not have a default value. This method will also
1220+ * return null if the specified client info property name is not supported
1221+ * by the driver.
1222+ * <p>
1223+ * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
1224+ * method to determine the client info properties supported by the driver.
1225+ * <p>
1226+ * @param name The name of the client info property to retrieve
1227+ * <p>
1228+ * @return The value of the client info property specified
1229+ * <p>
1230+ * @throws SQLException if the database server returns an error when
1231+ * fetching the client info value from the database
1232+ *or this method is called on a closed connection
1233+ * <p>
1234+ * @since 1.6
1235+ * <p>
1236+ * @see java.sql.DatabaseMetaData#getClientInfoProperties
1237+ */
1238+ String getClientInfo(String name)
1239+ throws SQLException;
1240+
1241+ /**
1242+ * Returns a list containing the name and current value of each client info
1243+ * property supported by the driver. The value of a client info property
1244+ * may be null if the property has not been set and does not have a
1245+ * default value.
1246+ * <p>
1247+ * @return A <code>Properties</code> object that contains the name and current value of
1248+ * each of the client info properties supported by the driver.
1249+ * <p>
1250+ * @throws SQLException if the database server returns an error when
1251+ * fetching the client info values from the database
1252+ * or this method is called on a closed connection
1253+ * <p>
1254+ * @since 1.6
1255+ */
1256+ Properties getClientInfo()
1257+ throws SQLException;
1258+
1259+/**
1260+ * Factory method for creating Array objects.
1261+ *<p>
1262+ * <b>Note: </b>When <code>createArrayOf</code> is used to create an array object
1263+ * that maps to a primitive data type, then it is implementation-defined
1264+ * whether the <code>Array</code> object is an array of that primitive
1265+ * data type or an array of <code>Object</code>.
1266+ * <p>
1267+ * <b>Note: </b>The JDBC driver is responsible for mapping the elements
1268+ * <code>Object</code> array to the default JDBC SQL type defined in
1269+ * java.sql.Types for the given class of <code>Object</code>. The default
1270+ * mapping is specified in Appendix B of the JDBC specification. If the
1271+ * resulting JDBC type is not the appropriate type for the given typeName then
1272+ * it is implementation defined whether an <code>SQLException</code> is
1273+ * thrown or the driver supports the resulting conversion.
1274+ *
1275+ * @param typeName the SQL name of the type the elements of the array map to. The typeName is a
1276+ * database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This
1277+ * is the value returned by <code>Array.getBaseTypeName</code>
1278+ * @param elements the elements that populate the returned object
1279+ * @return an Array object whose elements map to the specified SQL type
1280+ * @throws SQLException if a database error occurs, the JDBC type is not
1281+ * appropriate for the typeName and the conversion is not supported, the typeName is null or this method is called on a closed connection
1282+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this data type
1283+ * @since 1.6
1284+ */
1285+ Array createArrayOf(String typeName, Object[] elements) throws
1286+SQLException;
1287+
1288+/**
1289+ * Factory method for creating Struct objects.
1290+ *
1291+ * @param typeName the SQL type name of the SQL structured type that this <code>Struct</code>
1292+ * object maps to. The typeName is the name of a user-defined type that
1293+ * has been defined for this database. It is the value returned by
1294+ * <code>Struct.getSQLTypeName</code>.
1295+
1296+ * @param attributes the attributes that populate the returned object
1297+ * @return a Struct object that maps to the given SQL type and is populated with the given attributes
1298+ * @throws SQLException if a database error occurs, the typeName is null or this method is called on a closed connection
1299+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this data type
1300+ * @since 1.6
1301+ */
1302+ Struct createStruct(String typeName, Object[] attributes)
1303+throws SQLException;
1304+
1305+ //--------------------------JDBC 4.1 -----------------------------
1306+
1307+ /**
1308+ * Sets the given schema name to access.
1309+ * <P>
1310+ * If the driver does not support schemas, it will
1311+ * silently ignore this request.
1312+ * <p>
1313+ * Calling {@code setSchema} has no effect on previously created or prepared
1314+ * {@code Statement} objects. It is implementation defined whether a DBMS
1315+ * prepare operation takes place immediately when the {@code Connection}
1316+ * method {@code prepareStatement} or {@code prepareCall} is invoked.
1317+ * For maximum portability, {@code setSchema} should be called before a
1318+ * {@code Statement} is created or prepared.
1319+ *
1320+ * @param schema the name of a schema in which to work
1321+ * @exception SQLException if a database access error occurs
1322+ * or this method is called on a closed connection
1323+ * @see #getSchema
1324+ * @since 1.7
1325+ */
1326+ void setSchema(String schema) throws SQLException;
1327+
1328+ /**
1329+ * Retrieves this <code>Connection</code> object's current schema name.
1330+ *
1331+ * @return the current schema name or <code>null</code> if there is none
1332+ * @exception SQLException if a database access error occurs
1333+ * or this method is called on a closed connection
1334+ * @see #setSchema
1335+ * @since 1.7
1336+ */
1337+ String getSchema() throws SQLException;
1338+
1339+ /**
1340+ * Terminates an open connection. Calling <code>abort</code> results in:
1341+ * <ul>
1342+ * <li>The connection marked as closed
1343+ * <li>Closes any physical connection to the database
1344+ * <li>Releases resources used by the connection
1345+ * <li>Insures that any thread that is currently accessing the connection
1346+ * will either progress to completion or throw an <code>SQLException</code>.
1347+ * </ul>
1348+ * <p>
1349+ * Calling <code>abort</code> marks the connection closed and releases any
1350+ * resources. Calling <code>abort</code> on a closed connection is a
1351+ * no-op.
1352+ * <p>
1353+ * It is possible that the aborting and releasing of the resources that are
1354+ * held by the connection can take an extended period of time. When the
1355+ * <code>abort</code> method returns, the connection will have been marked as
1356+ * closed and the <code>Executor</code> that was passed as a parameter to abort
1357+ * may still be executing tasks to release resources.
1358+ * <p>
1359+ * This method checks to see that there is an <code>SQLPermission</code>
1360+ * object before allowing the method to proceed. If a
1361+ * <code>SecurityManager</code> exists and its
1362+ * <code>checkPermission</code> method denies calling <code>abort</code>,
1363+ * this method throws a
1364+ * <code>java.lang.SecurityException</code>.
1365+ * @param executor The <code>Executor</code> implementation which will
1366+ * be used by <code>abort</code>.
1367+ * @throws java.sql.SQLException if a database access error occurs or
1368+ * the {@code executor} is {@code null},
1369+ * @throws java.lang.SecurityException if a security manager exists and its
1370+ * <code>checkPermission</code> method denies calling <code>abort</code>
1371+ * @see SecurityManager#checkPermission
1372+ * @see Executor
1373+ * @since 1.7
1374+ */
1375+ void abort(Executor executor) throws SQLException;
1376+
1377+ /**
1378+ *
1379+ * Sets the maximum period a <code>Connection</code> or
1380+ * objects created from the <code>Connection</code>
1381+ * will wait for the database to reply to any one request. If any
1382+ * request remains unanswered, the waiting method will
1383+ * return with a <code>SQLException</code>, and the <code>Connection</code>
1384+ * or objects created from the <code>Connection</code> will be marked as
1385+ * closed. Any subsequent use of
1386+ * the objects, with the exception of the <code>close</code>,
1387+ * <code>isClosed</code> or <code>Connection.isValid</code>
1388+ * methods, will result in a <code>SQLException</code>.
1389+ * <p>
1390+ * <b>Note</b>: This method is intended to address a rare but serious
1391+ * condition where network partitions can cause threads issuing JDBC calls
1392+ * to hang uninterruptedly in socket reads, until the OS TCP-TIMEOUT
1393+ * (typically 10 minutes). This method is related to the
1394+ * {@link #abort abort() } method which provides an administrator
1395+ * thread a means to free any such threads in cases where the
1396+ * JDBC connection is accessible to the administrator thread.
1397+ * The <code>setNetworkTimeout</code> method will cover cases where
1398+ * there is no administrator thread, or it has no access to the
1399+ * connection. This method is severe in it's effects, and should be
1400+ * given a high enough value so it is never triggered before any more
1401+ * normal timeouts, such as transaction timeouts.
1402+ * <p>
1403+ * JDBC driver implementations may also choose to support the
1404+ * {@code setNetworkTimeout} method to impose a limit on database
1405+ * response time, in environments where no network is present.
1406+ * <p>
1407+ * Drivers may internally implement some or all of their API calls with
1408+ * multiple internal driver-database transmissions, and it is left to the
1409+ * driver implementation to determine whether the limit will be
1410+ * applied always to the response to the API call, or to any
1411+ * single request made during the API call.
1412+ * <p>
1413+ *
1414+ * This method can be invoked more than once, such as to set a limit for an
1415+ * area of JDBC code, and to reset to the default on exit from this area.
1416+ * Invocation of this method has no impact on already outstanding
1417+ * requests.
1418+ * <p>
1419+ * The {@code Statement.setQueryTimeout()} timeout value is independent of the
1420+ * timeout value specified in {@code setNetworkTimeout}. If the query timeout
1421+ * expires before the network timeout then the
1422+ * statement execution will be canceled. If the network is still
1423+ * active the result will be that both the statement and connection
1424+ * are still usable. However if the network timeout expires before
1425+ * the query timeout or if the statement timeout fails due to network
1426+ * problems, the connection will be marked as closed, any resources held by
1427+ * the connection will be released and both the connection and
1428+ * statement will be unusable.
1429+ *<p>
1430+ * When the driver determines that the {@code setNetworkTimeout} timeout
1431+ * value has expired, the JDBC driver marks the connection
1432+ * closed and releases any resources held by the connection.
1433+ * <p>
1434+ *
1435+ * This method checks to see that there is an <code>SQLPermission</code>
1436+ * object before allowing the method to proceed. If a
1437+ * <code>SecurityManager</code> exists and its
1438+ * <code>checkPermission</code> method denies calling
1439+ * <code>setNetworkTimeout</code>, this method throws a
1440+ * <code>java.lang.SecurityException</code>.
1441+ *
1442+ * @param executor The <code>Executor</code> implementation which will
1443+ * be used by <code>setNetworkTimeout</code>.
1444+ * @param milliseconds The time in milliseconds to wait for the database
1445+ * operation
1446+ * to complete. If the JDBC driver does not support milliseconds, the
1447+ * JDBC driver will round the value up to the nearest second. If the
1448+ * timeout period expires before the operation
1449+ * completes, a SQLException will be thrown.
1450+ * A value of 0 indicates that there is not timeout for database operations.
1451+ * @throws java.sql.SQLException if a database access error occurs, this
1452+ * method is called on a closed connection,
1453+ * the {@code executor} is {@code null},
1454+ * or the value specified for <code>seconds</code> is less than 0.
1455+ * @throws java.lang.SecurityException if a security manager exists and its
1456+ * <code>checkPermission</code> method denies calling
1457+ * <code>setNetworkTimeout</code>.
1458+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1459+ * this method
1460+ * @see SecurityManager#checkPermission
1461+ * @see Statement#setQueryTimeout
1462+ * @see #getNetworkTimeout
1463+ * @see #abort
1464+ * @see Executor
1465+ * @since 1.7
1466+ */
1467+ void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException;
1468+
1469+
1470+ /**
1471+ * Retrieves the number of milliseconds the driver will
1472+ * wait for a database request to complete.
1473+ * If the limit is exceeded, a
1474+ * <code>SQLException</code> is thrown.
1475+ *
1476+ * @return the current timeout limit in milliseconds; zero means there is
1477+ * no limit
1478+ * @throws SQLException if a database access error occurs or
1479+ * this method is called on a closed <code>Connection</code>
1480+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1481+ * this method
1482+ * @see #setNetworkTimeout
1483+ * @since 1.7
1484+ */
1485+ int getNetworkTimeout() throws SQLException;
1486+}
java/pkg/java/sql/DataTruncation.class+0−0

Binary file not shown.

java/pkg/java/sql/DataTruncation.java+188−0
@@ -0,0 +1,188 @@
1+/*
2+ * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * An exception thrown as a <code>DataTruncation</code> exception
30+ * (on writes) or reported as a
31+ * <code>DataTruncation</code> warning (on reads)
32+ * when a data values is unexpectedly truncated for reasons other than its having
33+ * execeeded <code>MaxFieldSize</code>.
34+ *
35+ * <P>The SQLstate for a <code>DataTruncation</code> during read is <code>01004</code>.
36+ * <P>The SQLstate for a <code>DataTruncation</code> during write is <code>22001</code>.
37+ */
38+
39+public class DataTruncation extends SQLWarning {
40+
41+ /**
42+ * Creates a <code>DataTruncation</code> object
43+ * with the SQLState initialized
44+ * to 01004 when <code>read</code> is set to <code>true</code> and 22001
45+ * when <code>read</code> is set to <code>false</code>,
46+ * the reason set to "Data truncation", the
47+ * vendor code set to 0, and
48+ * the other fields set to the given values.
49+ * The <code>cause</code> is not initialized, and may subsequently be
50+ * initialized by a call to the
51+ * {@link Throwable#initCause(java.lang.Throwable)} method.
52+ * <p>
53+ *
54+ * @param index The index of the parameter or column value
55+ * @param parameter true if a parameter value was truncated
56+ * @param read true if a read was truncated
57+ * @param dataSize the original size of the data
58+ * @param transferSize the size after truncation
59+ */
60+ public DataTruncation(int index, boolean parameter,
61+ boolean read, int dataSize,
62+ int transferSize) {
63+ super("Data truncation", read == true?"01004":"22001");
64+ this.index = index;
65+ this.parameter = parameter;
66+ this.read = read;
67+ this.dataSize = dataSize;
68+ this.transferSize = transferSize;
69+
70+ }
71+
72+ /**
73+ * Creates a <code>DataTruncation</code> object
74+ * with the SQLState initialized
75+ * to 01004 when <code>read</code> is set to <code>true</code> and 22001
76+ * when <code>read</code> is set to <code>false</code>,
77+ * the reason set to "Data truncation", the
78+ * vendor code set to 0, and
79+ * the other fields set to the given values.
80+ * <p>
81+ *
82+ * @param index The index of the parameter or column value
83+ * @param parameter true if a parameter value was truncated
84+ * @param read true if a read was truncated
85+ * @param dataSize the original size of the data
86+ * @param transferSize the size after truncation
87+ * @param cause the underlying reason for this <code>DataTruncation</code>
88+ * (which is saved for later retrieval by the <code>getCause()</code> method);
89+ * may be null indicating the cause is non-existent or unknown.
90+ *
91+ * @since 1.6
92+ */
93+ public DataTruncation(int index, boolean parameter,
94+ boolean read, int dataSize,
95+ int transferSize, Throwable cause) {
96+ super("Data truncation", read == true?"01004":"22001",cause);
97+ this.index = index;
98+ this.parameter = parameter;
99+ this.read = read;
100+ this.dataSize = dataSize;
101+ this.transferSize = transferSize;
102+ }
103+
104+ /**
105+ * Retrieves the index of the column or parameter that was truncated.
106+ *
107+ * <P>This may be -1 if the column or parameter index is unknown, in
108+ * which case the <code>parameter</code> and <code>read</code> fields should be ignored.
109+ *
110+ * @return the index of the truncated paramter or column value
111+ */
112+ public int getIndex() {
113+ return index;
114+ }
115+
116+ /**
117+ * Indicates whether the value truncated was a parameter value or
118+ * a column value.
119+ *
120+ * @return <code>true</code> if the value truncated was a parameter;
121+ * <code>false</code> if it was a column value
122+ */
123+ public boolean getParameter() {
124+ return parameter;
125+ }
126+
127+ /**
128+ * Indicates whether or not the value was truncated on a read.
129+ *
130+ * @return <code>true</code> if the value was truncated when read from
131+ * the database; <code>false</code> if the data was truncated on a write
132+ */
133+ public boolean getRead() {
134+ return read;
135+ }
136+
137+ /**
138+ * Gets the number of bytes of data that should have been transferred.
139+ * This number may be approximate if data conversions were being
140+ * performed. The value may be <code>-1</code> if the size is unknown.
141+ *
142+ * @return the number of bytes of data that should have been transferred
143+ */
144+ public int getDataSize() {
145+ return dataSize;
146+ }
147+
148+ /**
149+ * Gets the number of bytes of data actually transferred.
150+ * The value may be <code>-1</code> if the size is unknown.
151+ *
152+ * @return the number of bytes of data actually transferred
153+ */
154+ public int getTransferSize() {
155+ return transferSize;
156+ }
157+
158+ /**
159+ * @serial
160+ */
161+ private int index;
162+
163+ /**
164+ * @serial
165+ */
166+ private boolean parameter;
167+
168+ /**
169+ * @serial
170+ */
171+ private boolean read;
172+
173+ /**
174+ * @serial
175+ */
176+ private int dataSize;
177+
178+ /**
179+ * @serial
180+ */
181+ private int transferSize;
182+
183+ /**
184+ * @serial
185+ */
186+ private static final long serialVersionUID = 6464298989504059473L;
187+
188+}
java/pkg/java/sql/DatabaseMetaData.class+0−0

Binary file not shown.

java/pkg/java/sql/DatabaseMetaData.java+3655−0
@@ -0,0 +1,3655 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+
27+package java.sql;
28+
29+/**
30+ * Comprehensive information about the database as a whole.
31+ * <P>
32+ * This interface is implemented by driver vendors to let users know the capabilities
33+ * of a Database Management System (DBMS) in combination with
34+ * the driver based on JDBC<sup><font size=-2>TM</font></sup> technology
35+ * ("JDBC driver") that is used with it. Different relational DBMSs often support
36+ * different features, implement features in different ways, and use different
37+ * data types. In addition, a driver may implement a feature on top of what the
38+ * DBMS offers. Information returned by methods in this interface applies
39+ * to the capabilities of a particular driver and a particular DBMS working
40+ * together. Note that as used in this documentation, the term "database" is
41+ * used generically to refer to both the driver and DBMS.
42+ * <P>
43+ * A user for this interface is commonly a tool that needs to discover how to
44+ * deal with the underlying DBMS. This is especially true for applications
45+ * that are intended to be used with more than one DBMS. For example, a tool might use the method
46+ * <code>getTypeInfo</code> to find out what data types can be used in a
47+ * <code>CREATE TABLE</code> statement. Or a user might call the method
48+ * <code>supportsCorrelatedSubqueries</code> to see if it is possible to use
49+ * a correlated subquery or <code>supportsBatchUpdates</code> to see if it is
50+ * possible to use batch updates.
51+ * <P>
52+ * Some <code>DatabaseMetaData</code> methods return lists of information
53+ * in the form of <code>ResultSet</code> objects.
54+ * Regular <code>ResultSet</code> methods, such as
55+ * <code>getString</code> and <code>getInt</code>, can be used
56+ * to retrieve the data from these <code>ResultSet</code> objects. If
57+ * a given form of metadata is not available, an empty <code>ResultSet</code>
58+ * will be returned. Additional columns beyond the columns defined to be
59+ * returned by the <code>ResultSet</code> object for a given method
60+ * can be defined by the JDBC driver vendor and must be accessed
61+ * by their <B>column label</B>.
62+ * <P>
63+ * Some <code>DatabaseMetaData</code> methods take arguments that are
64+ * String patterns. These arguments all have names such as fooPattern.
65+ * Within a pattern String, "%" means match any substring of 0 or more
66+ * characters, and "_" means match any one character. Only metadata
67+ * entries matching the search pattern are returned. If a search pattern
68+ * argument is set to <code>null</code>, that argument's criterion will
69+ * be dropped from the search.
70+ * <P>
71+ */
72+public interface DatabaseMetaData extends Wrapper {
73+
74+ //----------------------------------------------------------------------
75+ // First, a variety of minor information about the target database.
76+
77+ /**
78+ * Retrieves whether the current user can call all the procedures
79+ * returned by the method <code>getProcedures</code>.
80+ *
81+ * @return <code>true</code> if so; <code>false</code> otherwise
82+ * @exception SQLException if a database access error occurs
83+ */
84+ boolean allProceduresAreCallable() throws SQLException;
85+
86+ /**
87+ * Retrieves whether the current user can use all the tables returned
88+ * by the method <code>getTables</code> in a <code>SELECT</code>
89+ * statement.
90+ *
91+ * @return <code>true</code> if so; <code>false</code> otherwise
92+ * @exception SQLException if a database access error occurs
93+ */
94+ boolean allTablesAreSelectable() throws SQLException;
95+
96+ /**
97+ * Retrieves the URL for this DBMS.
98+ *
99+ * @return the URL for this DBMS or <code>null</code> if it cannot be
100+ * generated
101+ * @exception SQLException if a database access error occurs
102+ */
103+ String getURL() throws SQLException;
104+
105+ /**
106+ * Retrieves the user name as known to this database.
107+ *
108+ * @return the database user name
109+ * @exception SQLException if a database access error occurs
110+ */
111+ String getUserName() throws SQLException;
112+
113+ /**
114+ * Retrieves whether this database is in read-only mode.
115+ *
116+ * @return <code>true</code> if so; <code>false</code> otherwise
117+ * @exception SQLException if a database access error occurs
118+ */
119+ boolean isReadOnly() throws SQLException;
120+
121+ /**
122+ * Retrieves whether <code>NULL</code> values are sorted high.
123+ * Sorted high means that <code>NULL</code> values
124+ * sort higher than any other value in a domain. In an ascending order,
125+ * if this method returns <code>true</code>, <code>NULL</code> values
126+ * will appear at the end. By contrast, the method
127+ * <code>nullsAreSortedAtEnd</code> indicates whether <code>NULL</code> values
128+ * are sorted at the end regardless of sort order.
129+ *
130+ * @return <code>true</code> if so; <code>false</code> otherwise
131+ * @exception SQLException if a database access error occurs
132+ */
133+ boolean nullsAreSortedHigh() throws SQLException;
134+
135+ /**
136+ * Retrieves whether <code>NULL</code> values are sorted low.
137+ * Sorted low means that <code>NULL</code> values
138+ * sort lower than any other value in a domain. In an ascending order,
139+ * if this method returns <code>true</code>, <code>NULL</code> values
140+ * will appear at the beginning. By contrast, the method
141+ * <code>nullsAreSortedAtStart</code> indicates whether <code>NULL</code> values
142+ * are sorted at the beginning regardless of sort order.
143+ *
144+ * @return <code>true</code> if so; <code>false</code> otherwise
145+ * @exception SQLException if a database access error occurs
146+ */
147+ boolean nullsAreSortedLow() throws SQLException;
148+
149+ /**
150+ * Retrieves whether <code>NULL</code> values are sorted at the start regardless
151+ * of sort order.
152+ *
153+ * @return <code>true</code> if so; <code>false</code> otherwise
154+ * @exception SQLException if a database access error occurs
155+ */
156+ boolean nullsAreSortedAtStart() throws SQLException;
157+
158+ /**
159+ * Retrieves whether <code>NULL</code> values are sorted at the end regardless of
160+ * sort order.
161+ *
162+ * @return <code>true</code> if so; <code>false</code> otherwise
163+ * @exception SQLException if a database access error occurs
164+ */
165+ boolean nullsAreSortedAtEnd() throws SQLException;
166+
167+ /**
168+ * Retrieves the name of this database product.
169+ *
170+ * @return database product name
171+ * @exception SQLException if a database access error occurs
172+ */
173+ String getDatabaseProductName() throws SQLException;
174+
175+ /**
176+ * Retrieves the version number of this database product.
177+ *
178+ * @return database version number
179+ * @exception SQLException if a database access error occurs
180+ */
181+ String getDatabaseProductVersion() throws SQLException;
182+
183+ /**
184+ * Retrieves the name of this JDBC driver.
185+ *
186+ * @return JDBC driver name
187+ * @exception SQLException if a database access error occurs
188+ */
189+ String getDriverName() throws SQLException;
190+
191+ /**
192+ * Retrieves the version number of this JDBC driver as a <code>String</code>.
193+ *
194+ * @return JDBC driver version
195+ * @exception SQLException if a database access error occurs
196+ */
197+ String getDriverVersion() throws SQLException;
198+
199+ /**
200+ * Retrieves this JDBC driver's major version number.
201+ *
202+ * @return JDBC driver major version
203+ */
204+ int getDriverMajorVersion();
205+
206+ /**
207+ * Retrieves this JDBC driver's minor version number.
208+ *
209+ * @return JDBC driver minor version number
210+ */
211+ int getDriverMinorVersion();
212+
213+ /**
214+ * Retrieves whether this database stores tables in a local file.
215+ *
216+ * @return <code>true</code> if so; <code>false</code> otherwise
217+ * @exception SQLException if a database access error occurs
218+ */
219+ boolean usesLocalFiles() throws SQLException;
220+
221+ /**
222+ * Retrieves whether this database uses a file for each table.
223+ *
224+ * @return <code>true</code> if this database uses a local file for each table;
225+ * <code>false</code> otherwise
226+ * @exception SQLException if a database access error occurs
227+ */
228+ boolean usesLocalFilePerTable() throws SQLException;
229+
230+ /**
231+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as
232+ * case sensitive and as a result stores them in mixed case.
233+ *
234+ * @return <code>true</code> if so; <code>false</code> otherwise
235+ * @exception SQLException if a database access error occurs
236+ */
237+ boolean supportsMixedCaseIdentifiers() throws SQLException;
238+
239+ /**
240+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as
241+ * case insensitive and stores them in upper case.
242+ *
243+ * @return <code>true</code> if so; <code>false</code> otherwise
244+ * @exception SQLException if a database access error occurs
245+ */
246+ boolean storesUpperCaseIdentifiers() throws SQLException;
247+
248+ /**
249+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as
250+ * case insensitive and stores them in lower case.
251+ *
252+ * @return <code>true</code> if so; <code>false</code> otherwise
253+ * @exception SQLException if a database access error occurs
254+ */
255+ boolean storesLowerCaseIdentifiers() throws SQLException;
256+
257+ /**
258+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as
259+ * case insensitive and stores them in mixed case.
260+ *
261+ * @return <code>true</code> if so; <code>false</code> otherwise
262+ * @exception SQLException if a database access error occurs
263+ */
264+ boolean storesMixedCaseIdentifiers() throws SQLException;
265+
266+ /**
267+ * Retrieves whether this database treats mixed case quoted SQL identifiers as
268+ * case sensitive and as a result stores them in mixed case.
269+ *
270+ * @return <code>true</code> if so; <code>false</code> otherwise
271+ * @exception SQLException if a database access error occurs
272+ */
273+ boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
274+
275+ /**
276+ * Retrieves whether this database treats mixed case quoted SQL identifiers as
277+ * case insensitive and stores them in upper case.
278+ *
279+ * @return <code>true</code> if so; <code>false</code> otherwise
280+ * @exception SQLException if a database access error occurs
281+ */
282+ boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
283+
284+ /**
285+ * Retrieves whether this database treats mixed case quoted SQL identifiers as
286+ * case insensitive and stores them in lower case.
287+ *
288+ * @return <code>true</code> if so; <code>false</code> otherwise
289+ * @exception SQLException if a database access error occurs
290+ */
291+ boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
292+
293+ /**
294+ * Retrieves whether this database treats mixed case quoted SQL identifiers as
295+ * case insensitive and stores them in mixed case.
296+ *
297+ * @return <code>true</code> if so; <code>false</code> otherwise
298+ * @exception SQLException if a database access error occurs
299+ */
300+ boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
301+
302+ /**
303+ * Retrieves the string used to quote SQL identifiers.
304+ * This method returns a space " " if identifier quoting is not supported.
305+ *
306+ * @return the quoting string or a space if quoting is not supported
307+ * @exception SQLException if a database access error occurs
308+ */
309+ String getIdentifierQuoteString() throws SQLException;
310+
311+ /**
312+ * Retrieves a comma-separated list of all of this database's SQL keywords
313+ * that are NOT also SQL:2003 keywords.
314+ *
315+ * @return the list of this database's keywords that are not also
316+ * SQL:2003 keywords
317+ * @exception SQLException if a database access error occurs
318+ */
319+ String getSQLKeywords() throws SQLException;
320+
321+ /**
322+ * Retrieves a comma-separated list of math functions available with
323+ * this database. These are the Open /Open CLI math function names used in
324+ * the JDBC function escape clause.
325+ *
326+ * @return the list of math functions supported by this database
327+ * @exception SQLException if a database access error occurs
328+ */
329+ String getNumericFunctions() throws SQLException;
330+
331+ /**
332+ * Retrieves a comma-separated list of string functions available with
333+ * this database. These are the Open Group CLI string function names used
334+ * in the JDBC function escape clause.
335+ *
336+ * @return the list of string functions supported by this database
337+ * @exception SQLException if a database access error occurs
338+ */
339+ String getStringFunctions() throws SQLException;
340+
341+ /**
342+ * Retrieves a comma-separated list of system functions available with
343+ * this database. These are the Open Group CLI system function names used
344+ * in the JDBC function escape clause.
345+ *
346+ * @return a list of system functions supported by this database
347+ * @exception SQLException if a database access error occurs
348+ */
349+ String getSystemFunctions() throws SQLException;
350+
351+ /**
352+ * Retrieves a comma-separated list of the time and date functions available
353+ * with this database.
354+ *
355+ * @return the list of time and date functions supported by this database
356+ * @exception SQLException if a database access error occurs
357+ */
358+ String getTimeDateFunctions() throws SQLException;
359+
360+ /**
361+ * Retrieves the string that can be used to escape wildcard characters.
362+ * This is the string that can be used to escape '_' or '%' in
363+ * the catalog search parameters that are a pattern (and therefore use one
364+ * of the wildcard characters).
365+ *
366+ * <P>The '_' character represents any single character;
367+ * the '%' character represents any sequence of zero or
368+ * more characters.
369+ *
370+ * @return the string used to escape wildcard characters
371+ * @exception SQLException if a database access error occurs
372+ */
373+ String getSearchStringEscape() throws SQLException;
374+
375+ /**
376+ * Retrieves all the "extra" characters that can be used in unquoted
377+ * identifier names (those beyond a-z, A-Z, 0-9 and _).
378+ *
379+ * @return the string containing the extra characters
380+ * @exception SQLException if a database access error occurs
381+ */
382+ String getExtraNameCharacters() throws SQLException;
383+
384+ //--------------------------------------------------------------------
385+ // Functions describing which features are supported.
386+
387+ /**
388+ * Retrieves whether this database supports <code>ALTER TABLE</code>
389+ * with add column.
390+ *
391+ * @return <code>true</code> if so; <code>false</code> otherwise
392+ * @exception SQLException if a database access error occurs
393+ */
394+ boolean supportsAlterTableWithAddColumn() throws SQLException;
395+
396+ /**
397+ * Retrieves whether this database supports <code>ALTER TABLE</code>
398+ * with drop column.
399+ *
400+ * @return <code>true</code> if so; <code>false</code> otherwise
401+ * @exception SQLException if a database access error occurs
402+ */
403+ boolean supportsAlterTableWithDropColumn() throws SQLException;
404+
405+ /**
406+ * Retrieves whether this database supports column aliasing.
407+ *
408+ * <P>If so, the SQL AS clause can be used to provide names for
409+ * computed columns or to provide alias names for columns as
410+ * required.
411+ *
412+ * @return <code>true</code> if so; <code>false</code> otherwise
413+ * @exception SQLException if a database access error occurs
414+ */
415+ boolean supportsColumnAliasing() throws SQLException;
416+
417+ /**
418+ * Retrieves whether this database supports concatenations between
419+ * <code>NULL</code> and non-<code>NULL</code> values being
420+ * <code>NULL</code>.
421+ *
422+ * @return <code>true</code> if so; <code>false</code> otherwise
423+ * @exception SQLException if a database access error occurs
424+ */
425+ boolean nullPlusNonNullIsNull() throws SQLException;
426+
427+ /**
428+ * Retrieves whether this database supports the JDBC scalar function
429+ * <code>CONVERT</code> for the conversion of one JDBC type to another.
430+ * The JDBC types are the generic SQL data types defined
431+ * in <code>java.sql.Types</code>.
432+ *
433+ * @return <code>true</code> if so; <code>false</code> otherwise
434+ * @exception SQLException if a database access error occurs
435+ */
436+ boolean supportsConvert() throws SQLException;
437+
438+ /**
439+ * Retrieves whether this database supports the JDBC scalar function
440+ * <code>CONVERT</code> for conversions between the JDBC types <i>fromType</i>
441+ * and <i>toType</i>. The JDBC types are the generic SQL data types defined
442+ * in <code>java.sql.Types</code>.
443+ *
444+ * @param fromType the type to convert from; one of the type codes from
445+ * the class <code>java.sql.Types</code>
446+ * @param toType the type to convert to; one of the type codes from
447+ * the class <code>java.sql.Types</code>
448+ * @return <code>true</code> if so; <code>false</code> otherwise
449+ * @exception SQLException if a database access error occurs
450+ * @see Types
451+ */
452+ boolean supportsConvert(int fromType, int toType) throws SQLException;
453+
454+ /**
455+ * Retrieves whether this database supports table correlation names.
456+ *
457+ * @return <code>true</code> if so; <code>false</code> otherwise
458+ * @exception SQLException if a database access error occurs
459+ */
460+ boolean supportsTableCorrelationNames() throws SQLException;
461+
462+ /**
463+ * Retrieves whether, when table correlation names are supported, they
464+ * are restricted to being different from the names of the tables.
465+ *
466+ * @return <code>true</code> if so; <code>false</code> otherwise
467+ * @exception SQLException if a database access error occurs
468+ */
469+ boolean supportsDifferentTableCorrelationNames() throws SQLException;
470+
471+ /**
472+ * Retrieves whether this database supports expressions in
473+ * <code>ORDER BY</code> lists.
474+ *
475+ * @return <code>true</code> if so; <code>false</code> otherwise
476+ * @exception SQLException if a database access error occurs
477+ */
478+ boolean supportsExpressionsInOrderBy() throws SQLException;
479+
480+ /**
481+ * Retrieves whether this database supports using a column that is
482+ * not in the <code>SELECT</code> statement in an
483+ * <code>ORDER BY</code> clause.
484+ *
485+ * @return <code>true</code> if so; <code>false</code> otherwise
486+ * @exception SQLException if a database access error occurs
487+ */
488+ boolean supportsOrderByUnrelated() throws SQLException;
489+
490+ /**
491+ * Retrieves whether this database supports some form of
492+ * <code>GROUP BY</code> clause.
493+ *
494+ * @return <code>true</code> if so; <code>false</code> otherwise
495+ * @exception SQLException if a database access error occurs
496+ */
497+ boolean supportsGroupBy() throws SQLException;
498+
499+ /**
500+ * Retrieves whether this database supports using a column that is
501+ * not in the <code>SELECT</code> statement in a
502+ * <code>GROUP BY</code> clause.
503+ *
504+ * @return <code>true</code> if so; <code>false</code> otherwise
505+ * @exception SQLException if a database access error occurs
506+ */
507+ boolean supportsGroupByUnrelated() throws SQLException;
508+
509+ /**
510+ * Retrieves whether this database supports using columns not included in
511+ * the <code>SELECT</code> statement in a <code>GROUP BY</code> clause
512+ * provided that all of the columns in the <code>SELECT</code> statement
513+ * are included in the <code>GROUP BY</code> clause.
514+ *
515+ * @return <code>true</code> if so; <code>false</code> otherwise
516+ * @exception SQLException if a database access error occurs
517+ */
518+ boolean supportsGroupByBeyondSelect() throws SQLException;
519+
520+ /**
521+ * Retrieves whether this database supports specifying a
522+ * <code>LIKE</code> escape clause.
523+ *
524+ * @return <code>true</code> if so; <code>false</code> otherwise
525+ * @exception SQLException if a database access error occurs
526+ */
527+ boolean supportsLikeEscapeClause() throws SQLException;
528+
529+ /**
530+ * Retrieves whether this database supports getting multiple
531+ * <code>ResultSet</code> objects from a single call to the
532+ * method <code>execute</code>.
533+ *
534+ * @return <code>true</code> if so; <code>false</code> otherwise
535+ * @exception SQLException if a database access error occurs
536+ */
537+ boolean supportsMultipleResultSets() throws SQLException;
538+
539+ /**
540+ * Retrieves whether this database allows having multiple
541+ * transactions open at once (on different connections).
542+ *
543+ * @return <code>true</code> if so; <code>false</code> otherwise
544+ * @exception SQLException if a database access error occurs
545+ */
546+ boolean supportsMultipleTransactions() throws SQLException;
547+
548+ /**
549+ * Retrieves whether columns in this database may be defined as non-nullable.
550+ *
551+ * @return <code>true</code> if so; <code>false</code> otherwise
552+ * @exception SQLException if a database access error occurs
553+ */
554+ boolean supportsNonNullableColumns() throws SQLException;
555+
556+ /**
557+ * Retrieves whether this database supports the ODBC Minimum SQL grammar.
558+ *
559+ * @return <code>true</code> if so; <code>false</code> otherwise
560+ * @exception SQLException if a database access error occurs
561+ */
562+ boolean supportsMinimumSQLGrammar() throws SQLException;
563+
564+ /**
565+ * Retrieves whether this database supports the ODBC Core SQL grammar.
566+ *
567+ * @return <code>true</code> if so; <code>false</code> otherwise
568+ * @exception SQLException if a database access error occurs
569+ */
570+ boolean supportsCoreSQLGrammar() throws SQLException;
571+
572+ /**
573+ * Retrieves whether this database supports the ODBC Extended SQL grammar.
574+ *
575+ * @return <code>true</code> if so; <code>false</code> otherwise
576+ * @exception SQLException if a database access error occurs
577+ */
578+ boolean supportsExtendedSQLGrammar() throws SQLException;
579+
580+ /**
581+ * Retrieves whether this database supports the ANSI92 entry level SQL
582+ * grammar.
583+ *
584+ * @return <code>true</code> if so; <code>false</code> otherwise
585+ * @exception SQLException if a database access error occurs
586+ */
587+ boolean supportsANSI92EntryLevelSQL() throws SQLException;
588+
589+ /**
590+ * Retrieves whether this database supports the ANSI92 intermediate SQL grammar supported.
591+ *
592+ * @return <code>true</code> if so; <code>false</code> otherwise
593+ * @exception SQLException if a database access error occurs
594+ */
595+ boolean supportsANSI92IntermediateSQL() throws SQLException;
596+
597+ /**
598+ * Retrieves whether this database supports the ANSI92 full SQL grammar supported.
599+ *
600+ * @return <code>true</code> if so; <code>false</code> otherwise
601+ * @exception SQLException if a database access error occurs
602+ */
603+ boolean supportsANSI92FullSQL() throws SQLException;
604+
605+ /**
606+ * Retrieves whether this database supports the SQL Integrity
607+ * Enhancement Facility.
608+ *
609+ * @return <code>true</code> if so; <code>false</code> otherwise
610+ * @exception SQLException if a database access error occurs
611+ */
612+ boolean supportsIntegrityEnhancementFacility() throws SQLException;
613+
614+ /**
615+ * Retrieves whether this database supports some form of outer join.
616+ *
617+ * @return <code>true</code> if so; <code>false</code> otherwise
618+ * @exception SQLException if a database access error occurs
619+ */
620+ boolean supportsOuterJoins() throws SQLException;
621+
622+ /**
623+ * Retrieves whether this database supports full nested outer joins.
624+ *
625+ * @return <code>true</code> if so; <code>false</code> otherwise
626+ * @exception SQLException if a database access error occurs
627+ */
628+ boolean supportsFullOuterJoins() throws SQLException;
629+
630+ /**
631+ * Retrieves whether this database provides limited support for outer
632+ * joins. (This will be <code>true</code> if the method
633+ * <code>supportsFullOuterJoins</code> returns <code>true</code>).
634+ *
635+ * @return <code>true</code> if so; <code>false</code> otherwise
636+ * @exception SQLException if a database access error occurs
637+ */
638+ boolean supportsLimitedOuterJoins() throws SQLException;
639+
640+ /**
641+ * Retrieves the database vendor's preferred term for "schema".
642+ *
643+ * @return the vendor term for "schema"
644+ * @exception SQLException if a database access error occurs
645+ */
646+ String getSchemaTerm() throws SQLException;
647+
648+ /**
649+ * Retrieves the database vendor's preferred term for "procedure".
650+ *
651+ * @return the vendor term for "procedure"
652+ * @exception SQLException if a database access error occurs
653+ */
654+ String getProcedureTerm() throws SQLException;
655+
656+ /**
657+ * Retrieves the database vendor's preferred term for "catalog".
658+ *
659+ * @return the vendor term for "catalog"
660+ * @exception SQLException if a database access error occurs
661+ */
662+ String getCatalogTerm() throws SQLException;
663+
664+ /**
665+ * Retrieves whether a catalog appears at the start of a fully qualified
666+ * table name. If not, the catalog appears at the end.
667+ *
668+ * @return <code>true</code> if the catalog name appears at the beginning
669+ * of a fully qualified table name; <code>false</code> otherwise
670+ * @exception SQLException if a database access error occurs
671+ */
672+ boolean isCatalogAtStart() throws SQLException;
673+
674+ /**
675+ * Retrieves the <code>String</code> that this database uses as the
676+ * separator between a catalog and table name.
677+ *
678+ * @return the separator string
679+ * @exception SQLException if a database access error occurs
680+ */
681+ String getCatalogSeparator() throws SQLException;
682+
683+ /**
684+ * Retrieves whether a schema name can be used in a data manipulation statement.
685+ *
686+ * @return <code>true</code> if so; <code>false</code> otherwise
687+ * @exception SQLException if a database access error occurs
688+ */
689+ boolean supportsSchemasInDataManipulation() throws SQLException;
690+
691+ /**
692+ * Retrieves whether a schema name can be used in a procedure call statement.
693+ *
694+ * @return <code>true</code> if so; <code>false</code> otherwise
695+ * @exception SQLException if a database access error occurs
696+ */
697+ boolean supportsSchemasInProcedureCalls() throws SQLException;
698+
699+ /**
700+ * Retrieves whether a schema name can be used in a table definition statement.
701+ *
702+ * @return <code>true</code> if so; <code>false</code> otherwise
703+ * @exception SQLException if a database access error occurs
704+ */
705+ boolean supportsSchemasInTableDefinitions() throws SQLException;
706+
707+ /**
708+ * Retrieves whether a schema name can be used in an index definition statement.
709+ *
710+ * @return <code>true</code> if so; <code>false</code> otherwise
711+ * @exception SQLException if a database access error occurs
712+ */
713+ boolean supportsSchemasInIndexDefinitions() throws SQLException;
714+
715+ /**
716+ * Retrieves whether a schema name can be used in a privilege definition statement.
717+ *
718+ * @return <code>true</code> if so; <code>false</code> otherwise
719+ * @exception SQLException if a database access error occurs
720+ */
721+ boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
722+
723+ /**
724+ * Retrieves whether a catalog name can be used in a data manipulation statement.
725+ *
726+ * @return <code>true</code> if so; <code>false</code> otherwise
727+ * @exception SQLException if a database access error occurs
728+ */
729+ boolean supportsCatalogsInDataManipulation() throws SQLException;
730+
731+ /**
732+ * Retrieves whether a catalog name can be used in a procedure call statement.
733+ *
734+ * @return <code>true</code> if so; <code>false</code> otherwise
735+ * @exception SQLException if a database access error occurs
736+ */
737+ boolean supportsCatalogsInProcedureCalls() throws SQLException;
738+
739+ /**
740+ * Retrieves whether a catalog name can be used in a table definition statement.
741+ *
742+ * @return <code>true</code> if so; <code>false</code> otherwise
743+ * @exception SQLException if a database access error occurs
744+ */
745+ boolean supportsCatalogsInTableDefinitions() throws SQLException;
746+
747+ /**
748+ * Retrieves whether a catalog name can be used in an index definition statement.
749+ *
750+ * @return <code>true</code> if so; <code>false</code> otherwise
751+ * @exception SQLException if a database access error occurs
752+ */
753+ boolean supportsCatalogsInIndexDefinitions() throws SQLException;
754+
755+ /**
756+ * Retrieves whether a catalog name can be used in a privilege definition statement.
757+ *
758+ * @return <code>true</code> if so; <code>false</code> otherwise
759+ * @exception SQLException if a database access error occurs
760+ */
761+ boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
762+
763+
764+ /**
765+ * Retrieves whether this database supports positioned <code>DELETE</code>
766+ * statements.
767+ *
768+ * @return <code>true</code> if so; <code>false</code> otherwise
769+ * @exception SQLException if a database access error occurs
770+ */
771+ boolean supportsPositionedDelete() throws SQLException;
772+
773+ /**
774+ * Retrieves whether this database supports positioned <code>UPDATE</code>
775+ * statements.
776+ *
777+ * @return <code>true</code> if so; <code>false</code> otherwise
778+ * @exception SQLException if a database access error occurs
779+ */
780+ boolean supportsPositionedUpdate() throws SQLException;
781+
782+ /**
783+ * Retrieves whether this database supports <code>SELECT FOR UPDATE</code>
784+ * statements.
785+ *
786+ * @return <code>true</code> if so; <code>false</code> otherwise
787+ * @exception SQLException if a database access error occurs
788+ */
789+ boolean supportsSelectForUpdate() throws SQLException;
790+
791+ /**
792+ * Retrieves whether this database supports stored procedure calls
793+ * that use the stored procedure escape syntax.
794+ *
795+ * @return <code>true</code> if so; <code>false</code> otherwise
796+ * @exception SQLException if a database access error occurs
797+ */
798+ boolean supportsStoredProcedures() throws SQLException;
799+
800+ /**
801+ * Retrieves whether this database supports subqueries in comparison
802+ * expressions.
803+ *
804+ * @return <code>true</code> if so; <code>false</code> otherwise
805+ * @exception SQLException if a database access error occurs
806+ */
807+ boolean supportsSubqueriesInComparisons() throws SQLException;
808+
809+ /**
810+ * Retrieves whether this database supports subqueries in
811+ * <code>EXISTS</code> expressions.
812+ *
813+ * @return <code>true</code> if so; <code>false</code> otherwise
814+ * @exception SQLException if a database access error occurs
815+ */
816+ boolean supportsSubqueriesInExists() throws SQLException;
817+
818+ /**
819+ * Retrieves whether this database supports subqueries in
820+ * <code>IN</code> expressions.
821+ *
822+ * @return <code>true</code> if so; <code>false</code> otherwise
823+ * @exception SQLException if a database access error occurs
824+ */
825+ boolean supportsSubqueriesInIns() throws SQLException;
826+
827+ /**
828+ * Retrieves whether this database supports subqueries in quantified
829+ * expressions.
830+ *
831+ * @return <code>true</code> if so; <code>false</code> otherwise
832+ * @exception SQLException if a database access error occurs
833+ */
834+ boolean supportsSubqueriesInQuantifieds() throws SQLException;
835+
836+ /**
837+ * Retrieves whether this database supports correlated subqueries.
838+ *
839+ * @return <code>true</code> if so; <code>false</code> otherwise
840+ * @exception SQLException if a database access error occurs
841+ */
842+ boolean supportsCorrelatedSubqueries() throws SQLException;
843+
844+ /**
845+ * Retrieves whether this database supports SQL <code>UNION</code>.
846+ *
847+ * @return <code>true</code> if so; <code>false</code> otherwise
848+ * @exception SQLException if a database access error occurs
849+ */
850+ boolean supportsUnion() throws SQLException;
851+
852+ /**
853+ * Retrieves whether this database supports SQL <code>UNION ALL</code>.
854+ *
855+ * @return <code>true</code> if so; <code>false</code> otherwise
856+ * @exception SQLException if a database access error occurs
857+ */
858+ boolean supportsUnionAll() throws SQLException;
859+
860+ /**
861+ * Retrieves whether this database supports keeping cursors open
862+ * across commits.
863+ *
864+ * @return <code>true</code> if cursors always remain open;
865+ * <code>false</code> if they might not remain open
866+ * @exception SQLException if a database access error occurs
867+ */
868+ boolean supportsOpenCursorsAcrossCommit() throws SQLException;
869+
870+ /**
871+ * Retrieves whether this database supports keeping cursors open
872+ * across rollbacks.
873+ *
874+ * @return <code>true</code> if cursors always remain open;
875+ * <code>false</code> if they might not remain open
876+ * @exception SQLException if a database access error occurs
877+ */
878+ boolean supportsOpenCursorsAcrossRollback() throws SQLException;
879+
880+ /**
881+ * Retrieves whether this database supports keeping statements open
882+ * across commits.
883+ *
884+ * @return <code>true</code> if statements always remain open;
885+ * <code>false</code> if they might not remain open
886+ * @exception SQLException if a database access error occurs
887+ */
888+ boolean supportsOpenStatementsAcrossCommit() throws SQLException;
889+
890+ /**
891+ * Retrieves whether this database supports keeping statements open
892+ * across rollbacks.
893+ *
894+ * @return <code>true</code> if statements always remain open;
895+ * <code>false</code> if they might not remain open
896+ * @exception SQLException if a database access error occurs
897+ */
898+ boolean supportsOpenStatementsAcrossRollback() throws SQLException;
899+
900+
901+
902+ //----------------------------------------------------------------------
903+ // The following group of methods exposes various limitations
904+ // based on the target database with the current driver.
905+ // Unless otherwise specified, a result of zero means there is no
906+ // limit, or the limit is not known.
907+
908+ /**
909+ * Retrieves the maximum number of hex characters this database allows in an
910+ * inline binary literal.
911+ *
912+ * @return max the maximum length (in hex characters) for a binary literal;
913+ * a result of zero means that there is no limit or the limit
914+ * is not known
915+ * @exception SQLException if a database access error occurs
916+ */
917+ int getMaxBinaryLiteralLength() throws SQLException;
918+
919+ /**
920+ * Retrieves the maximum number of characters this database allows
921+ * for a character literal.
922+ *
923+ * @return the maximum number of characters allowed for a character literal;
924+ * a result of zero means that there is no limit or the limit is
925+ * not known
926+ * @exception SQLException if a database access error occurs
927+ */
928+ int getMaxCharLiteralLength() throws SQLException;
929+
930+ /**
931+ * Retrieves the maximum number of characters this database allows
932+ * for a column name.
933+ *
934+ * @return the maximum number of characters allowed for a column name;
935+ * a result of zero means that there is no limit or the limit
936+ * is not known
937+ * @exception SQLException if a database access error occurs
938+ */
939+ int getMaxColumnNameLength() throws SQLException;
940+
941+ /**
942+ * Retrieves the maximum number of columns this database allows in a
943+ * <code>GROUP BY</code> clause.
944+ *
945+ * @return the maximum number of columns allowed;
946+ * a result of zero means that there is no limit or the limit
947+ * is not known
948+ * @exception SQLException if a database access error occurs
949+ */
950+ int getMaxColumnsInGroupBy() throws SQLException;
951+
952+ /**
953+ * Retrieves the maximum number of columns this database allows in an index.
954+ *
955+ * @return the maximum number of columns allowed;
956+ * a result of zero means that there is no limit or the limit
957+ * is not known
958+ * @exception SQLException if a database access error occurs
959+ */
960+ int getMaxColumnsInIndex() throws SQLException;
961+
962+ /**
963+ * Retrieves the maximum number of columns this database allows in an
964+ * <code>ORDER BY</code> clause.
965+ *
966+ * @return the maximum number of columns allowed;
967+ * a result of zero means that there is no limit or the limit
968+ * is not known
969+ * @exception SQLException if a database access error occurs
970+ */
971+ int getMaxColumnsInOrderBy() throws SQLException;
972+
973+ /**
974+ * Retrieves the maximum number of columns this database allows in a
975+ * <code>SELECT</code> list.
976+ *
977+ * @return the maximum number of columns allowed;
978+ * a result of zero means that there is no limit or the limit
979+ * is not known
980+ * @exception SQLException if a database access error occurs
981+ */
982+ int getMaxColumnsInSelect() throws SQLException;
983+
984+ /**
985+ * Retrieves the maximum number of columns this database allows in a table.
986+ *
987+ * @return the maximum number of columns allowed;
988+ * a result of zero means that there is no limit or the limit
989+ * is not known
990+ * @exception SQLException if a database access error occurs
991+ */
992+ int getMaxColumnsInTable() throws SQLException;
993+
994+ /**
995+ * Retrieves the maximum number of concurrent connections to this
996+ * database that are possible.
997+ *
998+ * @return the maximum number of active connections possible at one time;
999+ * a result of zero means that there is no limit or the limit
1000+ * is not known
1001+ * @exception SQLException if a database access error occurs
1002+ */
1003+ int getMaxConnections() throws SQLException;
1004+
1005+ /**
1006+ * Retrieves the maximum number of characters that this database allows in a
1007+ * cursor name.
1008+ *
1009+ * @return the maximum number of characters allowed in a cursor name;
1010+ * a result of zero means that there is no limit or the limit
1011+ * is not known
1012+ * @exception SQLException if a database access error occurs
1013+ */
1014+ int getMaxCursorNameLength() throws SQLException;
1015+
1016+ /**
1017+ * Retrieves the maximum number of bytes this database allows for an
1018+ * index, including all of the parts of the index.
1019+ *
1020+ * @return the maximum number of bytes allowed; this limit includes the
1021+ * composite of all the constituent parts of the index;
1022+ * a result of zero means that there is no limit or the limit
1023+ * is not known
1024+ * @exception SQLException if a database access error occurs
1025+ */
1026+ int getMaxIndexLength() throws SQLException;
1027+
1028+ /**
1029+ * Retrieves the maximum number of characters that this database allows in a
1030+ * schema name.
1031+ *
1032+ * @return the maximum number of characters allowed in a schema name;
1033+ * a result of zero means that there is no limit or the limit
1034+ * is not known
1035+ * @exception SQLException if a database access error occurs
1036+ */
1037+ int getMaxSchemaNameLength() throws SQLException;
1038+
1039+ /**
1040+ * Retrieves the maximum number of characters that this database allows in a
1041+ * procedure name.
1042+ *
1043+ * @return the maximum number of characters allowed in a procedure name;
1044+ * a result of zero means that there is no limit or the limit
1045+ * is not known
1046+ * @exception SQLException if a database access error occurs
1047+ */
1048+ int getMaxProcedureNameLength() throws SQLException;
1049+
1050+ /**
1051+ * Retrieves the maximum number of characters that this database allows in a
1052+ * catalog name.
1053+ *
1054+ * @return the maximum number of characters allowed in a catalog name;
1055+ * a result of zero means that there is no limit or the limit
1056+ * is not known
1057+ * @exception SQLException if a database access error occurs
1058+ */
1059+ int getMaxCatalogNameLength() throws SQLException;
1060+
1061+ /**
1062+ * Retrieves the maximum number of bytes this database allows in
1063+ * a single row.
1064+ *
1065+ * @return the maximum number of bytes allowed for a row; a result of
1066+ * zero means that there is no limit or the limit is not known
1067+ * @exception SQLException if a database access error occurs
1068+ */
1069+ int getMaxRowSize() throws SQLException;
1070+
1071+ /**
1072+ * Retrieves whether the return value for the method
1073+ * <code>getMaxRowSize</code> includes the SQL data types
1074+ * <code>LONGVARCHAR</code> and <code>LONGVARBINARY</code>.
1075+ *
1076+ * @return <code>true</code> if so; <code>false</code> otherwise
1077+ * @exception SQLException if a database access error occurs
1078+ */
1079+ boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
1080+
1081+ /**
1082+ * Retrieves the maximum number of characters this database allows in
1083+ * an SQL statement.
1084+ *
1085+ * @return the maximum number of characters allowed for an SQL statement;
1086+ * a result of zero means that there is no limit or the limit
1087+ * is not known
1088+ * @exception SQLException if a database access error occurs
1089+ */
1090+ int getMaxStatementLength() throws SQLException;
1091+
1092+ /**
1093+ * Retrieves the maximum number of active statements to this database
1094+ * that can be open at the same time.
1095+ *
1096+ * @return the maximum number of statements that can be open at one time;
1097+ * a result of zero means that there is no limit or the limit
1098+ * is not known
1099+ * @exception SQLException if a database access error occurs
1100+ */
1101+ int getMaxStatements() throws SQLException;
1102+
1103+ /**
1104+ * Retrieves the maximum number of characters this database allows in
1105+ * a table name.
1106+ *
1107+ * @return the maximum number of characters allowed for a table name;
1108+ * a result of zero means that there is no limit or the limit
1109+ * is not known
1110+ * @exception SQLException if a database access error occurs
1111+ */
1112+ int getMaxTableNameLength() throws SQLException;
1113+
1114+ /**
1115+ * Retrieves the maximum number of tables this database allows in a
1116+ * <code>SELECT</code> statement.
1117+ *
1118+ * @return the maximum number of tables allowed in a <code>SELECT</code>
1119+ * statement; a result of zero means that there is no limit or
1120+ * the limit is not known
1121+ * @exception SQLException if a database access error occurs
1122+ */
1123+ int getMaxTablesInSelect() throws SQLException;
1124+
1125+ /**
1126+ * Retrieves the maximum number of characters this database allows in
1127+ * a user name.
1128+ *
1129+ * @return the maximum number of characters allowed for a user name;
1130+ * a result of zero means that there is no limit or the limit
1131+ * is not known
1132+ * @exception SQLException if a database access error occurs
1133+ */
1134+ int getMaxUserNameLength() throws SQLException;
1135+
1136+ //----------------------------------------------------------------------
1137+
1138+ /**
1139+ * Retrieves this database's default transaction isolation level. The
1140+ * possible values are defined in <code>java.sql.Connection</code>.
1141+ *
1142+ * @return the default isolation level
1143+ * @exception SQLException if a database access error occurs
1144+ * @see Connection
1145+ */
1146+ int getDefaultTransactionIsolation() throws SQLException;
1147+
1148+ /**
1149+ * Retrieves whether this database supports transactions. If not, invoking the
1150+ * method <code>commit</code> is a noop, and the isolation level is
1151+ * <code>TRANSACTION_NONE</code>.
1152+ *
1153+ * @return <code>true</code> if transactions are supported;
1154+ * <code>false</code> otherwise
1155+ * @exception SQLException if a database access error occurs
1156+ */
1157+ boolean supportsTransactions() throws SQLException;
1158+
1159+ /**
1160+ * Retrieves whether this database supports the given transaction isolation level.
1161+ *
1162+ * @param level one of the transaction isolation levels defined in
1163+ * <code>java.sql.Connection</code>
1164+ * @return <code>true</code> if so; <code>false</code> otherwise
1165+ * @exception SQLException if a database access error occurs
1166+ * @see Connection
1167+ */
1168+ boolean supportsTransactionIsolationLevel(int level)
1169+ throws SQLException;
1170+
1171+ /**
1172+ * Retrieves whether this database supports both data definition and
1173+ * data manipulation statements within a transaction.
1174+ *
1175+ * @return <code>true</code> if so; <code>false</code> otherwise
1176+ * @exception SQLException if a database access error occurs
1177+ */
1178+ boolean supportsDataDefinitionAndDataManipulationTransactions()
1179+ throws SQLException;
1180+ /**
1181+ * Retrieves whether this database supports only data manipulation
1182+ * statements within a transaction.
1183+ *
1184+ * @return <code>true</code> if so; <code>false</code> otherwise
1185+ * @exception SQLException if a database access error occurs
1186+ */
1187+ boolean supportsDataManipulationTransactionsOnly()
1188+ throws SQLException;
1189+
1190+ /**
1191+ * Retrieves whether a data definition statement within a transaction forces
1192+ * the transaction to commit.
1193+ *
1194+ * @return <code>true</code> if so; <code>false</code> otherwise
1195+ * @exception SQLException if a database access error occurs
1196+ */
1197+ boolean dataDefinitionCausesTransactionCommit()
1198+ throws SQLException;
1199+
1200+ /**
1201+ * Retrieves whether this database ignores a data definition statement
1202+ * within a transaction.
1203+ *
1204+ * @return <code>true</code> if so; <code>false</code> otherwise
1205+ * @exception SQLException if a database access error occurs
1206+ */
1207+ boolean dataDefinitionIgnoredInTransactions()
1208+ throws SQLException;
1209+
1210+ /**
1211+ * Retrieves a description of the stored procedures available in the given
1212+ * catalog.
1213+ * <P>
1214+ * Only procedure descriptions matching the schema and
1215+ * procedure name criteria are returned. They are ordered by
1216+ * <code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code>,
1217+ * <code>PROCEDURE_NAME</code> and <code>SPECIFIC_ NAME</code>.
1218+ *
1219+ * <P>Each procedure description has the the following columns:
1220+ * <OL>
1221+ * <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be <code>null</code>)
1222+ * <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be <code>null</code>)
1223+ * <LI><B>PROCEDURE_NAME</B> String => procedure name
1224+ * <LI> reserved for future use
1225+ * <LI> reserved for future use
1226+ * <LI> reserved for future use
1227+ * <LI><B>REMARKS</B> String => explanatory comment on the procedure
1228+ * <LI><B>PROCEDURE_TYPE</B> short => kind of procedure:
1229+ * <UL>
1230+ * <LI> procedureResultUnknown - Cannot determine if a return value
1231+ * will be returned
1232+ * <LI> procedureNoResult - Does not return a return value
1233+ * <LI> procedureReturnsResult - Returns a return value
1234+ * </UL>
1235+ * <LI><B>SPECIFIC_NAME</B> String => The name which uniquely identifies this
1236+ * procedure within its schema.
1237+ * </OL>
1238+ * <p>
1239+ * A user may not have permissions to execute any of the procedures that are
1240+ * returned by <code>getProcedures</code>
1241+ *
1242+ * @param catalog a catalog name; must match the catalog name as it
1243+ * is stored in the database; "" retrieves those without a catalog;
1244+ * <code>null</code> means that the catalog name should not be used to narrow
1245+ * the search
1246+ * @param schemaPattern a schema name pattern; must match the schema name
1247+ * as it is stored in the database; "" retrieves those without a schema;
1248+ * <code>null</code> means that the schema name should not be used to narrow
1249+ * the search
1250+ * @param procedureNamePattern a procedure name pattern; must match the
1251+ * procedure name as it is stored in the database
1252+ * @return <code>ResultSet</code> - each row is a procedure description
1253+ * @exception SQLException if a database access error occurs
1254+ * @see #getSearchStringEscape
1255+ */
1256+ ResultSet getProcedures(String catalog, String schemaPattern,
1257+ String procedureNamePattern) throws SQLException;
1258+
1259+ /**
1260+ * Indicates that it is not known whether the procedure returns
1261+ * a result.
1262+ * <P>
1263+ * A possible value for column <code>PROCEDURE_TYPE</code> in the
1264+ * <code>ResultSet</code> object returned by the method
1265+ * <code>getProcedures</code>.
1266+ */
1267+ int procedureResultUnknown = 0;
1268+
1269+ /**
1270+ * Indicates that the procedure does not return a result.
1271+ * <P>
1272+ * A possible value for column <code>PROCEDURE_TYPE</code> in the
1273+ * <code>ResultSet</code> object returned by the method
1274+ * <code>getProcedures</code>.
1275+ */
1276+ int procedureNoResult = 1;
1277+
1278+ /**
1279+ * Indicates that the procedure returns a result.
1280+ * <P>
1281+ * A possible value for column <code>PROCEDURE_TYPE</code> in the
1282+ * <code>ResultSet</code> object returned by the method
1283+ * <code>getProcedures</code>.
1284+ */
1285+ int procedureReturnsResult = 2;
1286+
1287+ /**
1288+ * Retrieves a description of the given catalog's stored procedure parameter
1289+ * and result columns.
1290+ *
1291+ * <P>Only descriptions matching the schema, procedure and
1292+ * parameter name criteria are returned. They are ordered by
1293+ * PROCEDURE_CAT, PROCEDURE_SCHEM, PROCEDURE_NAME and SPECIFIC_NAME. Within this, the return value,
1294+ * if any, is first. Next are the parameter descriptions in call
1295+ * order. The column descriptions follow in column number order.
1296+ *
1297+ * <P>Each row in the <code>ResultSet</code> is a parameter description or
1298+ * column description with the following fields:
1299+ * <OL>
1300+ * <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be <code>null</code>)
1301+ * <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be <code>null</code>)
1302+ * <LI><B>PROCEDURE_NAME</B> String => procedure name
1303+ * <LI><B>COLUMN_NAME</B> String => column/parameter name
1304+ * <LI><B>COLUMN_TYPE</B> Short => kind of column/parameter:
1305+ * <UL>
1306+ * <LI> procedureColumnUnknown - nobody knows
1307+ * <LI> procedureColumnIn - IN parameter
1308+ * <LI> procedureColumnInOut - INOUT parameter
1309+ * <LI> procedureColumnOut - OUT parameter
1310+ * <LI> procedureColumnReturn - procedure return value
1311+ * <LI> procedureColumnResult - result column in <code>ResultSet</code>
1312+ * </UL>
1313+ * <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types
1314+ * <LI><B>TYPE_NAME</B> String => SQL type name, for a UDT type the
1315+ * type name is fully qualified
1316+ * <LI><B>PRECISION</B> int => precision
1317+ * <LI><B>LENGTH</B> int => length in bytes of data
1318+ * <LI><B>SCALE</B> short => scale - null is returned for data types where
1319+ * SCALE is not applicable.
1320+ * <LI><B>RADIX</B> short => radix
1321+ * <LI><B>NULLABLE</B> short => can it contain NULL.
1322+ * <UL>
1323+ * <LI> procedureNoNulls - does not allow NULL values
1324+ * <LI> procedureNullable - allows NULL values
1325+ * <LI> procedureNullableUnknown - nullability unknown
1326+ * </UL>
1327+ * <LI><B>REMARKS</B> String => comment describing parameter/column
1328+ * <LI><B>COLUMN_DEF</B> String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be <code>null</code>)
1329+ * <UL>
1330+ * <LI> The string NULL (not enclosed in quotes) - if NULL was specified as the default value
1331+ * <LI> TRUNCATE (not enclosed in quotes) - if the specified default value cannot be represented without truncation
1332+ * <LI> NULL - if a default value was not specified
1333+ * </UL>
1334+ * <LI><B>SQL_DATA_TYPE</B> int => reserved for future use
1335+ * <LI><B>SQL_DATETIME_SUB</B> int => reserved for future use
1336+ * <LI><B>CHAR_OCTET_LENGTH</B> int => the maximum length of binary and character based columns. For any other datatype the returned value is a
1337+ * NULL
1338+ * <LI><B>ORDINAL_POSITION</B> int => the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0
1339+ *is returned if this row describes the procedure's return value. For result set columns, it is the
1340+ *ordinal position of the column in the result set starting from 1. If there are
1341+ *multiple result sets, the column ordinal positions are implementation
1342+ * defined.
1343+ * <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine the nullability for a column.
1344+ * <UL>
1345+ * <LI> YES --- if the column can include NULLs
1346+ * <LI> NO --- if the column cannot include NULLs
1347+ * <LI> empty string --- if the nullability for the
1348+ * column is unknown
1349+ * </UL>
1350+ * <LI><B>SPECIFIC_NAME</B> String => the name which uniquely identifies this procedure within its schema.
1351+ * </OL>
1352+ *
1353+ * <P><B>Note:</B> Some databases may not return the column
1354+ * descriptions for a procedure.
1355+ *
1356+ * <p>The PRECISION column represents the specified column size for the given column.
1357+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
1358+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
1359+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
1360+ * this is the length in bytes. Null is returned for data types where the
1361+ * column size is not applicable.
1362+ * @param catalog a catalog name; must match the catalog name as it
1363+ * is stored in the database; "" retrieves those without a catalog;
1364+ * <code>null</code> means that the catalog name should not be used to narrow
1365+ * the search
1366+ * @param schemaPattern a schema name pattern; must match the schema name
1367+ * as it is stored in the database; "" retrieves those without a schema;
1368+ * <code>null</code> means that the schema name should not be used to narrow
1369+ * the search
1370+ * @param procedureNamePattern a procedure name pattern; must match the
1371+ * procedure name as it is stored in the database
1372+ * @param columnNamePattern a column name pattern; must match the column name
1373+ * as it is stored in the database
1374+ * @return <code>ResultSet</code> - each row describes a stored procedure parameter or
1375+ * column
1376+ * @exception SQLException if a database access error occurs
1377+ * @see #getSearchStringEscape
1378+ */
1379+ ResultSet getProcedureColumns(String catalog,
1380+ String schemaPattern,
1381+ String procedureNamePattern,
1382+ String columnNamePattern) throws SQLException;
1383+
1384+ /**
1385+ * Indicates that type of the column is unknown.
1386+ * <P>
1387+ * A possible value for the column
1388+ * <code>COLUMN_TYPE</code>
1389+ * in the <code>ResultSet</code>
1390+ * returned by the method <code>getProcedureColumns</code>.
1391+ */
1392+ int procedureColumnUnknown = 0;
1393+
1394+ /**
1395+ * Indicates that the column stores IN parameters.
1396+ * <P>
1397+ * A possible value for the column
1398+ * <code>COLUMN_TYPE</code>
1399+ * in the <code>ResultSet</code>
1400+ * returned by the method <code>getProcedureColumns</code>.
1401+ */
1402+ int procedureColumnIn = 1;
1403+
1404+ /**
1405+ * Indicates that the column stores INOUT parameters.
1406+ * <P>
1407+ * A possible value for the column
1408+ * <code>COLUMN_TYPE</code>
1409+ * in the <code>ResultSet</code>
1410+ * returned by the method <code>getProcedureColumns</code>.
1411+ */
1412+ int procedureColumnInOut = 2;
1413+
1414+ /**
1415+ * Indicates that the column stores OUT parameters.
1416+ * <P>
1417+ * A possible value for the column
1418+ * <code>COLUMN_TYPE</code>
1419+ * in the <code>ResultSet</code>
1420+ * returned by the method <code>getProcedureColumns</code>.
1421+ */
1422+ int procedureColumnOut = 4;
1423+ /**
1424+ * Indicates that the column stores return values.
1425+ * <P>
1426+ * A possible value for the column
1427+ * <code>COLUMN_TYPE</code>
1428+ * in the <code>ResultSet</code>
1429+ * returned by the method <code>getProcedureColumns</code>.
1430+ */
1431+ int procedureColumnReturn = 5;
1432+
1433+ /**
1434+ * Indicates that the column stores results.
1435+ * <P>
1436+ * A possible value for the column
1437+ * <code>COLUMN_TYPE</code>
1438+ * in the <code>ResultSet</code>
1439+ * returned by the method <code>getProcedureColumns</code>.
1440+ */
1441+ int procedureColumnResult = 3;
1442+
1443+ /**
1444+ * Indicates that <code>NULL</code> values are not allowed.
1445+ * <P>
1446+ * A possible value for the column
1447+ * <code>NULLABLE</code>
1448+ * in the <code>ResultSet</code> object
1449+ * returned by the method <code>getProcedureColumns</code>.
1450+ */
1451+ int procedureNoNulls = 0;
1452+
1453+ /**
1454+ * Indicates that <code>NULL</code> values are allowed.
1455+ * <P>
1456+ * A possible value for the column
1457+ * <code>NULLABLE</code>
1458+ * in the <code>ResultSet</code> object
1459+ * returned by the method <code>getProcedureColumns</code>.
1460+ */
1461+ int procedureNullable = 1;
1462+
1463+ /**
1464+ * Indicates that whether <code>NULL</code> values are allowed
1465+ * is unknown.
1466+ * <P>
1467+ * A possible value for the column
1468+ * <code>NULLABLE</code>
1469+ * in the <code>ResultSet</code> object
1470+ * returned by the method <code>getProcedureColumns</code>.
1471+ */
1472+ int procedureNullableUnknown = 2;
1473+
1474+
1475+ /**
1476+ * Retrieves a description of the tables available in the given catalog.
1477+ * Only table descriptions matching the catalog, schema, table
1478+ * name and type criteria are returned. They are ordered by
1479+ * <code>TABLE_TYPE</code>, <code>TABLE_CAT</code>,
1480+ * <code>TABLE_SCHEM</code> and <code>TABLE_NAME</code>.
1481+ * <P>
1482+ * Each table description has the following columns:
1483+ * <OL>
1484+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
1485+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
1486+ * <LI><B>TABLE_NAME</B> String => table name
1487+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE",
1488+ * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
1489+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
1490+ * <LI><B>REMARKS</B> String => explanatory comment on the table
1491+ * <LI><B>TYPE_CAT</B> String => the types catalog (may be <code>null</code>)
1492+ * <LI><B>TYPE_SCHEM</B> String => the types schema (may be <code>null</code>)
1493+ * <LI><B>TYPE_NAME</B> String => type name (may be <code>null</code>)
1494+ * <LI><B>SELF_REFERENCING_COL_NAME</B> String => name of the designated
1495+ * "identifier" column of a typed table (may be <code>null</code>)
1496+ * <LI><B>REF_GENERATION</B> String => specifies how values in
1497+ * SELF_REFERENCING_COL_NAME are created. Values are
1498+ * "SYSTEM", "USER", "DERIVED". (may be <code>null</code>)
1499+ * </OL>
1500+ *
1501+ * <P><B>Note:</B> Some databases may not return information for
1502+ * all tables.
1503+ *
1504+ * @param catalog a catalog name; must match the catalog name as it
1505+ * is stored in the database; "" retrieves those without a catalog;
1506+ * <code>null</code> means that the catalog name should not be used to narrow
1507+ * the search
1508+ * @param schemaPattern a schema name pattern; must match the schema name
1509+ * as it is stored in the database; "" retrieves those without a schema;
1510+ * <code>null</code> means that the schema name should not be used to narrow
1511+ * the search
1512+ * @param tableNamePattern a table name pattern; must match the
1513+ * table name as it is stored in the database
1514+ * @param types a list of table types, which must be from the list of table types
1515+ * returned from {@link #getTableTypes},to include; <code>null</code> returns
1516+ * all types
1517+ * @return <code>ResultSet</code> - each row is a table description
1518+ * @exception SQLException if a database access error occurs
1519+ * @see #getSearchStringEscape
1520+ */
1521+ ResultSet getTables(String catalog, String schemaPattern,
1522+ String tableNamePattern, String types[]) throws SQLException;
1523+
1524+ /**
1525+ * Retrieves the schema names available in this database. The results
1526+ * are ordered by <code>TABLE_CATALOG</code> and
1527+ * <code>TABLE_SCHEM</code>.
1528+ *
1529+ * <P>The schema columns are:
1530+ * <OL>
1531+ * <LI><B>TABLE_SCHEM</B> String => schema name
1532+ * <LI><B>TABLE_CATALOG</B> String => catalog name (may be <code>null</code>)
1533+ * </OL>
1534+ *
1535+ * @return a <code>ResultSet</code> object in which each row is a
1536+ * schema description
1537+ * @exception SQLException if a database access error occurs
1538+ *
1539+ */
1540+ ResultSet getSchemas() throws SQLException;
1541+
1542+ /**
1543+ * Retrieves the catalog names available in this database. The results
1544+ * are ordered by catalog name.
1545+ *
1546+ * <P>The catalog column is:
1547+ * <OL>
1548+ * <LI><B>TABLE_CAT</B> String => catalog name
1549+ * </OL>
1550+ *
1551+ * @return a <code>ResultSet</code> object in which each row has a
1552+ * single <code>String</code> column that is a catalog name
1553+ * @exception SQLException if a database access error occurs
1554+ */
1555+ ResultSet getCatalogs() throws SQLException;
1556+
1557+ /**
1558+ * Retrieves the table types available in this database. The results
1559+ * are ordered by table type.
1560+ *
1561+ * <P>The table type is:
1562+ * <OL>
1563+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE",
1564+ * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
1565+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
1566+ * </OL>
1567+ *
1568+ * @return a <code>ResultSet</code> object in which each row has a
1569+ * single <code>String</code> column that is a table type
1570+ * @exception SQLException if a database access error occurs
1571+ */
1572+ ResultSet getTableTypes() throws SQLException;
1573+
1574+ /**
1575+ * Retrieves a description of table columns available in
1576+ * the specified catalog.
1577+ *
1578+ * <P>Only column descriptions matching the catalog, schema, table
1579+ * and column name criteria are returned. They are ordered by
1580+ * <code>TABLE_CAT</code>,<code>TABLE_SCHEM</code>,
1581+ * <code>TABLE_NAME</code>, and <code>ORDINAL_POSITION</code>.
1582+ *
1583+ * <P>Each column description has the following columns:
1584+ * <OL>
1585+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
1586+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
1587+ * <LI><B>TABLE_NAME</B> String => table name
1588+ * <LI><B>COLUMN_NAME</B> String => column name
1589+ * <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types
1590+ * <LI><B>TYPE_NAME</B> String => Data source dependent type name,
1591+ * for a UDT the type name is fully qualified
1592+ * <LI><B>COLUMN_SIZE</B> int => column size.
1593+ * <LI><B>BUFFER_LENGTH</B> is not used.
1594+ * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits. Null is returned for data types where
1595+ * DECIMAL_DIGITS is not applicable.
1596+ * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
1597+ * <LI><B>NULLABLE</B> int => is NULL allowed.
1598+ * <UL>
1599+ * <LI> columnNoNulls - might not allow <code>NULL</code> values
1600+ * <LI> columnNullable - definitely allows <code>NULL</code> values
1601+ * <LI> columnNullableUnknown - nullability unknown
1602+ * </UL>
1603+ * <LI><B>REMARKS</B> String => comment describing column (may be <code>null</code>)
1604+ * <LI><B>COLUMN_DEF</B> String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be <code>null</code>)
1605+ * <LI><B>SQL_DATA_TYPE</B> int => unused
1606+ * <LI><B>SQL_DATETIME_SUB</B> int => unused
1607+ * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
1608+ * maximum number of bytes in the column
1609+ * <LI><B>ORDINAL_POSITION</B> int => index of column in table
1610+ * (starting at 1)
1611+ * <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine the nullability for a column.
1612+ * <UL>
1613+ * <LI> YES --- if the column can include NULLs
1614+ * <LI> NO --- if the column cannot include NULLs
1615+ * <LI> empty string --- if the nullability for the
1616+ * column is unknown
1617+ * </UL>
1618+ * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the scope
1619+ * of a reference attribute (<code>null</code> if DATA_TYPE isn't REF)
1620+ * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the scope
1621+ * of a reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
1622+ * <LI><B>SCOPE_TABLE</B> String => table name that this the scope
1623+ * of a reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
1624+ * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or user-generated
1625+ * Ref type, SQL type from java.sql.Types (<code>null</code> if DATA_TYPE
1626+ * isn't DISTINCT or user-generated REF)
1627+ * <LI><B>IS_AUTOINCREMENT</B> String => Indicates whether this column is auto incremented
1628+ * <UL>
1629+ * <LI> YES --- if the column is auto incremented
1630+ * <LI> NO --- if the column is not auto incremented
1631+ * <LI> empty string --- if it cannot be determined whether the column is auto incremented
1632+ * </UL>
1633+ * <LI><B>IS_GENERATEDCOLUMN</B> String => Indicates whether this is a generated column
1634+ * <UL>
1635+ * <LI> YES --- if this a generated column
1636+ * <LI> NO --- if this not a generated column
1637+ * <LI> empty string --- if it cannot be determined whether this is a generated column
1638+ * </UL>
1639+ * </OL>
1640+ *
1641+ * <p>The COLUMN_SIZE column specifies the column size for the given column.
1642+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
1643+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
1644+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
1645+ * this is the length in bytes. Null is returned for data types where the
1646+ * column size is not applicable.
1647+ *
1648+ * @param catalog a catalog name; must match the catalog name as it
1649+ * is stored in the database; "" retrieves those without a catalog;
1650+ * <code>null</code> means that the catalog name should not be used to narrow
1651+ * the search
1652+ * @param schemaPattern a schema name pattern; must match the schema name
1653+ * as it is stored in the database; "" retrieves those without a schema;
1654+ * <code>null</code> means that the schema name should not be used to narrow
1655+ * the search
1656+ * @param tableNamePattern a table name pattern; must match the
1657+ * table name as it is stored in the database
1658+ * @param columnNamePattern a column name pattern; must match the column
1659+ * name as it is stored in the database
1660+ * @return <code>ResultSet</code> - each row is a column description
1661+ * @exception SQLException if a database access error occurs
1662+ * @see #getSearchStringEscape
1663+ */
1664+ ResultSet getColumns(String catalog, String schemaPattern,
1665+ String tableNamePattern, String columnNamePattern)
1666+ throws SQLException;
1667+
1668+ /**
1669+ * Indicates that the column might not allow <code>NULL</code> values.
1670+ * <P>
1671+ * A possible value for the column
1672+ * <code>NULLABLE</code>
1673+ * in the <code>ResultSet</code> returned by the method
1674+ * <code>getColumns</code>.
1675+ */
1676+ int columnNoNulls = 0;
1677+
1678+ /**
1679+ * Indicates that the column definitely allows <code>NULL</code> values.
1680+ * <P>
1681+ * A possible value for the column
1682+ * <code>NULLABLE</code>
1683+ * in the <code>ResultSet</code> returned by the method
1684+ * <code>getColumns</code>.
1685+ */
1686+ int columnNullable = 1;
1687+
1688+ /**
1689+ * Indicates that the nullability of columns is unknown.
1690+ * <P>
1691+ * A possible value for the column
1692+ * <code>NULLABLE</code>
1693+ * in the <code>ResultSet</code> returned by the method
1694+ * <code>getColumns</code>.
1695+ */
1696+ int columnNullableUnknown = 2;
1697+
1698+ /**
1699+ * Retrieves a description of the access rights for a table's columns.
1700+ *
1701+ * <P>Only privileges matching the column name criteria are
1702+ * returned. They are ordered by COLUMN_NAME and PRIVILEGE.
1703+ *
1704+ * <P>Each privilige description has the following columns:
1705+ * <OL>
1706+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
1707+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
1708+ * <LI><B>TABLE_NAME</B> String => table name
1709+ * <LI><B>COLUMN_NAME</B> String => column name
1710+ * <LI><B>GRANTOR</B> String => grantor of access (may be <code>null</code>)
1711+ * <LI><B>GRANTEE</B> String => grantee of access
1712+ * <LI><B>PRIVILEGE</B> String => name of access (SELECT,
1713+ * INSERT, UPDATE, REFRENCES, ...)
1714+ * <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted
1715+ * to grant to others; "NO" if not; <code>null</code> if unknown
1716+ * </OL>
1717+ *
1718+ * @param catalog a catalog name; must match the catalog name as it
1719+ * is stored in the database; "" retrieves those without a catalog;
1720+ * <code>null</code> means that the catalog name should not be used to narrow
1721+ * the search
1722+ * @param schema a schema name; must match the schema name as it is
1723+ * stored in the database; "" retrieves those without a schema;
1724+ * <code>null</code> means that the schema name should not be used to narrow
1725+ * the search
1726+ * @param table a table name; must match the table name as it is
1727+ * stored in the database
1728+ * @param columnNamePattern a column name pattern; must match the column
1729+ * name as it is stored in the database
1730+ * @return <code>ResultSet</code> - each row is a column privilege description
1731+ * @exception SQLException if a database access error occurs
1732+ * @see #getSearchStringEscape
1733+ */
1734+ ResultSet getColumnPrivileges(String catalog, String schema,
1735+ String table, String columnNamePattern) throws SQLException;
1736+
1737+ /**
1738+ * Retrieves a description of the access rights for each table available
1739+ * in a catalog. Note that a table privilege applies to one or
1740+ * more columns in the table. It would be wrong to assume that
1741+ * this privilege applies to all columns (this may be true for
1742+ * some systems but is not true for all.)
1743+ *
1744+ * <P>Only privileges matching the schema and table name
1745+ * criteria are returned. They are ordered by
1746+ * <code>TABLE_CAT</code>,
1747+ * <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code>,
1748+ * and <code>PRIVILEGE</code>.
1749+ *
1750+ * <P>Each privilige description has the following columns:
1751+ * <OL>
1752+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
1753+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
1754+ * <LI><B>TABLE_NAME</B> String => table name
1755+ * <LI><B>GRANTOR</B> String => grantor of access (may be <code>null</code>)
1756+ * <LI><B>GRANTEE</B> String => grantee of access
1757+ * <LI><B>PRIVILEGE</B> String => name of access (SELECT,
1758+ * INSERT, UPDATE, REFRENCES, ...)
1759+ * <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted
1760+ * to grant to others; "NO" if not; <code>null</code> if unknown
1761+ * </OL>
1762+ *
1763+ * @param catalog a catalog name; must match the catalog name as it
1764+ * is stored in the database; "" retrieves those without a catalog;
1765+ * <code>null</code> means that the catalog name should not be used to narrow
1766+ * the search
1767+ * @param schemaPattern a schema name pattern; must match the schema name
1768+ * as it is stored in the database; "" retrieves those without a schema;
1769+ * <code>null</code> means that the schema name should not be used to narrow
1770+ * the search
1771+ * @param tableNamePattern a table name pattern; must match the
1772+ * table name as it is stored in the database
1773+ * @return <code>ResultSet</code> - each row is a table privilege description
1774+ * @exception SQLException if a database access error occurs
1775+ * @see #getSearchStringEscape
1776+ */
1777+ ResultSet getTablePrivileges(String catalog, String schemaPattern,
1778+ String tableNamePattern) throws SQLException;
1779+
1780+ /**
1781+ * Retrieves a description of a table's optimal set of columns that
1782+ * uniquely identifies a row. They are ordered by SCOPE.
1783+ *
1784+ * <P>Each column description has the following columns:
1785+ * <OL>
1786+ * <LI><B>SCOPE</B> short => actual scope of result
1787+ * <UL>
1788+ * <LI> bestRowTemporary - very temporary, while using row
1789+ * <LI> bestRowTransaction - valid for remainder of current transaction
1790+ * <LI> bestRowSession - valid for remainder of current session
1791+ * </UL>
1792+ * <LI><B>COLUMN_NAME</B> String => column name
1793+ * <LI><B>DATA_TYPE</B> int => SQL data type from java.sql.Types
1794+ * <LI><B>TYPE_NAME</B> String => Data source dependent type name,
1795+ * for a UDT the type name is fully qualified
1796+ * <LI><B>COLUMN_SIZE</B> int => precision
1797+ * <LI><B>BUFFER_LENGTH</B> int => not used
1798+ * <LI><B>DECIMAL_DIGITS</B> short => scale - Null is returned for data types where
1799+ * DECIMAL_DIGITS is not applicable.
1800+ * <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column
1801+ * like an Oracle ROWID
1802+ * <UL>
1803+ * <LI> bestRowUnknown - may or may not be pseudo column
1804+ * <LI> bestRowNotPseudo - is NOT a pseudo column
1805+ * <LI> bestRowPseudo - is a pseudo column
1806+ * </UL>
1807+ * </OL>
1808+ *
1809+ * <p>The COLUMN_SIZE column represents the specified column size for the given column.
1810+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
1811+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
1812+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
1813+ * this is the length in bytes. Null is returned for data types where the
1814+ * column size is not applicable.
1815+ *
1816+ * @param catalog a catalog name; must match the catalog name as it
1817+ * is stored in the database; "" retrieves those without a catalog;
1818+ * <code>null</code> means that the catalog name should not be used to narrow
1819+ * the search
1820+ * @param schema a schema name; must match the schema name
1821+ * as it is stored in the database; "" retrieves those without a schema;
1822+ * <code>null</code> means that the schema name should not be used to narrow
1823+ * the search
1824+ * @param table a table name; must match the table name as it is stored
1825+ * in the database
1826+ * @param scope the scope of interest; use same values as SCOPE
1827+ * @param nullable include columns that are nullable.
1828+ * @return <code>ResultSet</code> - each row is a column description
1829+ * @exception SQLException if a database access error occurs
1830+ */
1831+ ResultSet getBestRowIdentifier(String catalog, String schema,
1832+ String table, int scope, boolean nullable) throws SQLException;
1833+
1834+ /**
1835+ * Indicates that the scope of the best row identifier is
1836+ * very temporary, lasting only while the
1837+ * row is being used.
1838+ * <P>
1839+ * A possible value for the column
1840+ * <code>SCOPE</code>
1841+ * in the <code>ResultSet</code> object
1842+ * returned by the method <code>getBestRowIdentifier</code>.
1843+ */
1844+ int bestRowTemporary = 0;
1845+
1846+ /**
1847+ * Indicates that the scope of the best row identifier is
1848+ * the remainder of the current transaction.
1849+ * <P>
1850+ * A possible value for the column
1851+ * <code>SCOPE</code>
1852+ * in the <code>ResultSet</code> object
1853+ * returned by the method <code>getBestRowIdentifier</code>.
1854+ */
1855+ int bestRowTransaction = 1;
1856+
1857+ /**
1858+ * Indicates that the scope of the best row identifier is
1859+ * the remainder of the current session.
1860+ * <P>
1861+ * A possible value for the column
1862+ * <code>SCOPE</code>
1863+ * in the <code>ResultSet</code> object
1864+ * returned by the method <code>getBestRowIdentifier</code>.
1865+ */
1866+ int bestRowSession = 2;
1867+
1868+ /**
1869+ * Indicates that the best row identifier may or may not be a pseudo column.
1870+ * <P>
1871+ * A possible value for the column
1872+ * <code>PSEUDO_COLUMN</code>
1873+ * in the <code>ResultSet</code> object
1874+ * returned by the method <code>getBestRowIdentifier</code>.
1875+ */
1876+ int bestRowUnknown = 0;
1877+
1878+ /**
1879+ * Indicates that the best row identifier is NOT a pseudo column.
1880+ * <P>
1881+ * A possible value for the column
1882+ * <code>PSEUDO_COLUMN</code>
1883+ * in the <code>ResultSet</code> object
1884+ * returned by the method <code>getBestRowIdentifier</code>.
1885+ */
1886+ int bestRowNotPseudo = 1;
1887+
1888+ /**
1889+ * Indicates that the best row identifier is a pseudo column.
1890+ * <P>
1891+ * A possible value for the column
1892+ * <code>PSEUDO_COLUMN</code>
1893+ * in the <code>ResultSet</code> object
1894+ * returned by the method <code>getBestRowIdentifier</code>.
1895+ */
1896+ int bestRowPseudo = 2;
1897+
1898+ /**
1899+ * Retrieves a description of a table's columns that are automatically
1900+ * updated when any value in a row is updated. They are
1901+ * unordered.
1902+ *
1903+ * <P>Each column description has the following columns:
1904+ * <OL>
1905+ * <LI><B>SCOPE</B> short => is not used
1906+ * <LI><B>COLUMN_NAME</B> String => column name
1907+ * <LI><B>DATA_TYPE</B> int => SQL data type from <code>java.sql.Types</code>
1908+ * <LI><B>TYPE_NAME</B> String => Data source-dependent type name
1909+ * <LI><B>COLUMN_SIZE</B> int => precision
1910+ * <LI><B>BUFFER_LENGTH</B> int => length of column value in bytes
1911+ * <LI><B>DECIMAL_DIGITS</B> short => scale - Null is returned for data types where
1912+ * DECIMAL_DIGITS is not applicable.
1913+ * <LI><B>PSEUDO_COLUMN</B> short => whether this is pseudo column
1914+ * like an Oracle ROWID
1915+ * <UL>
1916+ * <LI> versionColumnUnknown - may or may not be pseudo column
1917+ * <LI> versionColumnNotPseudo - is NOT a pseudo column
1918+ * <LI> versionColumnPseudo - is a pseudo column
1919+ * </UL>
1920+ * </OL>
1921+ *
1922+ * <p>The COLUMN_SIZE column represents the specified column size for the given column.
1923+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
1924+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
1925+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
1926+ * this is the length in bytes. Null is returned for data types where the
1927+ * column size is not applicable.
1928+ * @param catalog a catalog name; must match the catalog name as it
1929+ * is stored in the database; "" retrieves those without a catalog;
1930+ * <code>null</code> means that the catalog name should not be used to narrow
1931+ * the search
1932+ * @param schema a schema name; must match the schema name
1933+ * as it is stored in the database; "" retrieves those without a schema;
1934+ * <code>null</code> means that the schema name should not be used to narrow
1935+ * the search
1936+ * @param table a table name; must match the table name as it is stored
1937+ * in the database
1938+ * @return a <code>ResultSet</code> object in which each row is a
1939+ * column description
1940+ * @exception SQLException if a database access error occurs
1941+ */
1942+ ResultSet getVersionColumns(String catalog, String schema,
1943+ String table) throws SQLException;
1944+
1945+ /**
1946+ * Indicates that this version column may or may not be a pseudo column.
1947+ * <P>
1948+ * A possible value for the column
1949+ * <code>PSEUDO_COLUMN</code>
1950+ * in the <code>ResultSet</code> object
1951+ * returned by the method <code>getVersionColumns</code>.
1952+ */
1953+ int versionColumnUnknown = 0;
1954+
1955+ /**
1956+ * Indicates that this version column is NOT a pseudo column.
1957+ * <P>
1958+ * A possible value for the column
1959+ * <code>PSEUDO_COLUMN</code>
1960+ * in the <code>ResultSet</code> object
1961+ * returned by the method <code>getVersionColumns</code>.
1962+ */
1963+ int versionColumnNotPseudo = 1;
1964+
1965+ /**
1966+ * Indicates that this version column is a pseudo column.
1967+ * <P>
1968+ * A possible value for the column
1969+ * <code>PSEUDO_COLUMN</code>
1970+ * in the <code>ResultSet</code> object
1971+ * returned by the method <code>getVersionColumns</code>.
1972+ */
1973+ int versionColumnPseudo = 2;
1974+
1975+ /**
1976+ * Retrieves a description of the given table's primary key columns. They
1977+ * are ordered by COLUMN_NAME.
1978+ *
1979+ * <P>Each primary key column description has the following columns:
1980+ * <OL>
1981+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
1982+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
1983+ * <LI><B>TABLE_NAME</B> String => table name
1984+ * <LI><B>COLUMN_NAME</B> String => column name
1985+ * <LI><B>KEY_SEQ</B> short => sequence number within primary key( a value
1986+ * of 1 represents the first column of the primary key, a value of 2 would
1987+ * represent the second column within the primary key).
1988+ * <LI><B>PK_NAME</B> String => primary key name (may be <code>null</code>)
1989+ * </OL>
1990+ *
1991+ * @param catalog a catalog name; must match the catalog name as it
1992+ * is stored in the database; "" retrieves those without a catalog;
1993+ * <code>null</code> means that the catalog name should not be used to narrow
1994+ * the search
1995+ * @param schema a schema name; must match the schema name
1996+ * as it is stored in the database; "" retrieves those without a schema;
1997+ * <code>null</code> means that the schema name should not be used to narrow
1998+ * the search
1999+ * @param table a table name; must match the table name as it is stored
2000+ * in the database
2001+ * @return <code>ResultSet</code> - each row is a primary key column description
2002+ * @exception SQLException if a database access error occurs
2003+ */
2004+ ResultSet getPrimaryKeys(String catalog, String schema,
2005+ String table) throws SQLException;
2006+
2007+ /**
2008+ * Retrieves a description of the primary key columns that are
2009+ * referenced by the given table's foreign key columns (the primary keys
2010+ * imported by a table). They are ordered by PKTABLE_CAT,
2011+ * PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.
2012+ *
2013+ * <P>Each primary key column description has the following columns:
2014+ * <OL>
2015+ * <LI><B>PKTABLE_CAT</B> String => primary key table catalog
2016+ * being imported (may be <code>null</code>)
2017+ * <LI><B>PKTABLE_SCHEM</B> String => primary key table schema
2018+ * being imported (may be <code>null</code>)
2019+ * <LI><B>PKTABLE_NAME</B> String => primary key table name
2020+ * being imported
2021+ * <LI><B>PKCOLUMN_NAME</B> String => primary key column name
2022+ * being imported
2023+ * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be <code>null</code>)
2024+ * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be <code>null</code>)
2025+ * <LI><B>FKTABLE_NAME</B> String => foreign key table name
2026+ * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
2027+ * <LI><B>KEY_SEQ</B> short => sequence number within a foreign key( a value
2028+ * of 1 represents the first column of the foreign key, a value of 2 would
2029+ * represent the second column within the foreign key).
2030+ * <LI><B>UPDATE_RULE</B> short => What happens to a
2031+ * foreign key when the primary key is updated:
2032+ * <UL>
2033+ * <LI> importedNoAction - do not allow update of primary
2034+ * key if it has been imported
2035+ * <LI> importedKeyCascade - change imported key to agree
2036+ * with primary key update
2037+ * <LI> importedKeySetNull - change imported key to <code>NULL</code>
2038+ * if its primary key has been updated
2039+ * <LI> importedKeySetDefault - change imported key to default values
2040+ * if its primary key has been updated
2041+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2042+ * (for ODBC 2.x compatibility)
2043+ * </UL>
2044+ * <LI><B>DELETE_RULE</B> short => What happens to
2045+ * the foreign key when primary is deleted.
2046+ * <UL>
2047+ * <LI> importedKeyNoAction - do not allow delete of primary
2048+ * key if it has been imported
2049+ * <LI> importedKeyCascade - delete rows that import a deleted key
2050+ * <LI> importedKeySetNull - change imported key to NULL if
2051+ * its primary key has been deleted
2052+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2053+ * (for ODBC 2.x compatibility)
2054+ * <LI> importedKeySetDefault - change imported key to default if
2055+ * its primary key has been deleted
2056+ * </UL>
2057+ * <LI><B>FK_NAME</B> String => foreign key name (may be <code>null</code>)
2058+ * <LI><B>PK_NAME</B> String => primary key name (may be <code>null</code>)
2059+ * <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key
2060+ * constraints be deferred until commit
2061+ * <UL>
2062+ * <LI> importedKeyInitiallyDeferred - see SQL92 for definition
2063+ * <LI> importedKeyInitiallyImmediate - see SQL92 for definition
2064+ * <LI> importedKeyNotDeferrable - see SQL92 for definition
2065+ * </UL>
2066+ * </OL>
2067+ *
2068+ * @param catalog a catalog name; must match the catalog name as it
2069+ * is stored in the database; "" retrieves those without a catalog;
2070+ * <code>null</code> means that the catalog name should not be used to narrow
2071+ * the search
2072+ * @param schema a schema name; must match the schema name
2073+ * as it is stored in the database; "" retrieves those without a schema;
2074+ * <code>null</code> means that the schema name should not be used to narrow
2075+ * the search
2076+ * @param table a table name; must match the table name as it is stored
2077+ * in the database
2078+ * @return <code>ResultSet</code> - each row is a primary key column description
2079+ * @exception SQLException if a database access error occurs
2080+ * @see #getExportedKeys
2081+ */
2082+ ResultSet getImportedKeys(String catalog, String schema,
2083+ String table) throws SQLException;
2084+
2085+ /**
2086+ * For the column <code>UPDATE_RULE</code>,
2087+ * indicates that
2088+ * when the primary key is updated, the foreign key (imported key)
2089+ * is changed to agree with it.
2090+ * For the column <code>DELETE_RULE</code>,
2091+ * it indicates that
2092+ * when the primary key is deleted, rows that imported that key
2093+ * are deleted.
2094+ * <P>
2095+ * A possible value for the columns <code>UPDATE_RULE</code>
2096+ * and <code>DELETE_RULE</code> in the
2097+ * <code>ResultSet</code> objects returned by the methods
2098+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2099+ * and <code>getCrossReference</code>.
2100+ */
2101+ int importedKeyCascade = 0;
2102+
2103+ /**
2104+ * For the column <code>UPDATE_RULE</code>, indicates that
2105+ * a primary key may not be updated if it has been imported by
2106+ * another table as a foreign key.
2107+ * For the column <code>DELETE_RULE</code>, indicates that
2108+ * a primary key may not be deleted if it has been imported by
2109+ * another table as a foreign key.
2110+ * <P>
2111+ * A possible value for the columns <code>UPDATE_RULE</code>
2112+ * and <code>DELETE_RULE</code> in the
2113+ * <code>ResultSet</code> objects returned by the methods
2114+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2115+ * and <code>getCrossReference</code>.
2116+ */
2117+ int importedKeyRestrict = 1;
2118+
2119+ /**
2120+ * For the columns <code>UPDATE_RULE</code>
2121+ * and <code>DELETE_RULE</code>, indicates that
2122+ * when the primary key is updated or deleted, the foreign key (imported key)
2123+ * is changed to <code>NULL</code>.
2124+ * <P>
2125+ * A possible value for the columns <code>UPDATE_RULE</code>
2126+ * and <code>DELETE_RULE</code> in the
2127+ * <code>ResultSet</code> objects returned by the methods
2128+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2129+ * and <code>getCrossReference</code>.
2130+ */
2131+ int importedKeySetNull = 2;
2132+
2133+ /**
2134+ * For the columns <code>UPDATE_RULE</code>
2135+ * and <code>DELETE_RULE</code>, indicates that
2136+ * if the primary key has been imported, it cannot be updated or deleted.
2137+ * <P>
2138+ * A possible value for the columns <code>UPDATE_RULE</code>
2139+ * and <code>DELETE_RULE</code> in the
2140+ * <code>ResultSet</code> objects returned by the methods
2141+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2142+ * and <code>getCrossReference</code>.
2143+ */
2144+ int importedKeyNoAction = 3;
2145+
2146+ /**
2147+ * For the columns <code>UPDATE_RULE</code>
2148+ * and <code>DELETE_RULE</code>, indicates that
2149+ * if the primary key is updated or deleted, the foreign key (imported key)
2150+ * is set to the default value.
2151+ * <P>
2152+ * A possible value for the columns <code>UPDATE_RULE</code>
2153+ * and <code>DELETE_RULE</code> in the
2154+ * <code>ResultSet</code> objects returned by the methods
2155+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2156+ * and <code>getCrossReference</code>.
2157+ */
2158+ int importedKeySetDefault = 4;
2159+
2160+ /**
2161+ * Indicates deferrability. See SQL-92 for a definition.
2162+ * <P>
2163+ * A possible value for the column <code>DEFERRABILITY</code>
2164+ * in the <code>ResultSet</code> objects returned by the methods
2165+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2166+ * and <code>getCrossReference</code>.
2167+ */
2168+ int importedKeyInitiallyDeferred = 5;
2169+
2170+ /**
2171+ * Indicates deferrability. See SQL-92 for a definition.
2172+ * <P>
2173+ * A possible value for the column <code>DEFERRABILITY</code>
2174+ * in the <code>ResultSet</code> objects returned by the methods
2175+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2176+ * and <code>getCrossReference</code>.
2177+ */
2178+ int importedKeyInitiallyImmediate = 6;
2179+
2180+ /**
2181+ * Indicates deferrability. See SQL-92 for a definition.
2182+ * <P>
2183+ * A possible value for the column <code>DEFERRABILITY</code>
2184+ * in the <code>ResultSet</code> objects returned by the methods
2185+ * <code>getImportedKeys</code>, <code>getExportedKeys</code>,
2186+ * and <code>getCrossReference</code>.
2187+ */
2188+ int importedKeyNotDeferrable = 7;
2189+
2190+ /**
2191+ * Retrieves a description of the foreign key columns that reference the
2192+ * given table's primary key columns (the foreign keys exported by a
2193+ * table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
2194+ * FKTABLE_NAME, and KEY_SEQ.
2195+ *
2196+ * <P>Each foreign key column description has the following columns:
2197+ * <OL>
2198+ * <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be <code>null</code>)
2199+ * <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be <code>null</code>)
2200+ * <LI><B>PKTABLE_NAME</B> String => primary key table name
2201+ * <LI><B>PKCOLUMN_NAME</B> String => primary key column name
2202+ * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be <code>null</code>)
2203+ * being exported (may be <code>null</code>)
2204+ * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be <code>null</code>)
2205+ * being exported (may be <code>null</code>)
2206+ * <LI><B>FKTABLE_NAME</B> String => foreign key table name
2207+ * being exported
2208+ * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
2209+ * being exported
2210+ * <LI><B>KEY_SEQ</B> short => sequence number within foreign key( a value
2211+ * of 1 represents the first column of the foreign key, a value of 2 would
2212+ * represent the second column within the foreign key).
2213+ * <LI><B>UPDATE_RULE</B> short => What happens to
2214+ * foreign key when primary is updated:
2215+ * <UL>
2216+ * <LI> importedNoAction - do not allow update of primary
2217+ * key if it has been imported
2218+ * <LI> importedKeyCascade - change imported key to agree
2219+ * with primary key update
2220+ * <LI> importedKeySetNull - change imported key to <code>NULL</code> if
2221+ * its primary key has been updated
2222+ * <LI> importedKeySetDefault - change imported key to default values
2223+ * if its primary key has been updated
2224+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2225+ * (for ODBC 2.x compatibility)
2226+ * </UL>
2227+ * <LI><B>DELETE_RULE</B> short => What happens to
2228+ * the foreign key when primary is deleted.
2229+ * <UL>
2230+ * <LI> importedKeyNoAction - do not allow delete of primary
2231+ * key if it has been imported
2232+ * <LI> importedKeyCascade - delete rows that import a deleted key
2233+ * <LI> importedKeySetNull - change imported key to <code>NULL</code> if
2234+ * its primary key has been deleted
2235+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2236+ * (for ODBC 2.x compatibility)
2237+ * <LI> importedKeySetDefault - change imported key to default if
2238+ * its primary key has been deleted
2239+ * </UL>
2240+ * <LI><B>FK_NAME</B> String => foreign key name (may be <code>null</code>)
2241+ * <LI><B>PK_NAME</B> String => primary key name (may be <code>null</code>)
2242+ * <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key
2243+ * constraints be deferred until commit
2244+ * <UL>
2245+ * <LI> importedKeyInitiallyDeferred - see SQL92 for definition
2246+ * <LI> importedKeyInitiallyImmediate - see SQL92 for definition
2247+ * <LI> importedKeyNotDeferrable - see SQL92 for definition
2248+ * </UL>
2249+ * </OL>
2250+ *
2251+ * @param catalog a catalog name; must match the catalog name as it
2252+ * is stored in this database; "" retrieves those without a catalog;
2253+ * <code>null</code> means that the catalog name should not be used to narrow
2254+ * the search
2255+ * @param schema a schema name; must match the schema name
2256+ * as it is stored in the database; "" retrieves those without a schema;
2257+ * <code>null</code> means that the schema name should not be used to narrow
2258+ * the search
2259+ * @param table a table name; must match the table name as it is stored
2260+ * in this database
2261+ * @return a <code>ResultSet</code> object in which each row is a
2262+ * foreign key column description
2263+ * @exception SQLException if a database access error occurs
2264+ * @see #getImportedKeys
2265+ */
2266+ ResultSet getExportedKeys(String catalog, String schema,
2267+ String table) throws SQLException;
2268+
2269+ /**
2270+ * Retrieves a description of the foreign key columns in the given foreign key
2271+ * table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table).
2272+ * The number of columns returned from the parent table must match the number of
2273+ * columns that make up the foreign key. They
2274+ * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
2275+ * KEY_SEQ.
2276+ *
2277+ * <P>Each foreign key column description has the following columns:
2278+ * <OL>
2279+ * <LI><B>PKTABLE_CAT</B> String => parent key table catalog (may be <code>null</code>)
2280+ * <LI><B>PKTABLE_SCHEM</B> String => parent key table schema (may be <code>null</code>)
2281+ * <LI><B>PKTABLE_NAME</B> String => parent key table name
2282+ * <LI><B>PKCOLUMN_NAME</B> String => parent key column name
2283+ * <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be <code>null</code>)
2284+ * being exported (may be <code>null</code>)
2285+ * <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be <code>null</code>)
2286+ * being exported (may be <code>null</code>)
2287+ * <LI><B>FKTABLE_NAME</B> String => foreign key table name
2288+ * being exported
2289+ * <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
2290+ * being exported
2291+ * <LI><B>KEY_SEQ</B> short => sequence number within foreign key( a value
2292+ * of 1 represents the first column of the foreign key, a value of 2 would
2293+ * represent the second column within the foreign key).
2294+ * <LI><B>UPDATE_RULE</B> short => What happens to
2295+ * foreign key when parent key is updated:
2296+ * <UL>
2297+ * <LI> importedNoAction - do not allow update of parent
2298+ * key if it has been imported
2299+ * <LI> importedKeyCascade - change imported key to agree
2300+ * with parent key update
2301+ * <LI> importedKeySetNull - change imported key to <code>NULL</code> if
2302+ * its parent key has been updated
2303+ * <LI> importedKeySetDefault - change imported key to default values
2304+ * if its parent key has been updated
2305+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2306+ * (for ODBC 2.x compatibility)
2307+ * </UL>
2308+ * <LI><B>DELETE_RULE</B> short => What happens to
2309+ * the foreign key when parent key is deleted.
2310+ * <UL>
2311+ * <LI> importedKeyNoAction - do not allow delete of parent
2312+ * key if it has been imported
2313+ * <LI> importedKeyCascade - delete rows that import a deleted key
2314+ * <LI> importedKeySetNull - change imported key to <code>NULL</code> if
2315+ * its primary key has been deleted
2316+ * <LI> importedKeyRestrict - same as importedKeyNoAction
2317+ * (for ODBC 2.x compatibility)
2318+ * <LI> importedKeySetDefault - change imported key to default if
2319+ * its parent key has been deleted
2320+ * </UL>
2321+ * <LI><B>FK_NAME</B> String => foreign key name (may be <code>null</code>)
2322+ * <LI><B>PK_NAME</B> String => parent key name (may be <code>null</code>)
2323+ * <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key
2324+ * constraints be deferred until commit
2325+ * <UL>
2326+ * <LI> importedKeyInitiallyDeferred - see SQL92 for definition
2327+ * <LI> importedKeyInitiallyImmediate - see SQL92 for definition
2328+ * <LI> importedKeyNotDeferrable - see SQL92 for definition
2329+ * </UL>
2330+ * </OL>
2331+ *
2332+ * @param parentCatalog a catalog name; must match the catalog name
2333+ * as it is stored in the database; "" retrieves those without a
2334+ * catalog; <code>null</code> means drop catalog name from the selection criteria
2335+ * @param parentSchema a schema name; must match the schema name as
2336+ * it is stored in the database; "" retrieves those without a schema;
2337+ * <code>null</code> means drop schema name from the selection criteria
2338+ * @param parentTable the name of the table that exports the key; must match
2339+ * the table name as it is stored in the database
2340+ * @param foreignCatalog a catalog name; must match the catalog name as
2341+ * it is stored in the database; "" retrieves those without a
2342+ * catalog; <code>null</code> means drop catalog name from the selection criteria
2343+ * @param foreignSchema a schema name; must match the schema name as it
2344+ * is stored in the database; "" retrieves those without a schema;
2345+ * <code>null</code> means drop schema name from the selection criteria
2346+ * @param foreignTable the name of the table that imports the key; must match
2347+ * the table name as it is stored in the database
2348+ * @return <code>ResultSet</code> - each row is a foreign key column description
2349+ * @exception SQLException if a database access error occurs
2350+ * @see #getImportedKeys
2351+ */
2352+ ResultSet getCrossReference(
2353+ String parentCatalog, String parentSchema, String parentTable,
2354+ String foreignCatalog, String foreignSchema, String foreignTable
2355+ ) throws SQLException;
2356+
2357+ /**
2358+ * Retrieves a description of all the data types supported by
2359+ * this database. They are ordered by DATA_TYPE and then by how
2360+ * closely the data type maps to the corresponding JDBC SQL type.
2361+ *
2362+ * <P>If the database supports SQL distinct types, then getTypeInfo() will return
2363+ * a single row with a TYPE_NAME of DISTINCT and a DATA_TYPE of Types.DISTINCT.
2364+ * If the database supports SQL structured types, then getTypeInfo() will return
2365+ * a single row with a TYPE_NAME of STRUCT and a DATA_TYPE of Types.STRUCT.
2366+ *
2367+ * <P>If SQL distinct or structured types are supported, then information on the
2368+ * individual types may be obtained from the getUDTs() method.
2369+ *
2370+
2371+ *
2372+ * <P>Each type description has the following columns:
2373+ * <OL>
2374+ * <LI><B>TYPE_NAME</B> String => Type name
2375+ * <LI><B>DATA_TYPE</B> int => SQL data type from java.sql.Types
2376+ * <LI><B>PRECISION</B> int => maximum precision
2377+ * <LI><B>LITERAL_PREFIX</B> String => prefix used to quote a literal
2378+ * (may be <code>null</code>)
2379+ * <LI><B>LITERAL_SUFFIX</B> String => suffix used to quote a literal
2380+ (may be <code>null</code>)
2381+ * <LI><B>CREATE_PARAMS</B> String => parameters used in creating
2382+ * the type (may be <code>null</code>)
2383+ * <LI><B>NULLABLE</B> short => can you use NULL for this type.
2384+ * <UL>
2385+ * <LI> typeNoNulls - does not allow NULL values
2386+ * <LI> typeNullable - allows NULL values
2387+ * <LI> typeNullableUnknown - nullability unknown
2388+ * </UL>
2389+ * <LI><B>CASE_SENSITIVE</B> boolean=> is it case sensitive.
2390+ * <LI><B>SEARCHABLE</B> short => can you use "WHERE" based on this type:
2391+ * <UL>
2392+ * <LI> typePredNone - No support
2393+ * <LI> typePredChar - Only supported with WHERE .. LIKE
2394+ * <LI> typePredBasic - Supported except for WHERE .. LIKE
2395+ * <LI> typeSearchable - Supported for all WHERE ..
2396+ * </UL>
2397+ * <LI><B>UNSIGNED_ATTRIBUTE</B> boolean => is it unsigned.
2398+ * <LI><B>FIXED_PREC_SCALE</B> boolean => can it be a money value.
2399+ * <LI><B>AUTO_INCREMENT</B> boolean => can it be used for an
2400+ * auto-increment value.
2401+ * <LI><B>LOCAL_TYPE_NAME</B> String => localized version of type name
2402+ * (may be <code>null</code>)
2403+ * <LI><B>MINIMUM_SCALE</B> short => minimum scale supported
2404+ * <LI><B>MAXIMUM_SCALE</B> short => maximum scale supported
2405+ * <LI><B>SQL_DATA_TYPE</B> int => unused
2406+ * <LI><B>SQL_DATETIME_SUB</B> int => unused
2407+ * <LI><B>NUM_PREC_RADIX</B> int => usually 2 or 10
2408+ * </OL>
2409+ *
2410+ * <p>The PRECISION column represents the maximum column size that the server supports for the given datatype.
2411+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
2412+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
2413+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
2414+ * this is the length in bytes. Null is returned for data types where the
2415+ * column size is not applicable.
2416+ *
2417+ * @return a <code>ResultSet</code> object in which each row is an SQL
2418+ * type description
2419+ * @exception SQLException if a database access error occurs
2420+ */
2421+ ResultSet getTypeInfo() throws SQLException;
2422+
2423+ /**
2424+ * Indicates that a <code>NULL</code> value is NOT allowed for this
2425+ * data type.
2426+ * <P>
2427+ * A possible value for column <code>NULLABLE</code> in the
2428+ * <code>ResultSet</code> object returned by the method
2429+ * <code>getTypeInfo</code>.
2430+ */
2431+ int typeNoNulls = 0;
2432+
2433+ /**
2434+ * Indicates that a <code>NULL</code> value is allowed for this
2435+ * data type.
2436+ * <P>
2437+ * A possible value for column <code>NULLABLE</code> in the
2438+ * <code>ResultSet</code> object returned by the method
2439+ * <code>getTypeInfo</code>.
2440+ */
2441+ int typeNullable = 1;
2442+
2443+ /**
2444+ * Indicates that it is not known whether a <code>NULL</code> value
2445+ * is allowed for this data type.
2446+ * <P>
2447+ * A possible value for column <code>NULLABLE</code> in the
2448+ * <code>ResultSet</code> object returned by the method
2449+ * <code>getTypeInfo</code>.
2450+ */
2451+ int typeNullableUnknown = 2;
2452+
2453+ /**
2454+ * Indicates that <code>WHERE</code> search clauses are not supported
2455+ * for this type.
2456+ * <P>
2457+ * A possible value for column <code>SEARCHABLE</code> in the
2458+ * <code>ResultSet</code> object returned by the method
2459+ * <code>getTypeInfo</code>.
2460+ */
2461+ int typePredNone = 0;
2462+
2463+ /**
2464+ * Indicates that the data type
2465+ * can be only be used in <code>WHERE</code> search clauses
2466+ * that use <code>LIKE</code> predicates.
2467+ * <P>
2468+ * A possible value for column <code>SEARCHABLE</code> in the
2469+ * <code>ResultSet</code> object returned by the method
2470+ * <code>getTypeInfo</code>.
2471+ */
2472+ int typePredChar = 1;
2473+
2474+ /**
2475+ * Indicates that the data type can be only be used in <code>WHERE</code>
2476+ * search clauses
2477+ * that do not use <code>LIKE</code> predicates.
2478+ * <P>
2479+ * A possible value for column <code>SEARCHABLE</code> in the
2480+ * <code>ResultSet</code> object returned by the method
2481+ * <code>getTypeInfo</code>.
2482+ */
2483+ int typePredBasic = 2;
2484+
2485+ /**
2486+ * Indicates that all <code>WHERE</code> search clauses can be
2487+ * based on this type.
2488+ * <P>
2489+ * A possible value for column <code>SEARCHABLE</code> in the
2490+ * <code>ResultSet</code> object returned by the method
2491+ * <code>getTypeInfo</code>.
2492+ */
2493+ int typeSearchable = 3;
2494+
2495+ /**
2496+ * Retrieves a description of the given table's indices and statistics. They are
2497+ * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
2498+ *
2499+ * <P>Each index column description has the following columns:
2500+ * <OL>
2501+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
2502+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
2503+ * <LI><B>TABLE_NAME</B> String => table name
2504+ * <LI><B>NON_UNIQUE</B> boolean => Can index values be non-unique.
2505+ * false when TYPE is tableIndexStatistic
2506+ * <LI><B>INDEX_QUALIFIER</B> String => index catalog (may be <code>null</code>);
2507+ * <code>null</code> when TYPE is tableIndexStatistic
2508+ * <LI><B>INDEX_NAME</B> String => index name; <code>null</code> when TYPE is
2509+ * tableIndexStatistic
2510+ * <LI><B>TYPE</B> short => index type:
2511+ * <UL>
2512+ * <LI> tableIndexStatistic - this identifies table statistics that are
2513+ * returned in conjuction with a table's index descriptions
2514+ * <LI> tableIndexClustered - this is a clustered index
2515+ * <LI> tableIndexHashed - this is a hashed index
2516+ * <LI> tableIndexOther - this is some other style of index
2517+ * </UL>
2518+ * <LI><B>ORDINAL_POSITION</B> short => column sequence number
2519+ * within index; zero when TYPE is tableIndexStatistic
2520+ * <LI><B>COLUMN_NAME</B> String => column name; <code>null</code> when TYPE is
2521+ * tableIndexStatistic
2522+ * <LI><B>ASC_OR_DESC</B> String => column sort sequence, "A" => ascending,
2523+ * "D" => descending, may be <code>null</code> if sort sequence is not supported;
2524+ * <code>null</code> when TYPE is tableIndexStatistic
2525+ * <LI><B>CARDINALITY</B> int => When TYPE is tableIndexStatistic, then
2526+ * this is the number of rows in the table; otherwise, it is the
2527+ * number of unique values in the index.
2528+ * <LI><B>PAGES</B> int => When TYPE is tableIndexStatisic then
2529+ * this is the number of pages used for the table, otherwise it
2530+ * is the number of pages used for the current index.
2531+ * <LI><B>FILTER_CONDITION</B> String => Filter condition, if any.
2532+ * (may be <code>null</code>)
2533+ * </OL>
2534+ *
2535+ * @param catalog a catalog name; must match the catalog name as it
2536+ * is stored in this database; "" retrieves those without a catalog;
2537+ * <code>null</code> means that the catalog name should not be used to narrow
2538+ * the search
2539+ * @param schema a schema name; must match the schema name
2540+ * as it is stored in this database; "" retrieves those without a schema;
2541+ * <code>null</code> means that the schema name should not be used to narrow
2542+ * the search
2543+ * @param table a table name; must match the table name as it is stored
2544+ * in this database
2545+ * @param unique when true, return only indices for unique values;
2546+ * when false, return indices regardless of whether unique or not
2547+ * @param approximate when true, result is allowed to reflect approximate
2548+ * or out of data values; when false, results are requested to be
2549+ * accurate
2550+ * @return <code>ResultSet</code> - each row is an index column description
2551+ * @exception SQLException if a database access error occurs
2552+ */
2553+ ResultSet getIndexInfo(String catalog, String schema, String table,
2554+ boolean unique, boolean approximate)
2555+ throws SQLException;
2556+
2557+ /**
2558+ * Indicates that this column contains table statistics that
2559+ * are returned in conjunction with a table's index descriptions.
2560+ * <P>
2561+ * A possible value for column <code>TYPE</code> in the
2562+ * <code>ResultSet</code> object returned by the method
2563+ * <code>getIndexInfo</code>.
2564+ */
2565+ short tableIndexStatistic = 0;
2566+
2567+ /**
2568+ * Indicates that this table index is a clustered index.
2569+ * <P>
2570+ * A possible value for column <code>TYPE</code> in the
2571+ * <code>ResultSet</code> object returned by the method
2572+ * <code>getIndexInfo</code>.
2573+ */
2574+ short tableIndexClustered = 1;
2575+
2576+ /**
2577+ * Indicates that this table index is a hashed index.
2578+ * <P>
2579+ * A possible value for column <code>TYPE</code> in the
2580+ * <code>ResultSet</code> object returned by the method
2581+ * <code>getIndexInfo</code>.
2582+ */
2583+ short tableIndexHashed = 2;
2584+
2585+ /**
2586+ * Indicates that this table index is not a clustered
2587+ * index, a hashed index, or table statistics;
2588+ * it is something other than these.
2589+ * <P>
2590+ * A possible value for column <code>TYPE</code> in the
2591+ * <code>ResultSet</code> object returned by the method
2592+ * <code>getIndexInfo</code>.
2593+ */
2594+ short tableIndexOther = 3;
2595+
2596+ //--------------------------JDBC 2.0-----------------------------
2597+
2598+ /**
2599+ * Retrieves whether this database supports the given result set type.
2600+ *
2601+ * @param type defined in <code>java.sql.ResultSet</code>
2602+ * @return <code>true</code> if so; <code>false</code> otherwise
2603+ * @exception SQLException if a database access error occurs
2604+ * @see Connection
2605+ * @since 1.2
2606+ */
2607+ boolean supportsResultSetType(int type) throws SQLException;
2608+
2609+ /**
2610+ * Retrieves whether this database supports the given concurrency type
2611+ * in combination with the given result set type.
2612+ *
2613+ * @param type defined in <code>java.sql.ResultSet</code>
2614+ * @param concurrency type defined in <code>java.sql.ResultSet</code>
2615+ * @return <code>true</code> if so; <code>false</code> otherwise
2616+ * @exception SQLException if a database access error occurs
2617+ * @see Connection
2618+ * @since 1.2
2619+ */
2620+ boolean supportsResultSetConcurrency(int type, int concurrency)
2621+ throws SQLException;
2622+
2623+ /**
2624+ *
2625+ * Retrieves whether for the given type of <code>ResultSet</code> object,
2626+ * the result set's own updates are visible.
2627+ *
2628+ * @param type the <code>ResultSet</code> type; one of
2629+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2630+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2631+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2632+ * @return <code>true</code> if updates are visible for the given result set type;
2633+ * <code>false</code> otherwise
2634+ * @exception SQLException if a database access error occurs
2635+ * @since 1.2
2636+ */
2637+ boolean ownUpdatesAreVisible(int type) throws SQLException;
2638+
2639+ /**
2640+ * Retrieves whether a result set's own deletes are visible.
2641+ *
2642+ * @param type the <code>ResultSet</code> type; one of
2643+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2644+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2645+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2646+ * @return <code>true</code> if deletes are visible for the given result set type;
2647+ * <code>false</code> otherwise
2648+ * @exception SQLException if a database access error occurs
2649+ * @since 1.2
2650+ */
2651+ boolean ownDeletesAreVisible(int type) throws SQLException;
2652+
2653+ /**
2654+ * Retrieves whether a result set's own inserts are visible.
2655+ *
2656+ * @param type the <code>ResultSet</code> type; one of
2657+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2658+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2659+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2660+ * @return <code>true</code> if inserts are visible for the given result set type;
2661+ * <code>false</code> otherwise
2662+ * @exception SQLException if a database access error occurs
2663+ * @since 1.2
2664+ */
2665+ boolean ownInsertsAreVisible(int type) throws SQLException;
2666+
2667+ /**
2668+ * Retrieves whether updates made by others are visible.
2669+ *
2670+ * @param type the <code>ResultSet</code> type; one of
2671+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2672+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2673+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2674+ * @return <code>true</code> if updates made by others
2675+ * are visible for the given result set type;
2676+ * <code>false</code> otherwise
2677+ * @exception SQLException if a database access error occurs
2678+ * @since 1.2
2679+ */
2680+ boolean othersUpdatesAreVisible(int type) throws SQLException;
2681+
2682+ /**
2683+ * Retrieves whether deletes made by others are visible.
2684+ *
2685+ * @param type the <code>ResultSet</code> type; one of
2686+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2687+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2688+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2689+ * @return <code>true</code> if deletes made by others
2690+ * are visible for the given result set type;
2691+ * <code>false</code> otherwise
2692+ * @exception SQLException if a database access error occurs
2693+ * @since 1.2
2694+ */
2695+ boolean othersDeletesAreVisible(int type) throws SQLException;
2696+
2697+ /**
2698+ * Retrieves whether inserts made by others are visible.
2699+ *
2700+ * @param type the <code>ResultSet</code> type; one of
2701+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2702+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2703+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2704+ * @return <code>true</code> if inserts made by others
2705+ * are visible for the given result set type;
2706+ * <code>false</code> otherwise
2707+ * @exception SQLException if a database access error occurs
2708+ * @since 1.2
2709+ */
2710+ boolean othersInsertsAreVisible(int type) throws SQLException;
2711+
2712+ /**
2713+ * Retrieves whether or not a visible row update can be detected by
2714+ * calling the method <code>ResultSet.rowUpdated</code>.
2715+ *
2716+ * @param type the <code>ResultSet</code> type; one of
2717+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2718+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2719+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2720+ * @return <code>true</code> if changes are detected by the result set type;
2721+ * <code>false</code> otherwise
2722+ * @exception SQLException if a database access error occurs
2723+ * @since 1.2
2724+ */
2725+ boolean updatesAreDetected(int type) throws SQLException;
2726+
2727+ /**
2728+ * Retrieves whether or not a visible row delete can be detected by
2729+ * calling the method <code>ResultSet.rowDeleted</code>. If the method
2730+ * <code>deletesAreDetected</code> returns <code>false</code>, it means that
2731+ * deleted rows are removed from the result set.
2732+ *
2733+ * @param type the <code>ResultSet</code> type; one of
2734+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2735+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2736+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2737+ * @return <code>true</code> if deletes are detected by the given result set type;
2738+ * <code>false</code> otherwise
2739+ * @exception SQLException if a database access error occurs
2740+ * @since 1.2
2741+ */
2742+ boolean deletesAreDetected(int type) throws SQLException;
2743+
2744+ /**
2745+ * Retrieves whether or not a visible row insert can be detected
2746+ * by calling the method <code>ResultSet.rowInserted</code>.
2747+ *
2748+ * @param type the <code>ResultSet</code> type; one of
2749+ * <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2750+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
2751+ * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
2752+ * @return <code>true</code> if changes are detected by the specified result
2753+ * set type; <code>false</code> otherwise
2754+ * @exception SQLException if a database access error occurs
2755+ * @since 1.2
2756+ */
2757+ boolean insertsAreDetected(int type) throws SQLException;
2758+
2759+ /**
2760+ * Retrieves whether this database supports batch updates.
2761+ *
2762+ * @return <code>true</code> if this database supports batch upcates;
2763+ * <code>false</code> otherwise
2764+ * @exception SQLException if a database access error occurs
2765+ * @since 1.2
2766+ */
2767+ boolean supportsBatchUpdates() throws SQLException;
2768+
2769+ /**
2770+ * Retrieves a description of the user-defined types (UDTs) defined
2771+ * in a particular schema. Schema-specific UDTs may have type
2772+ * <code>JAVA_OBJECT</code>, <code>STRUCT</code>,
2773+ * or <code>DISTINCT</code>.
2774+ *
2775+ * <P>Only types matching the catalog, schema, type name and type
2776+ * criteria are returned. They are ordered by <code>DATA_TYPE</code>,
2777+ * <code>TYPE_CAT</code>, <code>TYPE_SCHEM</code> and
2778+ * <code>TYPE_NAME</code>. The type name parameter may be a fully-qualified
2779+ * name. In this case, the catalog and schemaPattern parameters are
2780+ * ignored.
2781+ *
2782+ * <P>Each type description has the following columns:
2783+ * <OL>
2784+ * <LI><B>TYPE_CAT</B> String => the type's catalog (may be <code>null</code>)
2785+ * <LI><B>TYPE_SCHEM</B> String => type's schema (may be <code>null</code>)
2786+ * <LI><B>TYPE_NAME</B> String => type name
2787+ * <LI><B>CLASS_NAME</B> String => Java class name
2788+ * <LI><B>DATA_TYPE</B> int => type value defined in java.sql.Types.
2789+ * One of JAVA_OBJECT, STRUCT, or DISTINCT
2790+ * <LI><B>REMARKS</B> String => explanatory comment on the type
2791+ * <LI><B>BASE_TYPE</B> short => type code of the source type of a
2792+ * DISTINCT type or the type that implements the user-generated
2793+ * reference type of the SELF_REFERENCING_COLUMN of a structured
2794+ * type as defined in java.sql.Types (<code>null</code> if DATA_TYPE is not
2795+ * DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)
2796+ * </OL>
2797+ *
2798+ * <P><B>Note:</B> If the driver does not support UDTs, an empty
2799+ * result set is returned.
2800+ *
2801+ * @param catalog a catalog name; must match the catalog name as it
2802+ * is stored in the database; "" retrieves those without a catalog;
2803+ * <code>null</code> means that the catalog name should not be used to narrow
2804+ * the search
2805+ * @param schemaPattern a schema pattern name; must match the schema name
2806+ * as it is stored in the database; "" retrieves those without a schema;
2807+ * <code>null</code> means that the schema name should not be used to narrow
2808+ * the search
2809+ * @param typeNamePattern a type name pattern; must match the type name
2810+ * as it is stored in the database; may be a fully qualified name
2811+ * @param types a list of user-defined types (JAVA_OBJECT,
2812+ * STRUCT, or DISTINCT) to include; <code>null</code> returns all types
2813+ * @return <code>ResultSet</code> object in which each row describes a UDT
2814+ * @exception SQLException if a database access error occurs
2815+ * @see #getSearchStringEscape
2816+ * @since 1.2
2817+ */
2818+ ResultSet getUDTs(String catalog, String schemaPattern,
2819+ String typeNamePattern, int[] types)
2820+ throws SQLException;
2821+
2822+ /**
2823+ * Retrieves the connection that produced this metadata object.
2824+ * <P>
2825+ * @return the connection that produced this metadata object
2826+ * @exception SQLException if a database access error occurs
2827+ * @since 1.2
2828+ */
2829+ Connection getConnection() throws SQLException;
2830+
2831+ // ------------------- JDBC 3.0 -------------------------
2832+
2833+ /**
2834+ * Retrieves whether this database supports savepoints.
2835+ *
2836+ * @return <code>true</code> if savepoints are supported;
2837+ * <code>false</code> otherwise
2838+ * @exception SQLException if a database access error occurs
2839+ * @since 1.4
2840+ */
2841+ boolean supportsSavepoints() throws SQLException;
2842+
2843+ /**
2844+ * Retrieves whether this database supports named parameters to callable
2845+ * statements.
2846+ *
2847+ * @return <code>true</code> if named parameters are supported;
2848+ * <code>false</code> otherwise
2849+ * @exception SQLException if a database access error occurs
2850+ * @since 1.4
2851+ */
2852+ boolean supportsNamedParameters() throws SQLException;
2853+
2854+ /**
2855+ * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects
2856+ * returned from a <code>CallableStatement</code> object
2857+ * simultaneously.
2858+ *
2859+ * @return <code>true</code> if a <code>CallableStatement</code> object
2860+ * can return multiple <code>ResultSet</code> objects
2861+ * simultaneously; <code>false</code> otherwise
2862+ * @exception SQLException if a datanase access error occurs
2863+ * @since 1.4
2864+ */
2865+ boolean supportsMultipleOpenResults() throws SQLException;
2866+
2867+ /**
2868+ * Retrieves whether auto-generated keys can be retrieved after
2869+ * a statement has been executed
2870+ *
2871+ * @return <code>true</code> if auto-generated keys can be retrieved
2872+ * after a statement has executed; <code>false</code> otherwise
2873+ *<p>If <code>true</code> is returned, the JDBC driver must support the
2874+ * returning of auto-generated keys for at least SQL INSERT statements
2875+ *<p>
2876+ * @exception SQLException if a database access error occurs
2877+ * @since 1.4
2878+ */
2879+ boolean supportsGetGeneratedKeys() throws SQLException;
2880+
2881+ /**
2882+ * Retrieves a description of the user-defined type (UDT) hierarchies defined in a
2883+ * particular schema in this database. Only the immediate super type/
2884+ * sub type relationship is modeled.
2885+ * <P>
2886+ * Only supertype information for UDTs matching the catalog,
2887+ * schema, and type name is returned. The type name parameter
2888+ * may be a fully-qualified name. When the UDT name supplied is a
2889+ * fully-qualified name, the catalog and schemaPattern parameters are
2890+ * ignored.
2891+ * <P>
2892+ * If a UDT does not have a direct super type, it is not listed here.
2893+ * A row of the <code>ResultSet</code> object returned by this method
2894+ * describes the designated UDT and a direct supertype. A row has the following
2895+ * columns:
2896+ * <OL>
2897+ * <LI><B>TYPE_CAT</B> String => the UDT's catalog (may be <code>null</code>)
2898+ * <LI><B>TYPE_SCHEM</B> String => UDT's schema (may be <code>null</code>)
2899+ * <LI><B>TYPE_NAME</B> String => type name of the UDT
2900+ * <LI><B>SUPERTYPE_CAT</B> String => the direct super type's catalog
2901+ * (may be <code>null</code>)
2902+ * <LI><B>SUPERTYPE_SCHEM</B> String => the direct super type's schema
2903+ * (may be <code>null</code>)
2904+ * <LI><B>SUPERTYPE_NAME</B> String => the direct super type's name
2905+ * </OL>
2906+ *
2907+ * <P><B>Note:</B> If the driver does not support type hierarchies, an
2908+ * empty result set is returned.
2909+ *
2910+ * @param catalog a catalog name; "" retrieves those without a catalog;
2911+ * <code>null</code> means drop catalog name from the selection criteria
2912+ * @param schemaPattern a schema name pattern; "" retrieves those
2913+ * without a schema
2914+ * @param typeNamePattern a UDT name pattern; may be a fully-qualified
2915+ * name
2916+ * @return a <code>ResultSet</code> object in which a row gives information
2917+ * about the designated UDT
2918+ * @throws SQLException if a database access error occurs
2919+ * @see #getSearchStringEscape
2920+ * @since 1.4
2921+ */
2922+ ResultSet getSuperTypes(String catalog, String schemaPattern,
2923+ String typeNamePattern) throws SQLException;
2924+
2925+ /**
2926+ * Retrieves a description of the table hierarchies defined in a particular
2927+ * schema in this database.
2928+ *
2929+ * <P>Only supertable information for tables matching the catalog, schema
2930+ * and table name are returned. The table name parameter may be a fully-
2931+ * qualified name, in which case, the catalog and schemaPattern parameters
2932+ * are ignored. If a table does not have a super table, it is not listed here.
2933+ * Supertables have to be defined in the same catalog and schema as the
2934+ * sub tables. Therefore, the type description does not need to include
2935+ * this information for the supertable.
2936+ *
2937+ * <P>Each type description has the following columns:
2938+ * <OL>
2939+ * <LI><B>TABLE_CAT</B> String => the type's catalog (may be <code>null</code>)
2940+ * <LI><B>TABLE_SCHEM</B> String => type's schema (may be <code>null</code>)
2941+ * <LI><B>TABLE_NAME</B> String => type name
2942+ * <LI><B>SUPERTABLE_NAME</B> String => the direct super type's name
2943+ * </OL>
2944+ *
2945+ * <P><B>Note:</B> If the driver does not support type hierarchies, an
2946+ * empty result set is returned.
2947+ *
2948+ * @param catalog a catalog name; "" retrieves those without a catalog;
2949+ * <code>null</code> means drop catalog name from the selection criteria
2950+ * @param schemaPattern a schema name pattern; "" retrieves those
2951+ * without a schema
2952+ * @param tableNamePattern a table name pattern; may be a fully-qualified
2953+ * name
2954+ * @return a <code>ResultSet</code> object in which each row is a type description
2955+ * @throws SQLException if a database access error occurs
2956+ * @see #getSearchStringEscape
2957+ * @since 1.4
2958+ */
2959+ ResultSet getSuperTables(String catalog, String schemaPattern,
2960+ String tableNamePattern) throws SQLException;
2961+
2962+ /**
2963+ * Indicates that <code>NULL</code> values might not be allowed.
2964+ * <P>
2965+ * A possible value for the column
2966+ * <code>NULLABLE</code> in the <code>ResultSet</code> object
2967+ * returned by the method <code>getAttributes</code>.
2968+ */
2969+ short attributeNoNulls = 0;
2970+
2971+ /**
2972+ * Indicates that <code>NULL</code> values are definitely allowed.
2973+ * <P>
2974+ * A possible value for the column <code>NULLABLE</code>
2975+ * in the <code>ResultSet</code> object
2976+ * returned by the method <code>getAttributes</code>.
2977+ */
2978+ short attributeNullable = 1;
2979+
2980+ /**
2981+ * Indicates that whether <code>NULL</code> values are allowed is not
2982+ * known.
2983+ * <P>
2984+ * A possible value for the column <code>NULLABLE</code>
2985+ * in the <code>ResultSet</code> object
2986+ * returned by the method <code>getAttributes</code>.
2987+ */
2988+ short attributeNullableUnknown = 2;
2989+
2990+ /**
2991+ * Retrieves a description of the given attribute of the given type
2992+ * for a user-defined type (UDT) that is available in the given schema
2993+ * and catalog.
2994+ * <P>
2995+ * Descriptions are returned only for attributes of UDTs matching the
2996+ * catalog, schema, type, and attribute name criteria. They are ordered by
2997+ * <code>TYPE_CAT</code>, <code>TYPE_SCHEM</code>,
2998+ * <code>TYPE_NAME</code> and <code>ORDINAL_POSITION</code>. This description
2999+ * does not contain inherited attributes.
3000+ * <P>
3001+ * The <code>ResultSet</code> object that is returned has the following
3002+ * columns:
3003+ * <OL>
3004+ * <LI><B>TYPE_CAT</B> String => type catalog (may be <code>null</code>)
3005+ * <LI><B>TYPE_SCHEM</B> String => type schema (may be <code>null</code>)
3006+ * <LI><B>TYPE_NAME</B> String => type name
3007+ * <LI><B>ATTR_NAME</B> String => attribute name
3008+ * <LI><B>DATA_TYPE</B> int => attribute type SQL type from java.sql.Types
3009+ * <LI><B>ATTR_TYPE_NAME</B> String => Data source dependent type name.
3010+ * For a UDT, the type name is fully qualified. For a REF, the type name is
3011+ * fully qualified and represents the target type of the reference type.
3012+ * <LI><B>ATTR_SIZE</B> int => column size. For char or date
3013+ * types this is the maximum number of characters; for numeric or
3014+ * decimal types this is precision.
3015+ * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits. Null is returned for data types where
3016+ * DECIMAL_DIGITS is not applicable.
3017+ * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
3018+ * <LI><B>NULLABLE</B> int => whether NULL is allowed
3019+ * <UL>
3020+ * <LI> attributeNoNulls - might not allow NULL values
3021+ * <LI> attributeNullable - definitely allows NULL values
3022+ * <LI> attributeNullableUnknown - nullability unknown
3023+ * </UL>
3024+ * <LI><B>REMARKS</B> String => comment describing column (may be <code>null</code>)
3025+ * <LI><B>ATTR_DEF</B> String => default value (may be <code>null</code>)
3026+ * <LI><B>SQL_DATA_TYPE</B> int => unused
3027+ * <LI><B>SQL_DATETIME_SUB</B> int => unused
3028+ * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
3029+ * maximum number of bytes in the column
3030+ * <LI><B>ORDINAL_POSITION</B> int => index of the attribute in the UDT
3031+ * (starting at 1)
3032+ * <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine
3033+ * the nullability for a attribute.
3034+ * <UL>
3035+ * <LI> YES --- if the attribute can include NULLs
3036+ * <LI> NO --- if the attribute cannot include NULLs
3037+ * <LI> empty string --- if the nullability for the
3038+ * attribute is unknown
3039+ * </UL>
3040+ * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the
3041+ * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF)
3042+ * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the
3043+ * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF)
3044+ * <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a
3045+ * reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
3046+ * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or user-generated
3047+ * Ref type,SQL type from java.sql.Types (<code>null</code> if DATA_TYPE
3048+ * isn't DISTINCT or user-generated REF)
3049+ * </OL>
3050+ * @param catalog a catalog name; must match the catalog name as it
3051+ * is stored in the database; "" retrieves those without a catalog;
3052+ * <code>null</code> means that the catalog name should not be used to narrow
3053+ * the search
3054+ * @param schemaPattern a schema name pattern; must match the schema name
3055+ * as it is stored in the database; "" retrieves those without a schema;
3056+ * <code>null</code> means that the schema name should not be used to narrow
3057+ * the search
3058+ * @param typeNamePattern a type name pattern; must match the
3059+ * type name as it is stored in the database
3060+ * @param attributeNamePattern an attribute name pattern; must match the attribute
3061+ * name as it is declared in the database
3062+ * @return a <code>ResultSet</code> object in which each row is an
3063+ * attribute description
3064+ * @exception SQLException if a database access error occurs
3065+ * @see #getSearchStringEscape
3066+ * @since 1.4
3067+ */
3068+ ResultSet getAttributes(String catalog, String schemaPattern,
3069+ String typeNamePattern, String attributeNamePattern)
3070+ throws SQLException;
3071+
3072+ /**
3073+ * Retrieves whether this database supports the given result set holdability.
3074+ *
3075+ * @param holdability one of the following constants:
3076+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
3077+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT<code>
3078+ * @return <code>true</code> if so; <code>false</code> otherwise
3079+ * @exception SQLException if a database access error occurs
3080+ * @see Connection
3081+ * @since 1.4
3082+ */
3083+ boolean supportsResultSetHoldability(int holdability) throws SQLException;
3084+
3085+ /**
3086+ * Retrieves this database's default holdability for <code>ResultSet</code>
3087+ * objects.
3088+ *
3089+ * @return the default holdability; either
3090+ * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
3091+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
3092+ * @exception SQLException if a database access error occurs
3093+ * @since 1.4
3094+ */
3095+ int getResultSetHoldability() throws SQLException;
3096+
3097+ /**
3098+ * Retrieves the major version number of the underlying database.
3099+ *
3100+ * @return the underlying database's major version
3101+ * @exception SQLException if a database access error occurs
3102+ * @since 1.4
3103+ */
3104+ int getDatabaseMajorVersion() throws SQLException;
3105+
3106+ /**
3107+ * Retrieves the minor version number of the underlying database.
3108+ *
3109+ * @return underlying database's minor version
3110+ * @exception SQLException if a database access error occurs
3111+ * @since 1.4
3112+ */
3113+ int getDatabaseMinorVersion() throws SQLException;
3114+
3115+ /**
3116+ * Retrieves the major JDBC version number for this
3117+ * driver.
3118+ *
3119+ * @return JDBC version major number
3120+ * @exception SQLException if a database access error occurs
3121+ * @since 1.4
3122+ */
3123+ int getJDBCMajorVersion() throws SQLException;
3124+
3125+ /**
3126+ * Retrieves the minor JDBC version number for this
3127+ * driver.
3128+ *
3129+ * @return JDBC version minor number
3130+ * @exception SQLException if a database access error occurs
3131+ * @since 1.4
3132+ */
3133+ int getJDBCMinorVersion() throws SQLException;
3134+
3135+ /**
3136+ * A possible return value for the method
3137+ * <code>DatabaseMetaData.getSQLStateType</code> which is used to indicate
3138+ * whether the value returned by the method
3139+ * <code>SQLException.getSQLState</code> is an
3140+ * X/Open (now know as Open Group) SQL CLI SQLSTATE value.
3141+ * <P>
3142+ * @since 1.4
3143+ */
3144+ int sqlStateXOpen = 1;
3145+
3146+ /**
3147+ * A possible return value for the method
3148+ * <code>DatabaseMetaData.getSQLStateType</code> which is used to indicate
3149+ * whether the value returned by the method
3150+ * <code>SQLException.getSQLState</code> is an SQLSTATE value.
3151+ * <P>
3152+ * @since 1.6
3153+ */
3154+ int sqlStateSQL = 2;
3155+
3156+ /**
3157+ * A possible return value for the method
3158+ * <code>DatabaseMetaData.getSQLStateType</code> which is used to indicate
3159+ * whether the value returned by the method
3160+ * <code>SQLException.getSQLState</code> is an SQL99 SQLSTATE value.
3161+ * <P>
3162+ * <b>Note:</b>This constant remains only for compatibility reasons. Developers
3163+ * should use the constant <code>sqlStateSQL</code> instead.
3164+ *
3165+ * @since 1.4
3166+ */
3167+ int sqlStateSQL99 = sqlStateSQL;
3168+
3169+ /**
3170+ * Indicates whether the SQLSTATE returned by <code>SQLException.getSQLState</code>
3171+ * is X/Open (now known as Open Group) SQL CLI or SQL:2003.
3172+ * @return the type of SQLSTATE; one of:
3173+ * sqlStateXOpen or
3174+ * sqlStateSQL
3175+ * @throws SQLException if a database access error occurs
3176+ * @since 1.4
3177+ */
3178+ int getSQLStateType() throws SQLException;
3179+
3180+ /**
3181+ * Indicates whether updates made to a LOB are made on a copy or directly
3182+ * to the LOB.
3183+ * @return <code>true</code> if updates are made to a copy of the LOB;
3184+ * <code>false</code> if updates are made directly to the LOB
3185+ * @throws SQLException if a database access error occurs
3186+ * @since 1.4
3187+ */
3188+ boolean locatorsUpdateCopy() throws SQLException;
3189+
3190+ /**
3191+ * Retrieves whether this database supports statement pooling.
3192+ *
3193+ * @return <code>true</code> if so; <code>false</code> otherwise
3194+ * @throws SQLException if a database access error occurs
3195+ * @since 1.4
3196+ */
3197+ boolean supportsStatementPooling() throws SQLException;
3198+
3199+ //------------------------- JDBC 4.0 -----------------------------------
3200+
3201+ /**
3202+ * Indicates whether or not this data source supports the SQL <code>ROWID</code> type,
3203+ * and if so the lifetime for which a <code>RowId</code> object remains valid.
3204+ * <p>
3205+ * The returned int values have the following relationship:
3206+ * <pre>
3207+ * ROWID_UNSUPPORTED < ROWID_VALID_OTHER < ROWID_VALID_TRANSACTION
3208+ * < ROWID_VALID_SESSION < ROWID_VALID_FOREVER
3209+ * </pre>
3210+ * so conditional logic such as
3211+ * <pre>
3212+ * if (metadata.getRowIdLifetime() > DatabaseMetaData.ROWID_VALID_TRANSACTION)
3213+ * </pre>
3214+ * can be used. Valid Forever means valid across all Sessions, and valid for
3215+ * a Session means valid across all its contained Transactions.
3216+ *
3217+ * @return the status indicating the lifetime of a <code>RowId</code>
3218+ * @throws SQLException if a database access error occurs
3219+ * @since 1.6
3220+ */
3221+ RowIdLifetime getRowIdLifetime() throws SQLException;
3222+
3223+ /**
3224+ * Retrieves the schema names available in this database. The results
3225+ * are ordered by <code>TABLE_CATALOG</code> and
3226+ * <code>TABLE_SCHEM</code>.
3227+ *
3228+ * <P>The schema columns are:
3229+ * <OL>
3230+ * <LI><B>TABLE_SCHEM</B> String => schema name
3231+ * <LI><B>TABLE_CATALOG</B> String => catalog name (may be <code>null</code>)
3232+ * </OL>
3233+ *
3234+ *
3235+ * @param catalog a catalog name; must match the catalog name as it is stored
3236+ * in the database;"" retrieves those without a catalog; null means catalog
3237+ * name should not be used to narrow down the search.
3238+ * @param schemaPattern a schema name; must match the schema name as it is
3239+ * stored in the database; null means
3240+ * schema name should not be used to narrow down the search.
3241+ * @return a <code>ResultSet</code> object in which each row is a
3242+ * schema description
3243+ * @exception SQLException if a database access error occurs
3244+ * @see #getSearchStringEscape
3245+ * @since 1.6
3246+ */
3247+ ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException;
3248+
3249+ /**
3250+ * Retrieves whether this database supports invoking user-defined or vendor functions
3251+ * using the stored procedure escape syntax.
3252+ *
3253+ * @return <code>true</code> if so; <code>false</code> otherwise
3254+ * @exception SQLException if a database access error occurs
3255+ * @since 1.6
3256+ */
3257+ boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException;
3258+
3259+ /**
3260+ * Retrieves whether a <code>SQLException</code> while autoCommit is <code>true</code> inidcates
3261+ * that all open ResultSets are closed, even ones that are holdable. When a <code>SQLException</code> occurs while
3262+ * autocommit is <code>true</code>, it is vendor specific whether the JDBC driver responds with a commit operation, a
3263+ * rollback operation, or by doing neither a commit nor a rollback. A potential result of this difference
3264+ * is in whether or not holdable ResultSets are closed.
3265+ *
3266+ * @return <code>true</code> if so; <code>false</code> otherwise
3267+ * @exception SQLException if a database access error occurs
3268+ * @since 1.6
3269+ */
3270+ boolean autoCommitFailureClosesAllResultSets() throws SQLException;
3271+ /**
3272+ * Retrieves a list of the client info properties
3273+ * that the driver supports. The result set contains the following columns
3274+ * <p>
3275+ * <ol>
3276+ * <li><b>NAME</b> String=> The name of the client info property<br>
3277+ * <li><b>MAX_LEN</b> int=> The maximum length of the value for the property<br>
3278+ * <li><b>DEFAULT_VALUE</b> String=> The default value of the property<br>
3279+ * <li><b>DESCRIPTION</b> String=> A description of the property. This will typically
3280+ * contain information as to where this property is
3281+ * stored in the database.
3282+ * </ol>
3283+ * <p>
3284+ * The <code>ResultSet</code> is sorted by the NAME column
3285+ * <p>
3286+ * @return A <code>ResultSet</code> object; each row is a supported client info
3287+ * property
3288+ * <p>
3289+ * @exception SQLException if a database access error occurs
3290+ * <p>
3291+ * @since 1.6
3292+ */
3293+ ResultSet getClientInfoProperties()
3294+ throws SQLException;
3295+
3296+ /**
3297+ * Retrieves a description of the system and user functions available
3298+ * in the given catalog.
3299+ * <P>
3300+ * Only system and user function descriptions matching the schema and
3301+ * function name criteria are returned. They are ordered by
3302+ * <code>FUNCTION_CAT</code>, <code>FUNCTION_SCHEM</code>,
3303+ * <code>FUNCTION_NAME</code> and
3304+ * <code>SPECIFIC_ NAME</code>.
3305+ *
3306+ * <P>Each function description has the the following columns:
3307+ * <OL>
3308+ * <LI><B>FUNCTION_CAT</B> String => function catalog (may be <code>null</code>)
3309+ * <LI><B>FUNCTION_SCHEM</B> String => function schema (may be <code>null</code>)
3310+ * <LI><B>FUNCTION_NAME</B> String => function name. This is the name
3311+ * used to invoke the function
3312+ * <LI><B>REMARKS</B> String => explanatory comment on the function
3313+ * <LI><B>FUNCTION_TYPE</B> short => kind of function:
3314+ * <UL>
3315+ * <LI>functionResultUnknown - Cannot determine if a return value
3316+ * or table will be returned
3317+ * <LI> functionNoTable- Does not return a table
3318+ * <LI> functionReturnsTable - Returns a table
3319+ * </UL>
3320+ * <LI><B>SPECIFIC_NAME</B> String => the name which uniquely identifies
3321+ * this function within its schema. This is a user specified, or DBMS
3322+ * generated, name that may be different then the <code>FUNCTION_NAME</code>
3323+ * for example with overload functions
3324+ * </OL>
3325+ * <p>
3326+ * A user may not have permission to execute any of the functions that are
3327+ * returned by <code>getFunctions</code>
3328+ *
3329+ * @param catalog a catalog name; must match the catalog name as it
3330+ * is stored in the database; "" retrieves those without a catalog;
3331+ * <code>null</code> means that the catalog name should not be used to narrow
3332+ * the search
3333+ * @param schemaPattern a schema name pattern; must match the schema name
3334+ * as it is stored in the database; "" retrieves those without a schema;
3335+ * <code>null</code> means that the schema name should not be used to narrow
3336+ * the search
3337+ * @param functionNamePattern a function name pattern; must match the
3338+ * function name as it is stored in the database
3339+ * @return <code>ResultSet</code> - each row is a function description
3340+ * @exception SQLException if a database access error occurs
3341+ * @see #getSearchStringEscape
3342+ * @since 1.6
3343+ */
3344+ ResultSet getFunctions(String catalog, String schemaPattern,
3345+ String functionNamePattern) throws SQLException;
3346+ /**
3347+ * Retrieves a description of the given catalog's system or user
3348+ * function parameters and return type.
3349+ *
3350+ * <P>Only descriptions matching the schema, function and
3351+ * parameter name criteria are returned. They are ordered by
3352+ * <code>FUNCTION_CAT</code>, <code>FUNCTION_SCHEM</code>,
3353+ * <code>FUNCTION_NAME</code> and
3354+ * <code>SPECIFIC_ NAME</code>. Within this, the return value,
3355+ * if any, is first. Next are the parameter descriptions in call
3356+ * order. The column descriptions follow in column number order.
3357+ *
3358+ * <P>Each row in the <code>ResultSet</code>
3359+ * is a parameter description, column description or
3360+ * return type description with the following fields:
3361+ * <OL>
3362+ * <LI><B>FUNCTION_CAT</B> String => function catalog (may be <code>null</code>)
3363+ * <LI><B>FUNCTION_SCHEM</B> String => function schema (may be <code>null</code>)
3364+ * <LI><B>FUNCTION_NAME</B> String => function name. This is the name
3365+ * used to invoke the function
3366+ * <LI><B>COLUMN_NAME</B> String => column/parameter name
3367+ * <LI><B>COLUMN_TYPE</B> Short => kind of column/parameter:
3368+ * <UL>
3369+ * <LI> functionColumnUnknown - nobody knows
3370+ * <LI> functionColumnIn - IN parameter
3371+ * <LI> functionColumnInOut - INOUT parameter
3372+ * <LI> functionColumnOut - OUT parameter
3373+ * <LI> functionColumnReturn - function return value
3374+ * <LI> functionColumnResult - Indicates that the parameter or column
3375+ * is a column in the <code>ResultSet</code>
3376+ * </UL>
3377+ * <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types
3378+ * <LI><B>TYPE_NAME</B> String => SQL type name, for a UDT type the
3379+ * type name is fully qualified
3380+ * <LI><B>PRECISION</B> int => precision
3381+ * <LI><B>LENGTH</B> int => length in bytes of data
3382+ * <LI><B>SCALE</B> short => scale - null is returned for data types where
3383+ * SCALE is not applicable.
3384+ * <LI><B>RADIX</B> short => radix
3385+ * <LI><B>NULLABLE</B> short => can it contain NULL.
3386+ * <UL>
3387+ * <LI> functionNoNulls - does not allow NULL values
3388+ * <LI> functionNullable - allows NULL values
3389+ * <LI> functionNullableUnknown - nullability unknown
3390+ * </UL>
3391+ * <LI><B>REMARKS</B> String => comment describing column/parameter
3392+ * <LI><B>CHAR_OCTET_LENGTH</B> int => the maximum length of binary
3393+ * and character based parameters or columns. For any other datatype the returned value
3394+ * is a NULL
3395+ * <LI><B>ORDINAL_POSITION</B> int => the ordinal position, starting
3396+ * from 1, for the input and output parameters. A value of 0
3397+ * is returned if this row describes the function's return value.
3398+ * For result set columns, it is the
3399+ * ordinal position of the column in the result set starting from 1.
3400+ * <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine
3401+ * the nullability for a parameter or column.
3402+ * <UL>
3403+ * <LI> YES --- if the parameter or column can include NULLs
3404+ * <LI> NO --- if the parameter or column cannot include NULLs
3405+ * <LI> empty string --- if the nullability for the
3406+ * parameter or column is unknown
3407+ * </UL>
3408+ * <LI><B>SPECIFIC_NAME</B> String => the name which uniquely identifies
3409+ * this function within its schema. This is a user specified, or DBMS
3410+ * generated, name that may be different then the <code>FUNCTION_NAME</code>
3411+ * for example with overload functions
3412+ * </OL>
3413+ *
3414+ * <p>The PRECISION column represents the specified column size for the given
3415+ * parameter or column.
3416+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
3417+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
3418+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
3419+ * this is the length in bytes. Null is returned for data types where the
3420+ * column size is not applicable.
3421+ * @param catalog a catalog name; must match the catalog name as it
3422+ * is stored in the database; "" retrieves those without a catalog;
3423+ * <code>null</code> means that the catalog name should not be used to narrow
3424+ * the search
3425+ * @param schemaPattern a schema name pattern; must match the schema name
3426+ * as it is stored in the database; "" retrieves those without a schema;
3427+ * <code>null</code> means that the schema name should not be used to narrow
3428+ * the search
3429+ * @param functionNamePattern a procedure name pattern; must match the
3430+ * function name as it is stored in the database
3431+ * @param columnNamePattern a parameter name pattern; must match the
3432+ * parameter or column name as it is stored in the database
3433+ * @return <code>ResultSet</code> - each row describes a
3434+ * user function parameter, column or return type
3435+ *
3436+ * @exception SQLException if a database access error occurs
3437+ * @see #getSearchStringEscape
3438+ * @since 1.6
3439+ */
3440+ ResultSet getFunctionColumns(String catalog,
3441+ String schemaPattern,
3442+ String functionNamePattern,
3443+ String columnNamePattern) throws SQLException;
3444+
3445+
3446+ /**
3447+ * Indicates that type of the parameter or column is unknown.
3448+ * <P>
3449+ * A possible value for the column
3450+ * <code>COLUMN_TYPE</code>
3451+ * in the <code>ResultSet</code>
3452+ * returned by the method <code>getFunctionColumns</code>.
3453+ */
3454+ int functionColumnUnknown = 0;
3455+
3456+ /**
3457+ * Indicates that the parameter or column is an IN parameter.
3458+ * <P>
3459+ * A possible value for the column
3460+ * <code>COLUMN_TYPE</code>
3461+ * in the <code>ResultSet</code>
3462+ * returned by the method <code>getFunctionColumns</code>.
3463+ * @since 1.6
3464+ */
3465+ int functionColumnIn = 1;
3466+
3467+ /**
3468+ * Indicates that the parameter or column is an INOUT parameter.
3469+ * <P>
3470+ * A possible value for the column
3471+ * <code>COLUMN_TYPE</code>
3472+ * in the <code>ResultSet</code>
3473+ * returned by the method <code>getFunctionColumns</code>.
3474+ * @since 1.6
3475+ */
3476+ int functionColumnInOut = 2;
3477+
3478+ /**
3479+ * Indicates that the parameter or column is an OUT parameter.
3480+ * <P>
3481+ * A possible value for the column
3482+ * <code>COLUMN_TYPE</code>
3483+ * in the <code>ResultSet</code>
3484+ * returned by the method <code>getFunctionColumns</code>.
3485+ * @since 1.6
3486+ */
3487+ int functionColumnOut = 3;
3488+ /**
3489+ * Indicates that the parameter or column is a return value.
3490+ * <P>
3491+ * A possible value for the column
3492+ * <code>COLUMN_TYPE</code>
3493+ * in the <code>ResultSet</code>
3494+ * returned by the method <code>getFunctionColumns</code>.
3495+ * @since 1.6
3496+ */
3497+ int functionReturn = 4;
3498+
3499+ /**
3500+ * Indicates that the parameter or column is a column in a result set.
3501+ * <P>
3502+ * A possible value for the column
3503+ * <code>COLUMN_TYPE</code>
3504+ * in the <code>ResultSet</code>
3505+ * returned by the method <code>getFunctionColumns</code>.
3506+ * @since 1.6
3507+ */
3508+ int functionColumnResult = 5;
3509+
3510+
3511+ /**
3512+ * Indicates that <code>NULL</code> values are not allowed.
3513+ * <P>
3514+ * A possible value for the column
3515+ * <code>NULLABLE</code>
3516+ * in the <code>ResultSet</code> object
3517+ * returned by the method <code>getFunctionColumns</code>.
3518+ * @since 1.6
3519+ */
3520+ int functionNoNulls = 0;
3521+
3522+ /**
3523+ * Indicates that <code>NULL</code> values are allowed.
3524+ * <P>
3525+ * A possible value for the column
3526+ * <code>NULLABLE</code>
3527+ * in the <code>ResultSet</code> object
3528+ * returned by the method <code>getFunctionColumns</code>.
3529+ * @since 1.6
3530+ */
3531+ int functionNullable = 1;
3532+
3533+ /**
3534+ * Indicates that whether <code>NULL</code> values are allowed
3535+ * is unknown.
3536+ * <P>
3537+ * A possible value for the column
3538+ * <code>NULLABLE</code>
3539+ * in the <code>ResultSet</code> object
3540+ * returned by the method <code>getFunctionColumns</code>.
3541+ * @since 1.6
3542+ */
3543+ int functionNullableUnknown = 2;
3544+
3545+ /**
3546+ * Indicates that it is not known whether the function returns
3547+ * a result or a table.
3548+ * <P>
3549+ * A possible value for column <code>FUNCTION_TYPE</code> in the
3550+ * <code>ResultSet</code> object returned by the method
3551+ * <code>getFunctions</code>.
3552+ * @since 1.6
3553+ */
3554+ int functionResultUnknown = 0;
3555+
3556+ /**
3557+ * Indicates that the function does not return a table.
3558+ * <P>
3559+ * A possible value for column <code>FUNCTION_TYPE</code> in the
3560+ * <code>ResultSet</code> object returned by the method
3561+ * <code>getFunctions</code>.
3562+ * @since 1.6
3563+ */
3564+ int functionNoTable = 1;
3565+
3566+ /**
3567+ * Indicates that the function returns a table.
3568+ * <P>
3569+ * A possible value for column <code>FUNCTION_TYPE</code> in the
3570+ * <code>ResultSet</code> object returned by the method
3571+ * <code>getFunctions</code>.
3572+ * @since 1.6
3573+ */
3574+ int functionReturnsTable = 2;
3575+
3576+ //--------------------------JDBC 4.1 -----------------------------
3577+
3578+ /**
3579+ * Retrieves a description of the pseudo or hidden columns available
3580+ * in a given table within the specified catalog and schema.
3581+ * Pseudo or hidden columns may not always be stored within
3582+ * a table and are not visible in a ResultSet unless they are
3583+ * specified in the query's outermost SELECT list. Pseudo or hidden
3584+ * columns may not necessarily be able to be modified. If there are
3585+ * no pseudo or hidden columns, an empty ResultSet is returned.
3586+ *
3587+ * <P>Only column descriptions matching the catalog, schema, table
3588+ * and column name criteria are returned. They are ordered by
3589+ * <code>TABLE_CAT</code>,<code>TABLE_SCHEM</code>, <code>TABLE_NAME</code>
3590+ * and <code>COLUMN_NAME</code>.
3591+ *
3592+ * <P>Each column description has the following columns:
3593+ * <OL>
3594+ * <LI><B>TABLE_CAT</B> String => table catalog (may be <code>null</code>)
3595+ * <LI><B>TABLE_SCHEM</B> String => table schema (may be <code>null</code>)
3596+ * <LI><B>TABLE_NAME</B> String => table name
3597+ * <LI><B>COLUMN_NAME</B> String => column name
3598+ * <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types
3599+ * <LI><B>COLUMN_SIZE</B> int => column size.
3600+ * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits. Null is returned for data types where
3601+ * DECIMAL_DIGITS is not applicable.
3602+ * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
3603+ * <LI><B>COLUMN_USAGE</B> String => The allowed usage for the column. The
3604+ * value returned will correspond to the enum name returned by {@link PseudoColumnUsage#name PseudoColumnUsage.name()}
3605+ * <LI><B>REMARKS</B> String => comment describing column (may be <code>null</code>)
3606+ * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
3607+ * maximum number of bytes in the column
3608+ * <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine the nullability for a column.
3609+ * <UL>
3610+ * <LI> YES --- if the column can include NULLs
3611+ * <LI> NO --- if the column cannot include NULLs
3612+ * <LI> empty string --- if the nullability for the column is unknown
3613+ * </UL>
3614+ * </OL>
3615+ *
3616+ * <p>The COLUMN_SIZE column specifies the column size for the given column.
3617+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
3618+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
3619+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
3620+ * this is the length in bytes. Null is returned for data types where the
3621+ * column size is not applicable.
3622+ *
3623+ * @param catalog a catalog name; must match the catalog name as it
3624+ * is stored in the database; "" retrieves those without a catalog;
3625+ * <code>null</code> means that the catalog name should not be used to narrow
3626+ * the search
3627+ * @param schemaPattern a schema name pattern; must match the schema name
3628+ * as it is stored in the database; "" retrieves those without a schema;
3629+ * <code>null</code> means that the schema name should not be used to narrow
3630+ * the search
3631+ * @param tableNamePattern a table name pattern; must match the
3632+ * table name as it is stored in the database
3633+ * @param columnNamePattern a column name pattern; must match the column
3634+ * name as it is stored in the database
3635+ * @return <code>ResultSet</code> - each row is a column description
3636+ * @exception SQLException if a database access error occurs
3637+ * @see PseudoColumnUsage
3638+ * @since 1.7
3639+ */
3640+ ResultSet getPseudoColumns(String catalog, String schemaPattern,
3641+ String tableNamePattern, String columnNamePattern)
3642+ throws SQLException;
3643+
3644+ /**
3645+ * Retrieves whether a generated key will always be returned if the column
3646+ * name(s) or index(es) specified for the auto generated key column(s)
3647+ * are valid and the statement succeeds. The key that is returned may or
3648+ * may not be based on the column(s) for the auto generated key.
3649+ * Consult your JDBC driver documentation for additional details.
3650+ * @return <code>true</code> if so; <code>false</code> otherwise
3651+ * @exception SQLException if a database access error occurs
3652+ * @since 1.7
3653+ */
3654+ boolean generatedKeyAlwaysReturned() throws SQLException;
3655+}
java/pkg/java/sql/Date.class+0−0

Binary file not shown.

java/pkg/java/sql/Date.java+250−0
@@ -0,0 +1,250 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * <P>A thin wrapper around a millisecond value that allows
30+ * JDBC to identify this as an SQL <code>DATE</code> value. A
31+ * milliseconds value represents the number of milliseconds that
32+ * have passed since January 1, 1970 00:00:00.000 GMT.
33+ * <p>
34+ * To conform with the definition of SQL <code>DATE</code>, the
35+ * millisecond values wrapped by a <code>java.sql.Date</code> instance
36+ * must be 'normalized' by setting the
37+ * hours, minutes, seconds, and milliseconds to zero in the particular
38+ * time zone with which the instance is associated.
39+ */
40+public class Date extends java.util.Date {
41+
42+ /**
43+ * Constructs a <code>Date</code> object initialized with the given
44+ * year, month, and day.
45+ * <P>
46+ * The result is undefined if a given argument is out of bounds.
47+ *
48+ * @param year the year minus 1900; must be 0 to 8099. (Note that
49+ * 8099 is 9999 minus 1900.)
50+ * @param month 0 to 11
51+ * @param day 1 to 31
52+ * @deprecated instead use the constructor <code>Date(long date)</code>
53+ */
54+ public Date(int year, int month, int day) {
55+ super(year, month, day);
56+ }
57+
58+ /**
59+ * Constructs a <code>Date</code> object using the given milliseconds
60+ * time value. If the given milliseconds value contains time
61+ * information, the driver will set the time components to the
62+ * time in the default time zone (the time zone of the Java virtual
63+ * machine running the application) that corresponds to zero GMT.
64+ *
65+ * @param date milliseconds since January 1, 1970, 00:00:00 GMT not
66+ * to exceed the milliseconds representation for the year 8099.
67+ * A negative number indicates the number of milliseconds
68+ * before January 1, 1970, 00:00:00 GMT.
69+ */
70+ public Date(long date) {
71+ // If the millisecond date value contains time info, mask it out.
72+ super(date);
73+
74+ }
75+
76+ /**
77+ * Sets an existing <code>Date</code> object
78+ * using the given milliseconds time value.
79+ * If the given milliseconds value contains time information,
80+ * the driver will set the time components to the
81+ * time in the default time zone (the time zone of the Java virtual
82+ * machine running the application) that corresponds to zero GMT.
83+ *
84+ * @param date milliseconds since January 1, 1970, 00:00:00 GMT not
85+ * to exceed the milliseconds representation for the year 8099.
86+ * A negative number indicates the number of milliseconds
87+ * before January 1, 1970, 00:00:00 GMT.
88+ */
89+ public void setTime(long date) {
90+ // If the millisecond date value contains time info, mask it out.
91+ super.setTime(date);
92+ }
93+
94+ /**
95+ * Converts a string in JDBC date escape format to
96+ * a <code>Date</code> value.
97+ *
98+ * @param s a <code>String</code> object representing a date in
99+ * in the format "yyyy-[m]m-[d]d". The leading zero for <code>mm</code>
100+ * and <code>dd</code> may also be omitted.
101+ * @return a <code>java.sql.Date</code> object representing the
102+ * given date
103+ * @throws IllegalArgumentException if the date given is not in the
104+ * JDBC date escape format (yyyy-[m]m-[d]d)
105+ */
106+ public static Date valueOf(String s) {
107+ final int YEAR_LENGTH = 4;
108+ final int MONTH_LENGTH = 2;
109+ final int DAY_LENGTH = 2;
110+ final int MAX_MONTH = 12;
111+ final int MAX_DAY = 31;
112+ int firstDash;
113+ int secondDash;
114+ Date d = null;
115+
116+ if (s == null) {
117+ throw new java.lang.IllegalArgumentException();
118+ }
119+
120+ firstDash = s.indexOf('-');
121+ secondDash = s.indexOf('-', firstDash + 1);
122+
123+ if ((firstDash > 0) && (secondDash > 0) && (secondDash < s.length() - 1)) {
124+ String yyyy = s.substring(0, firstDash);
125+ String mm = s.substring(firstDash + 1, secondDash);
126+ String dd = s.substring(secondDash + 1);
127+ if (yyyy.length() == YEAR_LENGTH &&
128+ (mm.length() >= 1 && mm.length() <= MONTH_LENGTH) &&
129+ (dd.length() >= 1 && dd.length() <= DAY_LENGTH)) {
130+ int year = Integer.parseInt(yyyy);
131+ int month = Integer.parseInt(mm);
132+ int day = Integer.parseInt(dd);
133+
134+ if ((month >= 1 && month <= MAX_MONTH) && (day >= 1 && day <= MAX_DAY)) {
135+ d = new Date(year - 1900, month - 1, day);
136+ }
137+ }
138+ }
139+ if (d == null) {
140+ throw new java.lang.IllegalArgumentException();
141+ }
142+
143+ return d;
144+
145+ }
146+
147+
148+ /**
149+ * Formats a date in the date escape format yyyy-mm-dd.
150+ * <P>
151+ * @return a String in yyyy-mm-dd format
152+ */
153+ public String toString () {
154+ int year = super.getYear() + 1900;
155+ int month = super.getMonth() + 1;
156+ int day = super.getDate();
157+
158+ char buf[] = "2000-00-00".toCharArray();
159+ buf[0] = Character.forDigit(year/1000,10);
160+ buf[1] = Character.forDigit((year/100)%10,10);
161+ buf[2] = Character.forDigit((year/10)%10,10);
162+ buf[3] = Character.forDigit(year%10,10);
163+ buf[5] = Character.forDigit(month/10,10);
164+ buf[6] = Character.forDigit(month%10,10);
165+ buf[8] = Character.forDigit(day/10,10);
166+ buf[9] = Character.forDigit(day%10,10);
167+
168+ return new String(buf);
169+ }
170+
171+ // Override all the time operations inherited from java.util.Date;
172+
173+ /**
174+ * This method is deprecated and should not be used because SQL Date
175+ * values do not have a time component.
176+ *
177+ * @deprecated
178+ * @exception java.lang.IllegalArgumentException if this method is invoked
179+ * @see #setHours
180+ */
181+ public int getHours() {
182+ throw new java.lang.IllegalArgumentException();
183+ }
184+
185+ /**
186+ * This method is deprecated and should not be used because SQL Date
187+ * values do not have a time component.
188+ *
189+ * @deprecated
190+ * @exception java.lang.IllegalArgumentException if this method is invoked
191+ * @see #setMinutes
192+ */
193+ public int getMinutes() {
194+ throw new java.lang.IllegalArgumentException();
195+ }
196+
197+ /**
198+ * This method is deprecated and should not be used because SQL Date
199+ * values do not have a time component.
200+ *
201+ * @deprecated
202+ * @exception java.lang.IllegalArgumentException if this method is invoked
203+ * @see #setSeconds
204+ */
205+ public int getSeconds() {
206+ throw new java.lang.IllegalArgumentException();
207+ }
208+
209+ /**
210+ * This method is deprecated and should not be used because SQL Date
211+ * values do not have a time component.
212+ *
213+ * @deprecated
214+ * @exception java.lang.IllegalArgumentException if this method is invoked
215+ * @see #getHours
216+ */
217+ public void setHours(int i) {
218+ throw new java.lang.IllegalArgumentException();
219+ }
220+
221+ /**
222+ * This method is deprecated and should not be used because SQL Date
223+ * values do not have a time component.
224+ *
225+ * @deprecated
226+ * @exception java.lang.IllegalArgumentException if this method is invoked
227+ * @see #getMinutes
228+ */
229+ public void setMinutes(int i) {
230+ throw new java.lang.IllegalArgumentException();
231+ }
232+
233+ /**
234+ * This method is deprecated and should not be used because SQL Date
235+ * values do not have a time component.
236+ *
237+ * @deprecated
238+ * @exception java.lang.IllegalArgumentException if this method is invoked
239+ * @see #getSeconds
240+ */
241+ public void setSeconds(int i) {
242+ throw new java.lang.IllegalArgumentException();
243+ }
244+
245+ /**
246+ * Private serial version unique ID to ensure serialization
247+ * compatibility.
248+ */
249+ static final long serialVersionUID = 1511598038487230103L;
250+}
java/pkg/java/sql/Driver.class+0−0

Binary file not shown.

java/pkg/java/sql/Driver.java+170−0
@@ -0,0 +1,170 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.logging.Logger;
29+
30+/**
31+ * The interface that every driver class must implement.
32+ * <P>The Java SQL framework allows for multiple database drivers.
33+ *
34+ * <P>Each driver should supply a class that implements
35+ * the Driver interface.
36+ *
37+ * <P>The DriverManager will try to load as many drivers as it can
38+ * find and then for any given connection request, it will ask each
39+ * driver in turn to try to connect to the target URL.
40+ *
41+ * <P>It is strongly recommended that each Driver class should be
42+ * small and standalone so that the Driver class can be loaded and
43+ * queried without bringing in vast quantities of supporting code.
44+ *
45+ * <P>When a Driver class is loaded, it should create an instance of
46+ * itself and register it with the DriverManager. This means that a
47+ * user can load and register a driver by calling
48+ * <pre>
49+ * <code>Class.forName("foo.bah.Driver")</code>
50+ * </pre>
51+ *
52+ * @see DriverManager
53+ * @see Connection
54+ */
55+public interface Driver {
56+
57+ /**
58+ * Attempts to make a database connection to the given URL.
59+ * The driver should return "null" if it realizes it is the wrong kind
60+ * of driver to connect to the given URL. This will be common, as when
61+ * the JDBC driver manager is asked to connect to a given URL it passes
62+ * the URL to each loaded driver in turn.
63+ *
64+ * <P>The driver should throw an <code>SQLException</code> if it is the right
65+ * driver to connect to the given URL but has trouble connecting to
66+ * the database.
67+ *
68+ * <P>The <code>java.util.Properties</code> argument can be used to pass
69+ * arbitrary string tag/value pairs as connection arguments.
70+ * Normally at least "user" and "password" properties should be
71+ * included in the <code>Properties</code> object.
72+ *
73+ * @param url the URL of the database to which to connect
74+ * @param info a list of arbitrary string tag/value pairs as
75+ * connection arguments. Normally at least a "user" and
76+ * "password" property should be included.
77+ * @return a <code>Connection</code> object that represents a
78+ * connection to the URL
79+ * @exception SQLException if a database access error occurs
80+ */
81+ Connection connect(String url, java.util.Properties info)
82+ throws SQLException;
83+
84+ /**
85+ * Retrieves whether the driver thinks that it can open a connection
86+ * to the given URL. Typically drivers will return <code>true</code> if they
87+ * understand the subprotocol specified in the URL and <code>false</code> if
88+ * they do not.
89+ *
90+ * @param url the URL of the database
91+ * @return <code>true</code> if this driver understands the given URL;
92+ * <code>false</code> otherwise
93+ * @exception SQLException if a database access error occurs
94+ */
95+ boolean acceptsURL(String url) throws SQLException;
96+
97+
98+ /**
99+ * Gets information about the possible properties for this driver.
100+ * <P>
101+ * The <code>getPropertyInfo</code> method is intended to allow a generic
102+ * GUI tool to discover what properties it should prompt
103+ * a human for in order to get
104+ * enough information to connect to a database. Note that depending on
105+ * the values the human has supplied so far, additional values may become
106+ * necessary, so it may be necessary to iterate though several calls
107+ * to the <code>getPropertyInfo</code> method.
108+ *
109+ * @param url the URL of the database to which to connect
110+ * @param info a proposed list of tag/value pairs that will be sent on
111+ * connect open
112+ * @return an array of <code>DriverPropertyInfo</code> objects describing
113+ * possible properties. This array may be an empty array if
114+ * no properties are required.
115+ * @exception SQLException if a database access error occurs
116+ */
117+ DriverPropertyInfo[] getPropertyInfo(String url, java.util.Properties info)
118+ throws SQLException;
119+
120+
121+ /**
122+ * Retrieves the driver's major version number. Initially this should be 1.
123+ *
124+ * @return this driver's major version number
125+ */
126+ int getMajorVersion();
127+
128+ /**
129+ * Gets the driver's minor version number. Initially this should be 0.
130+ * @return this driver's minor version number
131+ */
132+ int getMinorVersion();
133+
134+
135+ /**
136+ * Reports whether this driver is a genuine JDBC
137+ * Compliant<sup><font size=-2>TM</font></sup> driver.
138+ * A driver may only report <code>true</code> here if it passes the JDBC
139+ * compliance tests; otherwise it is required to return <code>false</code>.
140+ * <P>
141+ * JDBC compliance requires full support for the JDBC API and full support
142+ * for SQL 92 Entry Level. It is expected that JDBC compliant drivers will
143+ * be available for all the major commercial databases.
144+ * <P>
145+ * This method is not intended to encourage the development of non-JDBC
146+ * compliant drivers, but is a recognition of the fact that some vendors
147+ * are interested in using the JDBC API and framework for lightweight
148+ * databases that do not support full database functionality, or for
149+ * special databases such as document information retrieval where a SQL
150+ * implementation may not be feasible.
151+ * @return <code>true</code> if this driver is JDBC Compliant; <code>false</code>
152+ * otherwise
153+ */
154+ boolean jdbcCompliant();
155+
156+ //------------------------- JDBC 4.1 -----------------------------------
157+
158+ /**
159+ * Return the parent Logger of all the Loggers used by this driver. This
160+ * should be the Logger farthest from the root Logger that is
161+ * still an ancestor of all of the Loggers used by this driver. Configuring
162+ * this Logger will affect all of the log messages generated by the driver.
163+ * In the worst case, this may be the root Logger.
164+ *
165+ * @return the parent Logger for this driver
166+ * @throws SQLFeatureNotSupportedException if the driver does not use <code>java.util.logging<code>.
167+ * @since 1.7
168+ */
169+ public Logger getParentLogger() throws SQLFeatureNotSupportedException;
170+}
java/pkg/java/sql/DriverInfo.class+0−0

Binary file not shown.

java/pkg/java/sql/DriverManager$1.class+0−0

Binary file not shown.

java/pkg/java/sql/DriverManager$2.class+0−0

Binary file not shown.

java/pkg/java/sql/DriverManager.class+0−0

Binary file not shown.

java/pkg/java/sql/DriverManager.java+636−0
@@ -0,0 +1,636 @@
1+/*
2+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.Iterator;
29+import java.util.ServiceLoader;
30+import java.security.AccessController;
31+import java.security.PrivilegedAction;
32+import java.util.concurrent.CopyOnWriteArrayList;
33+
34+
35+/**
36+ * <P>The basic service for managing a set of JDBC drivers.<br>
37+ * <B>NOTE:</B> The {@link <code>DataSource</code>} interface, new in the
38+ * JDBC 2.0 API, provides another way to connect to a data source.
39+ * The use of a <code>DataSource</code> object is the preferred means of
40+ * connecting to a data source.
41+ *
42+ * <P>As part of its initialization, the <code>DriverManager</code> class will
43+ * attempt to load the driver classes referenced in the "jdbc.drivers"
44+ * system property. This allows a user to customize the JDBC Drivers
45+ * used by their applications. For example in your
46+ * ~/.hotjava/properties file you might specify:
47+ * <pre>
48+ * <CODE>jdbc.drivers=foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriver</CODE>
49+ * </pre>
50+ *<P> The <code>DriverManager</code> methods <code>getConnection</code> and
51+ * <code>getDrivers</code> have been enhanced to support the Java Standard Edition
52+ * <a href="../../../technotes/guides/jar/jar.html#Service%20Provider">Service Provider</a> mechanism. JDBC 4.0 Drivers must
53+ * include the file <code>META-INF/services/java.sql.Driver</code>. This file contains the name of the JDBC drivers
54+ * implementation of <code>java.sql.Driver</code>. For example, to load the <code>my.sql.Driver</code> class,
55+ * the <code>META-INF/services/java.sql.Driver</code> file would contain the entry:
56+ * <pre>
57+ * <code>my.sql.Driver</code>
58+ * </pre>
59+ *
60+ * <P>Applications no longer need to explictly load JDBC drivers using <code>Class.forName()</code>. Existing programs
61+ * which currently load JDBC drivers using <code>Class.forName()</code> will continue to work without
62+ * modification.
63+ *
64+ * <P>When the method <code>getConnection</code> is called,
65+ * the <code>DriverManager</code> will attempt to
66+ * locate a suitable driver from amongst those loaded at
67+ * initialization and those loaded explicitly using the same classloader
68+ * as the current applet or application.
69+ *
70+ * <P>
71+ * Starting with the Java 2 SDK, Standard Edition, version 1.3, a
72+ * logging stream can be set only if the proper
73+ * permission has been granted. Normally this will be done with
74+ * the tool PolicyTool, which can be used to grant <code>permission
75+ * java.sql.SQLPermission "setLog"</code>.
76+ * @see Driver
77+ * @see Connection
78+ */
79+public class DriverManager {
80+
81+
82+ // List of registered JDBC drivers
83+ private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>();
84+ private static volatile int loginTimeout = 0;
85+ private static volatile java.io.PrintWriter logWriter = null;
86+ private static volatile java.io.PrintStream logStream = null;
87+ // Used in println() to synchronize logWriter
88+ private final static Object logSync = new Object();
89+
90+ /* Prevent the DriverManager class from being instantiated. */
91+ private DriverManager(){}
92+
93+
94+ /**
95+ * Load the initial JDBC drivers by checking the System property
96+ * jdbc.properties and then use the {@code ServiceLoader} mechanism
97+ */
98+ static {
99+ loadInitialDrivers();
100+ println("JDBC DriverManager initialized");
101+ }
102+
103+ /**
104+ * The <code>SQLPermission</code> constant that allows the
105+ * setting of the logging stream.
106+ * @since 1.3
107+ */
108+ final static SQLPermission SET_LOG_PERMISSION =
109+ new SQLPermission("setLog");
110+
111+ //--------------------------JDBC 2.0-----------------------------
112+
113+ /**
114+ * Retrieves the log writer.
115+ *
116+ * The <code>getLogWriter</code> and <code>setLogWriter</code>
117+ * methods should be used instead
118+ * of the <code>get/setlogStream</code> methods, which are deprecated.
119+ * @return a <code>java.io.PrintWriter</code> object
120+ * @see #setLogWriter
121+ * @since 1.2
122+ */
123+ public static java.io.PrintWriter getLogWriter() {
124+ return logWriter;
125+ }
126+
127+ /**
128+ * Sets the logging/tracing <code>PrintWriter</code> object
129+ * that is used by the <code>DriverManager</code> and all drivers.
130+ * <P>
131+ * There is a minor versioning problem created by the introduction
132+ * of the method <code>setLogWriter</code>. The
133+ * method <code>setLogWriter</code> cannot create a <code>PrintStream</code> object
134+ * that will be returned by <code>getLogStream</code>---the Java platform does
135+ * not provide a backward conversion. As a result, a new application
136+ * that uses <code>setLogWriter</code> and also uses a JDBC 1.0 driver that uses
137+ * <code>getLogStream</code> will likely not see debugging information written
138+ * by that driver.
139+ *<P>
140+ * Starting with the Java 2 SDK, Standard Edition, version 1.3 release, this method checks
141+ * to see that there is an <code>SQLPermission</code> object before setting
142+ * the logging stream. If a <code>SecurityManager</code> exists and its
143+ * <code>checkPermission</code> method denies setting the log writer, this
144+ * method throws a <code>java.lang.SecurityException</code>.
145+ *
146+ * @param out the new logging/tracing <code>PrintStream</code> object;
147+ * <code>null</code> to disable logging and tracing
148+ * @throws SecurityException
149+ * if a security manager exists and its
150+ * <code>checkPermission</code> method denies
151+ * setting the log writer
152+ *
153+ * @see SecurityManager#checkPermission
154+ * @see #getLogWriter
155+ * @since 1.2
156+ */
157+ public static void setLogWriter(java.io.PrintWriter out) {
158+
159+ SecurityManager sec = System.getSecurityManager();
160+ if (sec != null) {
161+ sec.checkPermission(SET_LOG_PERMISSION);
162+ }
163+ logStream = null;
164+ logWriter = out;
165+ }
166+
167+
168+ //---------------------------------------------------------------
169+
170+ /**
171+ * Attempts to establish a connection to the given database URL.
172+ * The <code>DriverManager</code> attempts to select an appropriate driver from
173+ * the set of registered JDBC drivers.
174+ *
175+ * @param url a database url of the form
176+ * <code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
177+ * @param info a list of arbitrary string tag/value pairs as
178+ * connection arguments; normally at least a "user" and
179+ * "password" property should be included
180+ * @return a Connection to the URL
181+ * @exception SQLException if a database access error occurs
182+ */
183+ public static Connection getConnection(String url,
184+ java.util.Properties info) throws SQLException {
185+
186+ // Gets the classloader of the code that called this method, may
187+ // be null.
188+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
189+
190+ return (getConnection(url, info, callerCL));
191+ }
192+
193+ /**
194+ * Attempts to establish a connection to the given database URL.
195+ * The <code>DriverManager</code> attempts to select an appropriate driver from
196+ * the set of registered JDBC drivers.
197+ *
198+ * @param url a database url of the form
199+ * <code>jdbc:<em>subprotocol</em>:<em>subname</em></code>
200+ * @param user the database user on whose behalf the connection is being
201+ * made
202+ * @param password the user's password
203+ * @return a connection to the URL
204+ * @exception SQLException if a database access error occurs
205+ */
206+ public static Connection getConnection(String url,
207+ String user, String password) throws SQLException {
208+ java.util.Properties info = new java.util.Properties();
209+
210+ // Gets the classloader of the code that called this method, may
211+ // be null.
212+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
213+
214+ if (user != null) {
215+ info.put("user", user);
216+ }
217+ if (password != null) {
218+ info.put("password", password);
219+ }
220+
221+ return (getConnection(url, info, callerCL));
222+ }
223+
224+ /**
225+ * Attempts to establish a connection to the given database URL.
226+ * The <code>DriverManager</code> attempts to select an appropriate driver from
227+ * the set of registered JDBC drivers.
228+ *
229+ * @param url a database url of the form
230+ * <code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
231+ * @return a connection to the URL
232+ * @exception SQLException if a database access error occurs
233+ */
234+ public static Connection getConnection(String url)
235+ throws SQLException {
236+
237+ java.util.Properties info = new java.util.Properties();
238+
239+ // Gets the classloader of the code that called this method, may
240+ // be null.
241+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
242+
243+ return (getConnection(url, info, callerCL));
244+ }
245+
246+ /**
247+ * Attempts to locate a driver that understands the given URL.
248+ * The <code>DriverManager</code> attempts to select an appropriate driver from
249+ * the set of registered JDBC drivers.
250+ *
251+ * @param url a database URL of the form
252+ * <code>jdbc:<em>subprotocol</em>:<em>subname</em></code>
253+ * @return a <code>Driver</code> object representing a driver
254+ * that can connect to the given URL
255+ * @exception SQLException if a database access error occurs
256+ */
257+ public static Driver getDriver(String url)
258+ throws SQLException {
259+
260+ println("DriverManager.getDriver(\"" + url + "\")");
261+
262+ // Gets the classloader of the code that called this method, may
263+ // be null.
264+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
265+
266+ // Walk through the loaded registeredDrivers attempting to locate someone
267+ // who understands the given URL.
268+ for (DriverInfo aDriver : registeredDrivers) {
269+ // If the caller does not have permission to load the driver then
270+ // skip it.
271+ if(isDriverAllowed(aDriver.driver, callerCL)) {
272+ try {
273+ if(aDriver.driver.acceptsURL(url)) {
274+ // Success!
275+ println("getDriver returning " + aDriver.driver.getClass().getName());
276+ return (aDriver.driver);
277+ }
278+
279+ } catch(SQLException sqe) {
280+ // Drop through and try the next driver.
281+ }
282+ } else {
283+ println(" skipping: " + aDriver.driver.getClass().getName());
284+ }
285+
286+ }
287+
288+ println("getDriver: no suitable driver");
289+ throw new SQLException("No suitable driver", "08001");
290+ }
291+
292+
293+ /**
294+ * Registers the given driver with the <code>DriverManager</code>.
295+ * A newly-loaded driver class should call
296+ * the method <code>registerDriver</code> to make itself
297+ * known to the <code>DriverManager</code>.
298+ *
299+ * @param driver the new JDBC Driver that is to be registered with the
300+ * <code>DriverManager</code>
301+ * @exception SQLException if a database access error occurs
302+ */
303+ public static synchronized void registerDriver(java.sql.Driver driver)
304+ throws SQLException {
305+
306+ /* Register the driver if it has not already been added to our list */
307+ if(driver != null) {
308+ registeredDrivers.addIfAbsent(new DriverInfo(driver));
309+ } else {
310+ // This is for compatibility with the original DriverManager
311+ throw new NullPointerException();
312+ }
313+
314+ println("registerDriver: " + driver);
315+
316+ }
317+
318+ /**
319+ * Drops a driver from the <code>DriverManager</code>'s list.
320+ * Applets can only deregister drivers from their own classloaders.
321+ *
322+ * @param driver the JDBC Driver to drop
323+ * @exception SQLException if a database access error occurs
324+ */
325+ public static synchronized void deregisterDriver(Driver driver)
326+ throws SQLException {
327+ if (driver == null) {
328+ return;
329+ }
330+
331+ // Gets the classloader of the code that called this method,
332+ // may be null.
333+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
334+ println("DriverManager.deregisterDriver: " + driver);
335+
336+ DriverInfo aDriver = new DriverInfo(driver);
337+ if(registeredDrivers.contains(aDriver)) {
338+ if (isDriverAllowed(driver, callerCL)) {
339+ registeredDrivers.remove(aDriver);
340+ } else {
341+ // If the caller does not have permission to load the driver then
342+ // throw a SecurityException.
343+ throw new SecurityException();
344+ }
345+ } else {
346+ println(" couldn't find driver to unload");
347+ }
348+ }
349+
350+ /**
351+ * Retrieves an Enumeration with all of the currently loaded JDBC drivers
352+ * to which the current caller has access.
353+ *
354+ * <P><B>Note:</B> The classname of a driver can be found using
355+ * <CODE>d.getClass().getName()</CODE>
356+ *
357+ * @return the list of JDBC Drivers loaded by the caller's class loader
358+ */
359+ public static java.util.Enumeration<Driver> getDrivers() {
360+ java.util.Vector<Driver> result = new java.util.Vector<Driver>();
361+
362+ // Gets the classloader of the code that called this method, may
363+ // be null.
364+ ClassLoader callerCL = DriverManager.getCallerClassLoader();
365+
366+ // Walk through the loaded registeredDrivers.
367+ for(DriverInfo aDriver : registeredDrivers) {
368+ // If the caller does not have permission to load the driver then
369+ // skip it.
370+ if(isDriverAllowed(aDriver.driver, callerCL)) {
371+ result.addElement(aDriver.driver);
372+ } else {
373+ println(" skipping: " + aDriver.getClass().getName());
374+ }
375+ }
376+ return (result.elements());
377+ }
378+
379+
380+ /**
381+ * Sets the maximum time in seconds that a driver will wait
382+ * while attempting to connect to a database.
383+ *
384+ * @param seconds the login time limit in seconds; zero means there is no limit
385+ * @see #getLoginTimeout
386+ */
387+ public static void setLoginTimeout(int seconds) {
388+ loginTimeout = seconds;
389+ }
390+
391+ /**
392+ * Gets the maximum time in seconds that a driver can wait
393+ * when attempting to log in to a database.
394+ *
395+ * @return the driver login time limit in seconds
396+ * @see #setLoginTimeout
397+ */
398+ public static int getLoginTimeout() {
399+ return (loginTimeout);
400+ }
401+
402+ /**
403+ * Sets the logging/tracing PrintStream that is used
404+ * by the <code>DriverManager</code>
405+ * and all drivers.
406+ *<P>
407+ * In the Java 2 SDK, Standard Edition, version 1.3 release, this method checks
408+ * to see that there is an <code>SQLPermission</code> object before setting
409+ * the logging stream. If a <code>SecurityManager</code> exists and its
410+ * <code>checkPermission</code> method denies setting the log writer, this
411+ * method throws a <code>java.lang.SecurityException</code>.
412+ *
413+ * @param out the new logging/tracing PrintStream; to disable, set to <code>null</code>
414+ * @deprecated
415+ * @throws SecurityException if a security manager exists and its
416+ * <code>checkPermission</code> method denies setting the log stream
417+ *
418+ * @see SecurityManager#checkPermission
419+ * @see #getLogStream
420+ */
421+ public static void setLogStream(java.io.PrintStream out) {
422+
423+ SecurityManager sec = System.getSecurityManager();
424+ if (sec != null) {
425+ sec.checkPermission(SET_LOG_PERMISSION);
426+ }
427+
428+ logStream = out;
429+ if ( out != null )
430+ logWriter = new java.io.PrintWriter(out);
431+ else
432+ logWriter = null;
433+ }
434+
435+ /**
436+ * Retrieves the logging/tracing PrintStream that is used by the <code>DriverManager</code>
437+ * and all drivers.
438+ *
439+ * @return the logging/tracing PrintStream; if disabled, is <code>null</code>
440+ * @deprecated
441+ * @see #setLogStream
442+ */
443+ public static java.io.PrintStream getLogStream() {
444+ return logStream;
445+ }
446+
447+ /**
448+ * Prints a message to the current JDBC log stream.
449+ *
450+ * @param message a log or tracing message
451+ */
452+ public static void println(String message) {
453+ synchronized (logSync) {
454+ if (logWriter != null) {
455+ logWriter.println(message);
456+
457+ // automatic flushing is never enabled, so we must do it ourselves
458+ logWriter.flush();
459+ }
460+ }
461+ }
462+
463+ //------------------------------------------------------------------------
464+
465+ // Indicates whether the class object that would be created if the code calling
466+ // DriverManager is accessible.
467+ private static boolean isDriverAllowed(Driver driver, ClassLoader classLoader) {
468+ boolean result = false;
469+ if(driver != null) {
470+ Class<?> aClass = null;
471+ try {
472+ aClass = Class.forName(driver.getClass().getName(), true, classLoader);
473+ } catch (Exception ex) {
474+ result = false;
475+ }
476+
477+ result = ( aClass == driver.getClass() ) ? true : false;
478+ }
479+
480+ return result;
481+ }
482+
483+ private static void loadInitialDrivers() {
484+ String drivers;
485+ try {
486+ drivers = AccessController.doPrivileged(new PrivilegedAction<String>() {
487+ public String run() {
488+ return System.getProperty("jdbc.drivers");
489+ }
490+ });
491+ } catch (Exception ex) {
492+ drivers = null;
493+ }
494+ // If the driver is packaged as a Service Provider, load it.
495+ // Get all the drivers through the classloader
496+ // exposed as a java.sql.Driver.class service.
497+ // ServiceLoader.load() replaces the sun.misc.Providers()
498+
499+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
500+ public Void run() {
501+
502+ ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class);
503+ Iterator driversIterator = loadedDrivers.iterator();
504+
505+ /* Load these drivers, so that they can be instantiated.
506+ * It may be the case that the driver class may not be there
507+ * i.e. there may be a packaged driver with the service class
508+ * as implementation of java.sql.Driver but the actual class
509+ * may be missing. In that case a java.util.ServiceConfigurationError
510+ * will be thrown at runtime by the VM trying to locate
511+ * and load the service.
512+ *
513+ * Adding a try catch block to catch those runtime errors
514+ * if driver not available in classpath but it's
515+ * packaged as service and that service is there in classpath.
516+ */
517+ try{
518+ while(driversIterator.hasNext()) {
519+ println(" Loading done by the java.util.ServiceLoader : "+driversIterator.next());
520+ }
521+ } catch(Throwable t) {
522+ // Do nothing
523+ }
524+ return null;
525+ }
526+ });
527+
528+ println("DriverManager.initialize: jdbc.drivers = " + drivers);
529+
530+ if (drivers == null || drivers.equals("")) {
531+ return;
532+ }
533+ String[] driversList = drivers.split(":");
534+ println("number of Drivers:" + driversList.length);
535+ for (String aDriver : driversList) {
536+ try {
537+ println("DriverManager.Initialize: loading " + aDriver);
538+ Class.forName(aDriver, true,
539+ ClassLoader.getSystemClassLoader());
540+ } catch (Exception ex) {
541+ println("DriverManager.Initialize: load failed: " + ex);
542+ }
543+ }
544+ }
545+
546+
547+ // Worker method called by the public getConnection() methods.
548+ private static Connection getConnection(
549+ String url, java.util.Properties info, ClassLoader callerCL) throws SQLException {
550+ /*
551+ * When callerCl is null, we should check the application's
552+ * (which is invoking this class indirectly)
553+ * classloader, so that the JDBC driver class outside rt.jar
554+ * can be loaded from here.
555+ */
556+ synchronized(DriverManager.class) {
557+ // synchronize loading of the correct classloader.
558+ if(callerCL == null) {
559+ callerCL = Thread.currentThread().getContextClassLoader();
560+ }
561+ }
562+
563+ if(url == null) {
564+ throw new SQLException("The url cannot be null", "08001");
565+ }
566+
567+ println("DriverManager.getConnection(\"" + url + "\")");
568+
569+ // Walk through the loaded registeredDrivers attempting to make a connection.
570+ // Remember the first exception that gets raised so we can reraise it.
571+ SQLException reason = null;
572+
573+ for(DriverInfo aDriver : registeredDrivers) {
574+ // If the caller does not have permission to load the driver then
575+ // skip it.
576+ if(isDriverAllowed(aDriver.driver, callerCL)) {
577+ try {
578+ println(" trying " + aDriver.driver.getClass().getName());
579+ Connection con = aDriver.driver.connect(url, info);
580+ if (con != null) {
581+ // Success!
582+ println("getConnection returning " + aDriver.driver.getClass().getName());
583+ return (con);
584+ }
585+ } catch (SQLException ex) {
586+ if (reason == null) {
587+ reason = ex;
588+ }
589+ }
590+
591+ } else {
592+ println(" skipping: " + aDriver.getClass().getName());
593+ }
594+
595+ }
596+
597+ // if we got here nobody could connect.
598+ if (reason != null) {
599+ println("getConnection failed: " + reason);
600+ throw reason;
601+ }
602+
603+ println("getConnection: no suitable driver found for "+ url);
604+ throw new SQLException("No suitable driver found for "+ url, "08001");
605+ }
606+
607+ /* Returns the caller's class loader, or null if none */
608+ private static native ClassLoader getCallerClassLoader();
609+
610+}
611+
612+/*
613+ * Wrapper class for registered Drivers in order to not expose Driver.equals()
614+ * to avoid the capture of the Driver it being compared to as it might not
615+ * normally have access.
616+ */
617+class DriverInfo {
618+
619+ final Driver driver;
620+ DriverInfo(Driver driver) {
621+ this.driver = driver;
622+ }
623+
624+ public boolean equals(Object other) {
625+ return (other instanceof DriverInfo)
626+ && this.driver == ((DriverInfo) other).driver;
627+ }
628+
629+ public int hashCode() {
630+ return driver.hashCode();
631+ }
632+
633+ public String toString() {
634+ return ("driver[className=" + driver + "]");
635+ }
636+}
java/pkg/java/sql/DriverPropertyInfo.class+0−0

Binary file not shown.

java/pkg/java/sql/DriverPropertyInfo.java+84−0
@@ -0,0 +1,84 @@
1+/*
2+ * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * <p>Driver properties for making a connection. The
30+ * <code>DriverPropertyInfo</code> class is of interest only to advanced programmers
31+ * who need to interact with a Driver via the method
32+ * <code>getDriverProperties</code> to discover
33+ * and supply properties for connections.
34+ */
35+
36+public class DriverPropertyInfo {
37+
38+ /**
39+ * Constructs a <code>DriverPropertyInfo</code> object with a given
40+ * name and value. The <code>description</code> and <code>choices</code>
41+ * are intialized to <code>null</code> and <code>required</code> is initialized
42+ * to <code>false</code>.
43+ *
44+ * @param name the name of the property
45+ * @param value the current value, which may be null
46+ */
47+ public DriverPropertyInfo(String name, String value) {
48+ this.name = name;
49+ this.value = value;
50+ }
51+
52+ /**
53+ * The name of the property.
54+ */
55+ public String name;
56+
57+ /**
58+ * A brief description of the property, which may be null.
59+ */
60+ public String description = null;
61+
62+ /**
63+ * The <code>required</code> field is <code>true</code> if a value must be
64+ * supplied for this property
65+ * during <code>Driver.connect</code> and <code>false</code> otherwise.
66+ */
67+ public boolean required = false;
68+
69+ /**
70+ * The <code>value</code> field specifies the current value of
71+ * the property, based on a combination of the information
72+ * supplied to the method <code>getPropertyInfo</code>, the
73+ * Java environment, and the driver-supplied default values. This field
74+ * may be null if no value is known.
75+ */
76+ public String value = null;
77+
78+ /**
79+ * An array of possible values if the value for the field
80+ * <code>DriverPropertyInfo.value</code> may be selected
81+ * from a particular set of values; otherwise null.
82+ */
83+ public String[] choices = null;
84+}
java/pkg/java/sql/NClob.class+0−0

Binary file not shown.

java/pkg/java/sql/NClob.java+55−0
@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.sql.Clob;
29+
30+/**
31+ * The mapping in the Java<sup><font size=-2>TM</font></sup> programming language
32+ * for the SQL <code>NCLOB</code> type.
33+ * An SQL <code>NCLOB</code> is a built-in type
34+ * that stores a Character Large Object using the National Character Set
35+ * as a column value in a row of a database table.
36+ * <P>The <code>NClob</code> interface extends the <code>Clob</code> interface
37+ * which provides provides methods for getting the
38+ * length of an SQL <code>NCLOB</code> value,
39+ * for materializing a <code>NCLOB</code> value on the client, and for
40+ * searching for a substring or <code>NCLOB</code> object within a
41+ * <code>NCLOB</code> value. A <code>NClob</code> object, just like a <code>Clob</code> object, is valid for the duration
42+ * of the transaction in which it was created.
43+ * Methods in the interfaces {@link ResultSet},
44+ * {@link CallableStatement}, and {@link PreparedStatement}, such as
45+ * <code>getNClob</code> and <code>setNClob</code> allow a programmer to
46+ * access an SQL <code>NCLOB</code> value. In addition, this interface
47+ * has methods for updating a <code>NCLOB</code> value.
48+ * <p>
49+ * All methods on the <code>NClob</code> interface must be fully implemented if the
50+ * JDBC driver supports the data type.
51+ *
52+ * @since 1.6
53+ */
54+
55+public interface NClob extends Clob { }
java/pkg/java/sql/ParameterMetaData.class+0−0

Binary file not shown.

java/pkg/java/sql/ParameterMetaData.java+196−0
@@ -0,0 +1,196 @@
1+/*
2+ * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * An object that can be used to get information about the types
30+ * and properties for each parameter marker in a
31+ * <code>PreparedStatement</code> object. For some queries and driver
32+ * implementations, the data that would be returned by a <code>ParameterMetaData</code>
33+ * object may not be available until the <code>PreparedStatement</code> has
34+ * been executed.
35+ *<p>
36+ *Some driver implementations may not be able to provide information about the
37+ *types and properties for each parameter marker in a <code>CallableStatement</code>
38+ *object.
39+ *
40+ * @since 1.4
41+ */
42+
43+public interface ParameterMetaData extends Wrapper {
44+
45+ /**
46+ * Retrieves the number of parameters in the <code>PreparedStatement</code>
47+ * object for which this <code>ParameterMetaData</code> object contains
48+ * information.
49+ *
50+ * @return the number of parameters
51+ * @exception SQLException if a database access error occurs
52+ * @since 1.4
53+ */
54+ int getParameterCount() throws SQLException;
55+
56+ /**
57+ * Retrieves whether null values are allowed in the designated parameter.
58+ *
59+ * @param param the first parameter is 1, the second is 2, ...
60+ * @return the nullability status of the given parameter; one of
61+ * <code>ParameterMetaData.parameterNoNulls</code>,
62+ * <code>ParameterMetaData.parameterNullable</code>, or
63+ * <code>ParameterMetaData.parameterNullableUnknown</code>
64+ * @exception SQLException if a database access error occurs
65+ * @since 1.4
66+ */
67+ int isNullable(int param) throws SQLException;
68+
69+ /**
70+ * The constant indicating that a
71+ * parameter will not allow <code>NULL</code> values.
72+ */
73+ int parameterNoNulls = 0;
74+
75+ /**
76+ * The constant indicating that a
77+ * parameter will allow <code>NULL</code> values.
78+ */
79+ int parameterNullable = 1;
80+
81+ /**
82+ * The constant indicating that the
83+ * nullability of a parameter is unknown.
84+ */
85+ int parameterNullableUnknown = 2;
86+
87+ /**
88+ * Retrieves whether values for the designated parameter can be signed numbers.
89+ *
90+ * @param param the first parameter is 1, the second is 2, ...
91+ * @return <code>true</code> if so; <code>false</code> otherwise
92+ * @exception SQLException if a database access error occurs
93+ * @since 1.4
94+ */
95+ boolean isSigned(int param) throws SQLException;
96+
97+ /**
98+ * Retrieves the designated parameter's specified column size.
99+ *
100+ * <P>The returned value represents the maximum column size for the given parameter.
101+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
102+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
103+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
104+ * this is the length in bytes. 0 is returned for data types where the
105+ * column size is not applicable.
106+ *
107+ * @param param the first parameter is 1, the second is 2, ...
108+ * @return precision
109+ * @exception SQLException if a database access error occurs
110+ * @since 1.4
111+ */
112+ int getPrecision(int param) throws SQLException;
113+
114+ /**
115+ * Retrieves the designated parameter's number of digits to right of the decimal point.
116+ * 0 is returned for data types where the scale is not applicable.
117+ *
118+ * @param param the first parameter is 1, the second is 2, ...
119+ * @return scale
120+ * @exception SQLException if a database access error occurs
121+ * @since 1.4
122+ */
123+ int getScale(int param) throws SQLException;
124+
125+ /**
126+ * Retrieves the designated parameter's SQL type.
127+ *
128+ * @param param the first parameter is 1, the second is 2, ...
129+ * @return SQL type from <code>java.sql.Types</code>
130+ * @exception SQLException if a database access error occurs
131+ * @since 1.4
132+ * @see Types
133+ */
134+ int getParameterType(int param) throws SQLException;
135+
136+ /**
137+ * Retrieves the designated parameter's database-specific type name.
138+ *
139+ * @param param the first parameter is 1, the second is 2, ...
140+ * @return type the name used by the database. If the parameter type is
141+ * a user-defined type, then a fully-qualified type name is returned.
142+ * @exception SQLException if a database access error occurs
143+ * @since 1.4
144+ */
145+ String getParameterTypeName(int param) throws SQLException;
146+
147+
148+ /**
149+ * Retrieves the fully-qualified name of the Java class whose instances
150+ * should be passed to the method <code>PreparedStatement.setObject</code>.
151+ *
152+ * @param param the first parameter is 1, the second is 2, ...
153+ * @return the fully-qualified name of the class in the Java programming
154+ * language that would be used by the method
155+ * <code>PreparedStatement.setObject</code> to set the value
156+ * in the specified parameter. This is the class name used
157+ * for custom mapping.
158+ * @exception SQLException if a database access error occurs
159+ * @since 1.4
160+ */
161+ String getParameterClassName(int param) throws SQLException;
162+
163+ /**
164+ * The constant indicating that the mode of the parameter is unknown.
165+ */
166+ int parameterModeUnknown = 0;
167+
168+ /**
169+ * The constant indicating that the parameter's mode is IN.
170+ */
171+ int parameterModeIn = 1;
172+
173+ /**
174+ * The constant indicating that the parameter's mode is INOUT.
175+ */
176+ int parameterModeInOut = 2;
177+
178+ /**
179+ * The constant indicating that the parameter's mode is OUT.
180+ */
181+ int parameterModeOut = 4;
182+
183+ /**
184+ * Retrieves the designated parameter's mode.
185+ *
186+ * @param param the first parameter is 1, the second is 2, ...
187+ * @return mode of the parameter; one of
188+ * <code>ParameterMetaData.parameterModeIn</code>,
189+ * <code>ParameterMetaData.parameterModeOut</code>, or
190+ * <code>ParameterMetaData.parameterModeInOut</code>
191+ * <code>ParameterMetaData.parameterModeUnknown</code>.
192+ * @exception SQLException if a database access error occurs
193+ * @since 1.4
194+ */
195+ int getParameterMode(int param) throws SQLException;
196+}
java/pkg/java/sql/PreparedStatement.class+0−0

Binary file not shown.

java/pkg/java/sql/PreparedStatement.java+1223−0
@@ -0,0 +1,1223 @@
1+/*
2+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.math.BigDecimal;
29+import java.util.Calendar;
30+import java.io.Reader;
31+import java.io.InputStream;
32+
33+/**
34+ * An object that represents a precompiled SQL statement.
35+ * <P>A SQL statement is precompiled and stored in a
36+ * <code>PreparedStatement</code> object. This object can then be used to
37+ * efficiently execute this statement multiple times.
38+ *
39+ * <P><B>Note:</B> The setter methods (<code>setShort</code>, <code>setString</code>,
40+ * and so on) for setting IN parameter values
41+ * must specify types that are compatible with the defined SQL type of
42+ * the input parameter. For instance, if the IN parameter has SQL type
43+ * <code>INTEGER</code>, then the method <code>setInt</code> should be used.
44+ *
45+ * <p>If arbitrary parameter type conversions are required, the method
46+ * <code>setObject</code> should be used with a target SQL type.
47+ * <P>
48+ * In the following example of setting a parameter, <code>con</code> represents
49+ * an active connection:
50+ * <PRE>
51+ * PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES
52+ * SET SALARY = ? WHERE ID = ?");
53+ * pstmt.setBigDecimal(1, 153833.00)
54+ * pstmt.setInt(2, 110592)
55+ * </PRE>
56+ *
57+ * @see Connection#prepareStatement
58+ * @see ResultSet
59+ */
60+
61+public interface PreparedStatement extends Statement {
62+
63+ /**
64+ * Executes the SQL query in this <code>PreparedStatement</code> object
65+ * and returns the <code>ResultSet</code> object generated by the query.
66+ *
67+ * @return a <code>ResultSet</code> object that contains the data produced by the
68+ * query; never <code>null</code>
69+ * @exception SQLException if a database access error occurs;
70+ * this method is called on a closed <code>PreparedStatement</code> or the SQL
71+ * statement does not return a <code>ResultSet</code> object
72+ * @throws SQLTimeoutException when the driver has determined that the
73+ * timeout value that was specified by the {@code setQueryTimeout}
74+ * method has been exceeded and has at least attempted to cancel
75+ * the currently running {@code Statement}
76+ */
77+ ResultSet executeQuery() throws SQLException;
78+
79+ /**
80+ * Executes the SQL statement in this <code>PreparedStatement</code> object,
81+ * which must be an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
82+ * <code>DELETE</code>; or an SQL statement that returns nothing,
83+ * such as a DDL statement.
84+ *
85+ * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
86+ * or (2) 0 for SQL statements that return nothing
87+ * @exception SQLException if a database access error occurs;
88+ * this method is called on a closed <code>PreparedStatement</code>
89+ * or the SQL statement returns a <code>ResultSet</code> object
90+ * @throws SQLTimeoutException when the driver has determined that the
91+ * timeout value that was specified by the {@code setQueryTimeout}
92+ * method has been exceeded and has at least attempted to cancel
93+ * the currently running {@code Statement}
94+ */
95+ int executeUpdate() throws SQLException;
96+
97+ /**
98+ * Sets the designated parameter to SQL <code>NULL</code>.
99+ *
100+ * <P><B>Note:</B> You must specify the parameter's SQL type.
101+ *
102+ * @param parameterIndex the first parameter is 1, the second is 2, ...
103+ * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
104+ * @exception SQLException if parameterIndex does not correspond to a parameter
105+ * marker in the SQL statement; if a database access error occurs or
106+ * this method is called on a closed <code>PreparedStatement</code>
107+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
108+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
109+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
110+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
111+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
112+ * or <code>STRUCT</code> data type and the JDBC driver does not support
113+ * this data type
114+ */
115+ void setNull(int parameterIndex, int sqlType) throws SQLException;
116+
117+ /**
118+ * Sets the designated parameter to the given Java <code>boolean</code> value.
119+ * The driver converts this
120+ * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.
121+ *
122+ * @param parameterIndex the first parameter is 1, the second is 2, ...
123+ * @param x the parameter value
124+ * @exception SQLException if parameterIndex does not correspond to a parameter
125+ * marker in the SQL statement;
126+ * if a database access error occurs or
127+ * this method is called on a closed <code>PreparedStatement</code>
128+ */
129+ void setBoolean(int parameterIndex, boolean x) throws SQLException;
130+
131+ /**
132+ * Sets the designated parameter to the given Java <code>byte</code> value.
133+ * The driver converts this
134+ * to an SQL <code>TINYINT</code> value when it sends it to the database.
135+ *
136+ * @param parameterIndex the first parameter is 1, the second is 2, ...
137+ * @param x the parameter value
138+ * @exception SQLException if parameterIndex does not correspond to a parameter
139+ * marker in the SQL statement; if a database access error occurs or
140+ * this method is called on a closed <code>PreparedStatement</code>
141+ */
142+ void setByte(int parameterIndex, byte x) throws SQLException;
143+
144+ /**
145+ * Sets the designated parameter to the given Java <code>short</code> value.
146+ * The driver converts this
147+ * to an SQL <code>SMALLINT</code> value when it sends it to the database.
148+ *
149+ * @param parameterIndex the first parameter is 1, the second is 2, ...
150+ * @param x the parameter value
151+ * @exception SQLException if parameterIndex does not correspond to a parameter
152+ * marker in the SQL statement; if a database access error occurs or
153+ * this method is called on a closed <code>PreparedStatement</code>
154+ */
155+ void setShort(int parameterIndex, short x) throws SQLException;
156+
157+ /**
158+ * Sets the designated parameter to the given Java <code>int</code> value.
159+ * The driver converts this
160+ * to an SQL <code>INTEGER</code> value when it sends it to the database.
161+ *
162+ * @param parameterIndex the first parameter is 1, the second is 2, ...
163+ * @param x the parameter value
164+ * @exception SQLException if parameterIndex does not correspond to a parameter
165+ * marker in the SQL statement; if a database access error occurs or
166+ * this method is called on a closed <code>PreparedStatement</code>
167+ */
168+ void setInt(int parameterIndex, int x) throws SQLException;
169+
170+ /**
171+ * Sets the designated parameter to the given Java <code>long</code> value.
172+ * The driver converts this
173+ * to an SQL <code>BIGINT</code> value when it sends it to the database.
174+ *
175+ * @param parameterIndex the first parameter is 1, the second is 2, ...
176+ * @param x the parameter value
177+ * @exception SQLException if parameterIndex does not correspond to a parameter
178+ * marker in the SQL statement; if a database access error occurs or
179+ * this method is called on a closed <code>PreparedStatement</code>
180+ */
181+ void setLong(int parameterIndex, long x) throws SQLException;
182+
183+ /**
184+ * Sets the designated parameter to the given Java <code>float</code> value.
185+ * The driver converts this
186+ * to an SQL <code>REAL</code> value when it sends it to the database.
187+ *
188+ * @param parameterIndex the first parameter is 1, the second is 2, ...
189+ * @param x the parameter value
190+ * @exception SQLException if parameterIndex does not correspond to a parameter
191+ * marker in the SQL statement; if a database access error occurs or
192+ * this method is called on a closed <code>PreparedStatement</code>
193+ */
194+ void setFloat(int parameterIndex, float x) throws SQLException;
195+
196+ /**
197+ * Sets the designated parameter to the given Java <code>double</code> value.
198+ * The driver converts this
199+ * to an SQL <code>DOUBLE</code> value when it sends it to the database.
200+ *
201+ * @param parameterIndex the first parameter is 1, the second is 2, ...
202+ * @param x the parameter value
203+ * @exception SQLException if parameterIndex does not correspond to a parameter
204+ * marker in the SQL statement; if a database access error occurs or
205+ * this method is called on a closed <code>PreparedStatement</code>
206+ */
207+ void setDouble(int parameterIndex, double x) throws SQLException;
208+
209+ /**
210+ * Sets the designated parameter to the given <code>java.math.BigDecimal</code> value.
211+ * The driver converts this to an SQL <code>NUMERIC</code> value when
212+ * it sends it to the database.
213+ *
214+ * @param parameterIndex the first parameter is 1, the second is 2, ...
215+ * @param x the parameter value
216+ * @exception SQLException if parameterIndex does not correspond to a parameter
217+ * marker in the SQL statement; if a database access error occurs or
218+ * this method is called on a closed <code>PreparedStatement</code>
219+ */
220+ void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException;
221+
222+ /**
223+ * Sets the designated parameter to the given Java <code>String</code> value.
224+ * The driver converts this
225+ * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
226+ * (depending on the argument's
227+ * size relative to the driver's limits on <code>VARCHAR</code> values)
228+ * when it sends it to the database.
229+ *
230+ * @param parameterIndex the first parameter is 1, the second is 2, ...
231+ * @param x the parameter value
232+ * @exception SQLException if parameterIndex does not correspond to a parameter
233+ * marker in the SQL statement; if a database access error occurs or
234+ * this method is called on a closed <code>PreparedStatement</code>
235+ */
236+ void setString(int parameterIndex, String x) throws SQLException;
237+
238+ /**
239+ * Sets the designated parameter to the given Java array of bytes. The driver converts
240+ * this to an SQL <code>VARBINARY</code> or <code>LONGVARBINARY</code>
241+ * (depending on the argument's size relative to the driver's limits on
242+ * <code>VARBINARY</code> values) when it sends it to the database.
243+ *
244+ * @param parameterIndex the first parameter is 1, the second is 2, ...
245+ * @param x the parameter value
246+ * @exception SQLException if parameterIndex does not correspond to a parameter
247+ * marker in the SQL statement; if a database access error occurs or
248+ * this method is called on a closed <code>PreparedStatement</code>
249+ */
250+ void setBytes(int parameterIndex, byte x[]) throws SQLException;
251+
252+ /**
253+ * Sets the designated parameter to the given <code>java.sql.Date</code> value
254+ * using the default time zone of the virtual machine that is running
255+ * the application.
256+ * The driver converts this
257+ * to an SQL <code>DATE</code> value when it sends it to the database.
258+ *
259+ * @param parameterIndex the first parameter is 1, the second is 2, ...
260+ * @param x the parameter value
261+ * @exception SQLException if parameterIndex does not correspond to a parameter
262+ * marker in the SQL statement; if a database access error occurs or
263+ * this method is called on a closed <code>PreparedStatement</code>
264+ */
265+ void setDate(int parameterIndex, java.sql.Date x)
266+ throws SQLException;
267+
268+ /**
269+ * Sets the designated parameter to the given <code>java.sql.Time</code> value.
270+ * The driver converts this
271+ * to an SQL <code>TIME</code> value when it sends it to the database.
272+ *
273+ * @param parameterIndex the first parameter is 1, the second is 2, ...
274+ * @param x the parameter value
275+ * @exception SQLException if parameterIndex does not correspond to a parameter
276+ * marker in the SQL statement; if a database access error occurs or
277+ * this method is called on a closed <code>PreparedStatement</code>
278+ */
279+ void setTime(int parameterIndex, java.sql.Time x)
280+ throws SQLException;
281+
282+ /**
283+ * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
284+ * The driver
285+ * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
286+ * database.
287+ *
288+ * @param parameterIndex the first parameter is 1, the second is 2, ...
289+ * @param x the parameter value
290+ * @exception SQLException if parameterIndex does not correspond to a parameter
291+ * marker in the SQL statement; if a database access error occurs or
292+ * this method is called on a closed <code>PreparedStatement</code> */
293+ void setTimestamp(int parameterIndex, java.sql.Timestamp x)
294+ throws SQLException;
295+
296+ /**
297+ * Sets the designated parameter to the given input stream, which will have
298+ * the specified number of bytes.
299+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
300+ * parameter, it may be more practical to send it via a
301+ * <code>java.io.InputStream</code>. Data will be read from the stream
302+ * as needed until end-of-file is reached. The JDBC driver will
303+ * do any necessary conversion from ASCII to the database char format.
304+ *
305+ * <P><B>Note:</B> This stream object can either be a standard
306+ * Java stream object or your own subclass that implements the
307+ * standard interface.
308+ *
309+ * @param parameterIndex the first parameter is 1, the second is 2, ...
310+ * @param x the Java input stream that contains the ASCII parameter value
311+ * @param length the number of bytes in the stream
312+ * @exception SQLException if parameterIndex does not correspond to a parameter
313+ * marker in the SQL statement; if a database access error occurs or
314+ * this method is called on a closed <code>PreparedStatement</code>
315+ */
316+ void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
317+ throws SQLException;
318+
319+ /**
320+ * Sets the designated parameter to the given input stream, which
321+ * will have the specified number of bytes.
322+ *
323+ * When a very large Unicode value is input to a <code>LONGVARCHAR</code>
324+ * parameter, it may be more practical to send it via a
325+ * <code>java.io.InputStream</code> object. The data will be read from the
326+ * stream as needed until end-of-file is reached. The JDBC driver will
327+ * do any necessary conversion from Unicode to the database char format.
328+ *
329+ *The byte format of the Unicode stream must be a Java UTF-8, as defined in the
330+ *Java Virtual Machine Specification.
331+ *
332+ * <P><B>Note:</B> This stream object can either be a standard
333+ * Java stream object or your own subclass that implements the
334+ * standard interface.
335+ *
336+ * @param parameterIndex the first parameter is 1, the second is 2, ...
337+ * @param x a <code>java.io.InputStream</code> object that contains the
338+ * Unicode parameter value
339+ * @param length the number of bytes in the stream
340+ * @exception SQLException if parameterIndex does not correspond to a parameter
341+ * marker in the SQL statement; if a database access error occurs or
342+ * this method is called on a closed <code>PreparedStatement</code>
343+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
344+ * this method
345+ * @deprecated
346+ */
347+ void setUnicodeStream(int parameterIndex, java.io.InputStream x,
348+ int length) throws SQLException;
349+
350+ /**
351+ * Sets the designated parameter to the given input stream, which will have
352+ * the specified number of bytes.
353+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
354+ * parameter, it may be more practical to send it via a
355+ * <code>java.io.InputStream</code> object. The data will be read from the
356+ * stream as needed until end-of-file is reached.
357+ *
358+ * <P><B>Note:</B> This stream object can either be a standard
359+ * Java stream object or your own subclass that implements the
360+ * standard interface.
361+ *
362+ * @param parameterIndex the first parameter is 1, the second is 2, ...
363+ * @param x the java input stream which contains the binary parameter value
364+ * @param length the number of bytes in the stream
365+ * @exception SQLException if parameterIndex does not correspond to a parameter
366+ * marker in the SQL statement; if a database access error occurs or
367+ * this method is called on a closed <code>PreparedStatement</code>
368+ */
369+ void setBinaryStream(int parameterIndex, java.io.InputStream x,
370+ int length) throws SQLException;
371+
372+ /**
373+ * Clears the current parameter values immediately.
374+ * <P>In general, parameter values remain in force for repeated use of a
375+ * statement. Setting a parameter value automatically clears its
376+ * previous value. However, in some cases it is useful to immediately
377+ * release the resources used by the current parameter values; this can
378+ * be done by calling the method <code>clearParameters</code>.
379+ *
380+ * @exception SQLException if a database access error occurs or
381+ * this method is called on a closed <code>PreparedStatement</code>
382+ */
383+ void clearParameters() throws SQLException;
384+
385+ //----------------------------------------------------------------------
386+ // Advanced features:
387+
388+ /**
389+ * Sets the value of the designated parameter with the given object.
390+ * This method is like the method <code>setObject</code>
391+ * above, except that it assumes a scale of zero.
392+ *
393+ * @param parameterIndex the first parameter is 1, the second is 2, ...
394+ * @param x the object containing the input parameter value
395+ * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
396+ * sent to the database
397+ * @exception SQLException if parameterIndex does not correspond to a parameter
398+ * marker in the SQL statement; if a database access error occurs or
399+ * this method is called on a closed <code>PreparedStatement</code>
400+ * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
401+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
402+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
403+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
404+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
405+ * or <code>STRUCT</code> data type and the JDBC driver does not support
406+ * this data type
407+ * @see Types
408+ */
409+ void setObject(int parameterIndex, Object x, int targetSqlType)
410+ throws SQLException;
411+
412+ /**
413+ * <p>Sets the value of the designated parameter using the given object.
414+ * The second parameter must be of type <code>Object</code>; therefore, the
415+ * <code>java.lang</code> equivalent objects should be used for built-in types.
416+ *
417+ * <p>The JDBC specification specifies a standard mapping from
418+ * Java <code>Object</code> types to SQL types. The given argument
419+ * will be converted to the corresponding SQL type before being
420+ * sent to the database.
421+ *
422+ * <p>Note that this method may be used to pass datatabase-
423+ * specific abstract data types, by using a driver-specific Java
424+ * type.
425+ *
426+ * If the object is of a class implementing the interface <code>SQLData</code>,
427+ * the JDBC driver should call the method <code>SQLData.writeSQL</code>
428+ * to write it to the SQL data stream.
429+ * If, on the other hand, the object is of a class implementing
430+ * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
431+ * <code>Struct</code>, <code>java.net.URL</code>, <code>RowId</code>, <code>SQLXML</code>
432+ * or <code>Array</code>, the driver should pass it to the database as a
433+ * value of the corresponding SQL type.
434+ * <P>
435+ *<b>Note:</b> Not all databases allow for a non-typed Null to be sent to
436+ * the backend. For maximum portability, the <code>setNull</code> or the
437+ * <code>setObject(int parameterIndex, Object x, int sqlType)</code>
438+ * method should be used
439+ * instead of <code>setObject(int parameterIndex, Object x)</code>.
440+ *<p>
441+ * <b>Note:</b> This method throws an exception if there is an ambiguity, for example, if the
442+ * object is of a class implementing more than one of the interfaces named above.
443+ *
444+ * @param parameterIndex the first parameter is 1, the second is 2, ...
445+ * @param x the object containing the input parameter value
446+ * @exception SQLException if parameterIndex does not correspond to a parameter
447+ * marker in the SQL statement; if a database access error occurs;
448+ * this method is called on a closed <code>PreparedStatement</code>
449+ * or the type of the given object is ambiguous
450+ */
451+ void setObject(int parameterIndex, Object x) throws SQLException;
452+
453+ /**
454+ * Executes the SQL statement in this <code>PreparedStatement</code> object,
455+ * which may be any kind of SQL statement.
456+ * Some prepared statements return multiple results; the <code>execute</code>
457+ * method handles these complex statements as well as the simpler
458+ * form of statements handled by the methods <code>executeQuery</code>
459+ * and <code>executeUpdate</code>.
460+ * <P>
461+ * The <code>execute</code> method returns a <code>boolean</code> to
462+ * indicate the form of the first result. You must call either the method
463+ * <code>getResultSet</code> or <code>getUpdateCount</code>
464+ * to retrieve the result; you must call <code>getMoreResults</code> to
465+ * move to any subsequent result(s).
466+ *
467+ * @return <code>true</code> if the first result is a <code>ResultSet</code>
468+ * object; <code>false</code> if the first result is an update
469+ * count or there is no result
470+ * @exception SQLException if a database access error occurs;
471+ * this method is called on a closed <code>PreparedStatement</code>
472+ * or an argument is supplied to this method
473+ * @throws SQLTimeoutException when the driver has determined that the
474+ * timeout value that was specified by the {@code setQueryTimeout}
475+ * method has been exceeded and has at least attempted to cancel
476+ * the currently running {@code Statement}
477+ * @see Statement#execute
478+ * @see Statement#getResultSet
479+ * @see Statement#getUpdateCount
480+ * @see Statement#getMoreResults
481+
482+ */
483+ boolean execute() throws SQLException;
484+
485+ //--------------------------JDBC 2.0-----------------------------
486+
487+ /**
488+ * Adds a set of parameters to this <code>PreparedStatement</code>
489+ * object's batch of commands.
490+ *
491+ * @exception SQLException if a database access error occurs or
492+ * this method is called on a closed <code>PreparedStatement</code>
493+ * @see Statement#addBatch
494+ * @since 1.2
495+ */
496+ void addBatch() throws SQLException;
497+
498+ /**
499+ * Sets the designated parameter to the given <code>Reader</code>
500+ * object, which is the given number of characters long.
501+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
502+ * parameter, it may be more practical to send it via a
503+ * <code>java.io.Reader</code> object. The data will be read from the stream
504+ * as needed until end-of-file is reached. The JDBC driver will
505+ * do any necessary conversion from UNICODE to the database char format.
506+ *
507+ * <P><B>Note:</B> This stream object can either be a standard
508+ * Java stream object or your own subclass that implements the
509+ * standard interface.
510+ *
511+ * @param parameterIndex the first parameter is 1, the second is 2, ...
512+ * @param reader the <code>java.io.Reader</code> object that contains the
513+ * Unicode data
514+ * @param length the number of characters in the stream
515+ * @exception SQLException if parameterIndex does not correspond to a parameter
516+ * marker in the SQL statement; if a database access error occurs or
517+ * this method is called on a closed <code>PreparedStatement</code>
518+ * @since 1.2
519+ */
520+ void setCharacterStream(int parameterIndex,
521+ java.io.Reader reader,
522+ int length) throws SQLException;
523+
524+ /**
525+ * Sets the designated parameter to the given
526+ * <code>REF(&lt;structured-type&gt;)</code> value.
527+ * The driver converts this to an SQL <code>REF</code> value when it
528+ * sends it to the database.
529+ *
530+ * @param parameterIndex the first parameter is 1, the second is 2, ...
531+ * @param x an SQL <code>REF</code> value
532+ * @exception SQLException if parameterIndex does not correspond to a parameter
533+ * marker in the SQL statement; if a database access error occurs or
534+ * this method is called on a closed <code>PreparedStatement</code>
535+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
536+ * @since 1.2
537+ */
538+ void setRef (int parameterIndex, Ref x) throws SQLException;
539+
540+ /**
541+ * Sets the designated parameter to the given <code>java.sql.Blob</code> object.
542+ * The driver converts this to an SQL <code>BLOB</code> value when it
543+ * sends it to the database.
544+ *
545+ * @param parameterIndex the first parameter is 1, the second is 2, ...
546+ * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value
547+ * @exception SQLException if parameterIndex does not correspond to a parameter
548+ * marker in the SQL statement; if a database access error occurs or
549+ * this method is called on a closed <code>PreparedStatement</code>
550+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
551+ * @since 1.2
552+ */
553+ void setBlob (int parameterIndex, Blob x) throws SQLException;
554+
555+ /**
556+ * Sets the designated parameter to the given <code>java.sql.Clob</code> object.
557+ * The driver converts this to an SQL <code>CLOB</code> value when it
558+ * sends it to the database.
559+ *
560+ * @param parameterIndex the first parameter is 1, the second is 2, ...
561+ * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value
562+ * @exception SQLException if parameterIndex does not correspond to a parameter
563+ * marker in the SQL statement; if a database access error occurs or
564+ * this method is called on a closed <code>PreparedStatement</code>
565+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
566+ * @since 1.2
567+ */
568+ void setClob (int parameterIndex, Clob x) throws SQLException;
569+
570+ /**
571+ * Sets the designated parameter to the given <code>java.sql.Array</code> object.
572+ * The driver converts this to an SQL <code>ARRAY</code> value when it
573+ * sends it to the database.
574+ *
575+ * @param parameterIndex the first parameter is 1, the second is 2, ...
576+ * @param x an <code>Array</code> object that maps an SQL <code>ARRAY</code> value
577+ * @exception SQLException if parameterIndex does not correspond to a parameter
578+ * marker in the SQL statement; if a database access error occurs or
579+ * this method is called on a closed <code>PreparedStatement</code>
580+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
581+ * @since 1.2
582+ */
583+ void setArray (int parameterIndex, Array x) throws SQLException;
584+
585+ /**
586+ * Retrieves a <code>ResultSetMetaData</code> object that contains
587+ * information about the columns of the <code>ResultSet</code> object
588+ * that will be returned when this <code>PreparedStatement</code> object
589+ * is executed.
590+ * <P>
591+ * Because a <code>PreparedStatement</code> object is precompiled, it is
592+ * possible to know about the <code>ResultSet</code> object that it will
593+ * return without having to execute it. Consequently, it is possible
594+ * to invoke the method <code>getMetaData</code> on a
595+ * <code>PreparedStatement</code> object rather than waiting to execute
596+ * it and then invoking the <code>ResultSet.getMetaData</code> method
597+ * on the <code>ResultSet</code> object that is returned.
598+ * <P>
599+ * <B>NOTE:</B> Using this method may be expensive for some drivers due
600+ * to the lack of underlying DBMS support.
601+ *
602+ * @return the description of a <code>ResultSet</code> object's columns or
603+ * <code>null</code> if the driver cannot return a
604+ * <code>ResultSetMetaData</code> object
605+ * @exception SQLException if a database access error occurs or
606+ * this method is called on a closed <code>PreparedStatement</code>
607+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
608+ * this method
609+ * @since 1.2
610+ */
611+ ResultSetMetaData getMetaData() throws SQLException;
612+
613+ /**
614+ * Sets the designated parameter to the given <code>java.sql.Date</code> value,
615+ * using the given <code>Calendar</code> object. The driver uses
616+ * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
617+ * which the driver then sends to the database. With
618+ * a <code>Calendar</code> object, the driver can calculate the date
619+ * taking into account a custom timezone. If no
620+ * <code>Calendar</code> object is specified, the driver uses the default
621+ * timezone, which is that of the virtual machine running the application.
622+ *
623+ * @param parameterIndex the first parameter is 1, the second is 2, ...
624+ * @param x the parameter value
625+ * @param cal the <code>Calendar</code> object the driver will use
626+ * to construct the date
627+ * @exception SQLException if parameterIndex does not correspond to a parameter
628+ * marker in the SQL statement; if a database access error occurs or
629+ * this method is called on a closed <code>PreparedStatement</code>
630+ * @since 1.2
631+ */
632+ void setDate(int parameterIndex, java.sql.Date x, Calendar cal)
633+ throws SQLException;
634+
635+ /**
636+ * Sets the designated parameter to the given <code>java.sql.Time</code> value,
637+ * using the given <code>Calendar</code> object. The driver uses
638+ * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
639+ * which the driver then sends to the database. With
640+ * a <code>Calendar</code> object, the driver can calculate the time
641+ * taking into account a custom timezone. If no
642+ * <code>Calendar</code> object is specified, the driver uses the default
643+ * timezone, which is that of the virtual machine running the application.
644+ *
645+ * @param parameterIndex the first parameter is 1, the second is 2, ...
646+ * @param x the parameter value
647+ * @param cal the <code>Calendar</code> object the driver will use
648+ * to construct the time
649+ * @exception SQLException if parameterIndex does not correspond to a parameter
650+ * marker in the SQL statement; if a database access error occurs or
651+ * this method is called on a closed <code>PreparedStatement</code>
652+ * @since 1.2
653+ */
654+ void setTime(int parameterIndex, java.sql.Time x, Calendar cal)
655+ throws SQLException;
656+
657+ /**
658+ * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
659+ * using the given <code>Calendar</code> object. The driver uses
660+ * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
661+ * which the driver then sends to the database. With a
662+ * <code>Calendar</code> object, the driver can calculate the timestamp
663+ * taking into account a custom timezone. If no
664+ * <code>Calendar</code> object is specified, the driver uses the default
665+ * timezone, which is that of the virtual machine running the application.
666+ *
667+ * @param parameterIndex the first parameter is 1, the second is 2, ...
668+ * @param x the parameter value
669+ * @param cal the <code>Calendar</code> object the driver will use
670+ * to construct the timestamp
671+ * @exception SQLException if parameterIndex does not correspond to a parameter
672+ * marker in the SQL statement; if a database access error occurs or
673+ * this method is called on a closed <code>PreparedStatement</code>
674+ * @since 1.2
675+ */
676+ void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal)
677+ throws SQLException;
678+
679+ /**
680+ * Sets the designated parameter to SQL <code>NULL</code>.
681+ * This version of the method <code>setNull</code> should
682+ * be used for user-defined types and REF type parameters. Examples
683+ * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
684+ * named array types.
685+ *
686+ * <P><B>Note:</B> To be portable, applications must give the
687+ * SQL type code and the fully-qualified SQL type name when specifying
688+ * a NULL user-defined or REF parameter. In the case of a user-defined type
689+ * the name is the type name of the parameter itself. For a REF
690+ * parameter, the name is the type name of the referenced type. If
691+ * a JDBC driver does not need the type code or type name information,
692+ * it may ignore it.
693+ *
694+ * Although it is intended for user-defined and Ref parameters,
695+ * this method may be used to set a null parameter of any JDBC type.
696+ * If the parameter does not have a user-defined or REF type, the given
697+ * typeName is ignored.
698+ *
699+ *
700+ * @param parameterIndex the first parameter is 1, the second is 2, ...
701+ * @param sqlType a value from <code>java.sql.Types</code>
702+ * @param typeName the fully-qualified name of an SQL user-defined type;
703+ * ignored if the parameter is not a user-defined type or REF
704+ * @exception SQLException if parameterIndex does not correspond to a parameter
705+ * marker in the SQL statement; if a database access error occurs or
706+ * this method is called on a closed <code>PreparedStatement</code>
707+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
708+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
709+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
710+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
711+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
712+ * or <code>STRUCT</code> data type and the JDBC driver does not support
713+ * this data type or if the JDBC driver does not support this method
714+ * @since 1.2
715+ */
716+ void setNull (int parameterIndex, int sqlType, String typeName)
717+ throws SQLException;
718+
719+ //------------------------- JDBC 3.0 -----------------------------------
720+
721+ /**
722+ * Sets the designated parameter to the given <code>java.net.URL</code> value.
723+ * The driver converts this to an SQL <code>DATALINK</code> value
724+ * when it sends it to the database.
725+ *
726+ * @param parameterIndex the first parameter is 1, the second is 2, ...
727+ * @param x the <code>java.net.URL</code> object to be set
728+ * @exception SQLException if parameterIndex does not correspond to a parameter
729+ * marker in the SQL statement; if a database access error occurs or
730+ * this method is called on a closed <code>PreparedStatement</code>
731+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
732+ * @since 1.4
733+ */
734+ void setURL(int parameterIndex, java.net.URL x) throws SQLException;
735+
736+ /**
737+ * Retrieves the number, types and properties of this
738+ * <code>PreparedStatement</code> object's parameters.
739+ *
740+ * @return a <code>ParameterMetaData</code> object that contains information
741+ * about the number, types and properties for each
742+ * parameter marker of this <code>PreparedStatement</code> object
743+ * @exception SQLException if a database access error occurs or
744+ * this method is called on a closed <code>PreparedStatement</code>
745+ * @see ParameterMetaData
746+ * @since 1.4
747+ */
748+ ParameterMetaData getParameterMetaData() throws SQLException;
749+
750+ //------------------------- JDBC 4.0 -----------------------------------
751+
752+ /**
753+ * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
754+ * driver converts this to a SQL <code>ROWID</code> value when it sends it
755+ * to the database
756+ *
757+ * @param parameterIndex the first parameter is 1, the second is 2, ...
758+ * @param x the parameter value
759+ * @throws SQLException if parameterIndex does not correspond to a parameter
760+ * marker in the SQL statement; if a database access error occurs or
761+ * this method is called on a closed <code>PreparedStatement</code>
762+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
763+ *
764+ * @since 1.6
765+ */
766+ void setRowId(int parameterIndex, RowId x) throws SQLException;
767+
768+
769+ /**
770+ * Sets the designated paramter to the given <code>String</code> object.
771+ * The driver converts this to a SQL <code>NCHAR</code> or
772+ * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
773+ * (depending on the argument's
774+ * size relative to the driver's limits on <code>NVARCHAR</code> values)
775+ * when it sends it to the database.
776+ *
777+ * @param parameterIndex of the first parameter is 1, the second is 2, ...
778+ * @param value the parameter value
779+ * @throws SQLException if parameterIndex does not correspond to a parameter
780+ * marker in the SQL statement; if the driver does not support national
781+ * character sets; if the driver can detect that a data conversion
782+ * error could occur; if a database access error occurs; or
783+ * this method is called on a closed <code>PreparedStatement</code>
784+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
785+ * @since 1.6
786+ */
787+ void setNString(int parameterIndex, String value) throws SQLException;
788+
789+ /**
790+ * Sets the designated parameter to a <code>Reader</code> object. The
791+ * <code>Reader</code> reads the data till end-of-file is reached. The
792+ * driver does the necessary conversion from Java character format to
793+ * the national character set in the database.
794+ * @param parameterIndex of the first parameter is 1, the second is 2, ...
795+ * @param value the parameter value
796+ * @param length the number of characters in the parameter data.
797+ * @throws SQLException if parameterIndex does not correspond to a parameter
798+ * marker in the SQL statement; if the driver does not support national
799+ * character sets; if the driver can detect that a data conversion
800+ * error could occur; if a database access error occurs; or
801+ * this method is called on a closed <code>PreparedStatement</code>
802+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
803+ * @since 1.6
804+ */
805+ void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException;
806+
807+ /**
808+ * Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this to a
809+ * SQL <code>NCLOB</code> value when it sends it to the database.
810+ * @param parameterIndex of the first parameter is 1, the second is 2, ...
811+ * @param value the parameter value
812+ * @throws SQLException if parameterIndex does not correspond to a parameter
813+ * marker in the SQL statement; if the driver does not support national
814+ * character sets; if the driver can detect that a data conversion
815+ * error could occur; if a database access error occurs; or
816+ * this method is called on a closed <code>PreparedStatement</code>
817+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
818+ * @since 1.6
819+ */
820+ void setNClob(int parameterIndex, NClob value) throws SQLException;
821+
822+ /**
823+ * Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number
824+ * of characters specified by length otherwise a <code>SQLException</code> will be
825+ * generated when the <code>PreparedStatement</code> is executed.
826+ *This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
827+ * because it informs the driver that the parameter value should be sent to
828+ * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
829+ * driver may have to do extra work to determine whether the parameter
830+ * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
831+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
832+ * @param reader An object that contains the data to set the parameter value to.
833+ * @param length the number of characters in the parameter data.
834+ * @throws SQLException if parameterIndex does not correspond to a parameter
835+ * marker in the SQL statement; if a database access error occurs; this method is called on
836+ * a closed <code>PreparedStatement</code> or if the length specified is less than zero.
837+ *
838+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
839+ * @since 1.6
840+ */
841+ void setClob(int parameterIndex, Reader reader, long length)
842+ throws SQLException;
843+
844+ /**
845+ * Sets the designated parameter to a <code>InputStream</code> object. The inputstream must contain the number
846+ * of characters specified by length otherwise a <code>SQLException</code> will be
847+ * generated when the <code>PreparedStatement</code> is executed.
848+ * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
849+ * method because it informs the driver that the parameter value should be
850+ * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
851+ * the driver may have to do extra work to determine whether the parameter
852+ * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
853+ * @param parameterIndex index of the first parameter is 1,
854+ * the second is 2, ...
855+ * @param inputStream An object that contains the data to set the parameter
856+ * value to.
857+ * @param length the number of bytes in the parameter data.
858+ * @throws SQLException if parameterIndex does not correspond to a parameter
859+ * marker in the SQL statement; if a database access error occurs;
860+ * this method is called on a closed <code>PreparedStatement</code>;
861+ * if the length specified
862+ * is less than zero or if the number of bytes in the inputstream does not match
863+ * the specfied length.
864+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
865+ *
866+ * @since 1.6
867+ */
868+ void setBlob(int parameterIndex, InputStream inputStream, long length)
869+ throws SQLException;
870+ /**
871+ * Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number
872+ * of characters specified by length otherwise a <code>SQLException</code> will be
873+ * generated when the <code>PreparedStatement</code> is executed.
874+ * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
875+ * because it informs the driver that the parameter value should be sent to
876+ * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
877+ * driver may have to do extra work to determine whether the parameter
878+ * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
879+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
880+ * @param reader An object that contains the data to set the parameter value to.
881+ * @param length the number of characters in the parameter data.
882+ * @throws SQLException if parameterIndex does not correspond to a parameter
883+ * marker in the SQL statement; if the length specified is less than zero;
884+ * if the driver does not support national character sets;
885+ * if the driver can detect that a data conversion
886+ * error could occur; if a database access error occurs or
887+ * this method is called on a closed <code>PreparedStatement</code>
888+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
889+ *
890+ * @since 1.6
891+ */
892+ void setNClob(int parameterIndex, Reader reader, long length)
893+ throws SQLException;
894+
895+ /**
896+ * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object.
897+ * The driver converts this to an
898+ * SQL <code>XML</code> value when it sends it to the database.
899+ * <p>
900+ *
901+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
902+ * @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value
903+ * @throws SQLException if parameterIndex does not correspond to a parameter
904+ * marker in the SQL statement; if a database access error occurs;
905+ * this method is called on a closed <code>PreparedStatement</code>
906+ * or the <code>java.xml.transform.Result</code>,
907+ * <code>Writer</code> or <code>OutputStream</code> has not been closed for
908+ * the <code>SQLXML</code> object
909+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
910+ *
911+ * @since 1.6
912+ */
913+ void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException;
914+
915+ /**
916+ * <p>Sets the value of the designated parameter with the given object. The second
917+ * argument must be an object type; for integral values, the
918+ * <code>java.lang</code> equivalent objects should be used.
919+ *
920+ * If the second argument is an <code>InputStream</code> then the stream must contain
921+ * the number of bytes specified by scaleOrLength. If the second argument is a
922+ * <code>Reader</code> then the reader must contain the number of characters specified
923+ * by scaleOrLength. If these conditions are not true the driver will generate a
924+ * <code>SQLException</code> when the prepared statement is executed.
925+ *
926+ * <p>The given Java object will be converted to the given targetSqlType
927+ * before being sent to the database.
928+ *
929+ * If the object has a custom mapping (is of a class implementing the
930+ * interface <code>SQLData</code>),
931+ * the JDBC driver should call the method <code>SQLData.writeSQL</code> to
932+ * write it to the SQL data stream.
933+ * If, on the other hand, the object is of a class implementing
934+ * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
935+ * <code>Struct</code>, <code>java.net.URL</code>,
936+ * or <code>Array</code>, the driver should pass it to the database as a
937+ * value of the corresponding SQL type.
938+ *
939+ * <p>Note that this method may be used to pass database-specific
940+ * abstract data types.
941+ *
942+ * @param parameterIndex the first parameter is 1, the second is 2, ...
943+ * @param x the object containing the input parameter value
944+ * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
945+ * sent to the database. The scale argument may further qualify this type.
946+ * @param scaleOrLength for <code>java.sql.Types.DECIMAL</code>
947+ * or <code>java.sql.Types.NUMERIC types</code>,
948+ * this is the number of digits after the decimal point. For
949+ * Java Object types <code>InputStream</code> and <code>Reader</code>,
950+ * this is the length
951+ * of the data in the stream or reader. For all other types,
952+ * this value will be ignored.
953+ * @exception SQLException if parameterIndex does not correspond to a parameter
954+ * marker in the SQL statement; if a database access error occurs;
955+ * this method is called on a closed <code>PreparedStatement</code> or
956+ * if the Java Object specified by x is an InputStream
957+ * or Reader object and the value of the scale parameter is less
958+ * than zero
959+ * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
960+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
961+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
962+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
963+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
964+ * or <code>STRUCT</code> data type and the JDBC driver does not support
965+ * this data type
966+ * @see Types
967+ *
968+ * @since 1.6
969+ */
970+ void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
971+ throws SQLException;
972+ /**
973+ * Sets the designated parameter to the given input stream, which will have
974+ * the specified number of bytes.
975+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
976+ * parameter, it may be more practical to send it via a
977+ * <code>java.io.InputStream</code>. Data will be read from the stream
978+ * as needed until end-of-file is reached. The JDBC driver will
979+ * do any necessary conversion from ASCII to the database char format.
980+ *
981+ * <P><B>Note:</B> This stream object can either be a standard
982+ * Java stream object or your own subclass that implements the
983+ * standard interface.
984+ *
985+ * @param parameterIndex the first parameter is 1, the second is 2, ...
986+ * @param x the Java input stream that contains the ASCII parameter value
987+ * @param length the number of bytes in the stream
988+ * @exception SQLException if parameterIndex does not correspond to a parameter
989+ * marker in the SQL statement; if a database access error occurs or
990+ * this method is called on a closed <code>PreparedStatement</code>
991+ * @since 1.6
992+ */
993+ void setAsciiStream(int parameterIndex, java.io.InputStream x, long length)
994+ throws SQLException;
995+ /**
996+ * Sets the designated parameter to the given input stream, which will have
997+ * the specified number of bytes.
998+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
999+ * parameter, it may be more practical to send it via a
1000+ * <code>java.io.InputStream</code> object. The data will be read from the
1001+ * stream as needed until end-of-file is reached.
1002+ *
1003+ * <P><B>Note:</B> This stream object can either be a standard
1004+ * Java stream object or your own subclass that implements the
1005+ * standard interface.
1006+ *
1007+ * @param parameterIndex the first parameter is 1, the second is 2, ...
1008+ * @param x the java input stream which contains the binary parameter value
1009+ * @param length the number of bytes in the stream
1010+ * @exception SQLException if parameterIndex does not correspond to a parameter
1011+ * marker in the SQL statement; if a database access error occurs or
1012+ * this method is called on a closed <code>PreparedStatement</code>
1013+ * @since 1.6
1014+ */
1015+ void setBinaryStream(int parameterIndex, java.io.InputStream x,
1016+ long length) throws SQLException;
1017+ /**
1018+ * Sets the designated parameter to the given <code>Reader</code>
1019+ * object, which is the given number of characters long.
1020+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
1021+ * parameter, it may be more practical to send it via a
1022+ * <code>java.io.Reader</code> object. The data will be read from the stream
1023+ * as needed until end-of-file is reached. The JDBC driver will
1024+ * do any necessary conversion from UNICODE to the database char format.
1025+ *
1026+ * <P><B>Note:</B> This stream object can either be a standard
1027+ * Java stream object or your own subclass that implements the
1028+ * standard interface.
1029+ *
1030+ * @param parameterIndex the first parameter is 1, the second is 2, ...
1031+ * @param reader the <code>java.io.Reader</code> object that contains the
1032+ * Unicode data
1033+ * @param length the number of characters in the stream
1034+ * @exception SQLException if parameterIndex does not correspond to a parameter
1035+ * marker in the SQL statement; if a database access error occurs or
1036+ * this method is called on a closed <code>PreparedStatement</code>
1037+ * @since 1.6
1038+ */
1039+ void setCharacterStream(int parameterIndex,
1040+ java.io.Reader reader,
1041+ long length) throws SQLException;
1042+ //-----
1043+ /**
1044+ * Sets the designated parameter to the given input stream.
1045+ * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
1046+ * parameter, it may be more practical to send it via a
1047+ * <code>java.io.InputStream</code>. Data will be read from the stream
1048+ * as needed until end-of-file is reached. The JDBC driver will
1049+ * do any necessary conversion from ASCII to the database char format.
1050+ *
1051+ * <P><B>Note:</B> This stream object can either be a standard
1052+ * Java stream object or your own subclass that implements the
1053+ * standard interface.
1054+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1055+ * it might be more efficient to use a version of
1056+ * <code>setAsciiStream</code> which takes a length parameter.
1057+ *
1058+ * @param parameterIndex the first parameter is 1, the second is 2, ...
1059+ * @param x the Java input stream that contains the ASCII parameter value
1060+ * @exception SQLException if parameterIndex does not correspond to a parameter
1061+ * marker in the SQL statement; if a database access error occurs or
1062+ * this method is called on a closed <code>PreparedStatement</code>
1063+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1064+ * @since 1.6
1065+ */
1066+ void setAsciiStream(int parameterIndex, java.io.InputStream x)
1067+ throws SQLException;
1068+ /**
1069+ * Sets the designated parameter to the given input stream.
1070+ * When a very large binary value is input to a <code>LONGVARBINARY</code>
1071+ * parameter, it may be more practical to send it via a
1072+ * <code>java.io.InputStream</code> object. The data will be read from the
1073+ * stream as needed until end-of-file is reached.
1074+ *
1075+ * <P><B>Note:</B> This stream object can either be a standard
1076+ * Java stream object or your own subclass that implements the
1077+ * standard interface.
1078+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1079+ * it might be more efficient to use a version of
1080+ * <code>setBinaryStream</code> which takes a length parameter.
1081+ *
1082+ * @param parameterIndex the first parameter is 1, the second is 2, ...
1083+ * @param x the java input stream which contains the binary parameter value
1084+ * @exception SQLException if parameterIndex does not correspond to a parameter
1085+ * marker in the SQL statement; if a database access error occurs or
1086+ * this method is called on a closed <code>PreparedStatement</code>
1087+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1088+ * @since 1.6
1089+ */
1090+ void setBinaryStream(int parameterIndex, java.io.InputStream x)
1091+ throws SQLException;
1092+ /**
1093+ * Sets the designated parameter to the given <code>Reader</code>
1094+ * object.
1095+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
1096+ * parameter, it may be more practical to send it via a
1097+ * <code>java.io.Reader</code> object. The data will be read from the stream
1098+ * as needed until end-of-file is reached. The JDBC driver will
1099+ * do any necessary conversion from UNICODE to the database char format.
1100+ *
1101+ * <P><B>Note:</B> This stream object can either be a standard
1102+ * Java stream object or your own subclass that implements the
1103+ * standard interface.
1104+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1105+ * it might be more efficient to use a version of
1106+ * <code>setCharacterStream</code> which takes a length parameter.
1107+ *
1108+ * @param parameterIndex the first parameter is 1, the second is 2, ...
1109+ * @param reader the <code>java.io.Reader</code> object that contains the
1110+ * Unicode data
1111+ * @exception SQLException if parameterIndex does not correspond to a parameter
1112+ * marker in the SQL statement; if a database access error occurs or
1113+ * this method is called on a closed <code>PreparedStatement</code>
1114+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1115+ * @since 1.6
1116+ */
1117+ void setCharacterStream(int parameterIndex,
1118+ java.io.Reader reader) throws SQLException;
1119+ /**
1120+ * Sets the designated parameter to a <code>Reader</code> object. The
1121+ * <code>Reader</code> reads the data till end-of-file is reached. The
1122+ * driver does the necessary conversion from Java character format to
1123+ * the national character set in the database.
1124+
1125+ * <P><B>Note:</B> This stream object can either be a standard
1126+ * Java stream object or your own subclass that implements the
1127+ * standard interface.
1128+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1129+ * it might be more efficient to use a version of
1130+ * <code>setNCharacterStream</code> which takes a length parameter.
1131+ *
1132+ * @param parameterIndex of the first parameter is 1, the second is 2, ...
1133+ * @param value the parameter value
1134+ * @throws SQLException if parameterIndex does not correspond to a parameter
1135+ * marker in the SQL statement; if the driver does not support national
1136+ * character sets; if the driver can detect that a data conversion
1137+ * error could occur; if a database access error occurs; or
1138+ * this method is called on a closed <code>PreparedStatement</code>
1139+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1140+ * @since 1.6
1141+ */
1142+ void setNCharacterStream(int parameterIndex, Reader value) throws SQLException;
1143+
1144+ /**
1145+ * Sets the designated parameter to a <code>Reader</code> object.
1146+ * This method differs from the <code>setCharacterStream (int, Reader)</code> method
1147+ * because it informs the driver that the parameter value should be sent to
1148+ * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
1149+ * driver may have to do extra work to determine whether the parameter
1150+ * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
1151+ *
1152+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1153+ * it might be more efficient to use a version of
1154+ * <code>setClob</code> which takes a length parameter.
1155+ *
1156+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
1157+ * @param reader An object that contains the data to set the parameter value to.
1158+ * @throws SQLException if parameterIndex does not correspond to a parameter
1159+ * marker in the SQL statement; if a database access error occurs; this method is called on
1160+ * a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter
1161+ * marker in the SQL statement
1162+ *
1163+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1164+ * @since 1.6
1165+ */
1166+ void setClob(int parameterIndex, Reader reader)
1167+ throws SQLException;
1168+
1169+ /**
1170+ * Sets the designated parameter to a <code>InputStream</code> object.
1171+ * This method differs from the <code>setBinaryStream (int, InputStream)</code>
1172+ * method because it informs the driver that the parameter value should be
1173+ * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
1174+ * the driver may have to do extra work to determine whether the parameter
1175+ * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
1176+ *
1177+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1178+ * it might be more efficient to use a version of
1179+ * <code>setBlob</code> which takes a length parameter.
1180+ *
1181+ * @param parameterIndex index of the first parameter is 1,
1182+ * the second is 2, ...
1183+ * @param inputStream An object that contains the data to set the parameter
1184+ * value to.
1185+ * @throws SQLException if parameterIndex does not correspond to a parameter
1186+ * marker in the SQL statement; if a database access error occurs;
1187+ * this method is called on a closed <code>PreparedStatement</code> or
1188+ * if parameterIndex does not correspond
1189+ * to a parameter marker in the SQL statement,
1190+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1191+ *
1192+ * @since 1.6
1193+ */
1194+ void setBlob(int parameterIndex, InputStream inputStream)
1195+ throws SQLException;
1196+ /**
1197+ * Sets the designated parameter to a <code>Reader</code> object.
1198+ * This method differs from the <code>setCharacterStream (int, Reader)</code> method
1199+ * because it informs the driver that the parameter value should be sent to
1200+ * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
1201+ * driver may have to do extra work to determine whether the parameter
1202+ * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
1203+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
1204+ * it might be more efficient to use a version of
1205+ * <code>setNClob</code> which takes a length parameter.
1206+ *
1207+ * @param parameterIndex index of the first parameter is 1, the second is 2, ...
1208+ * @param reader An object that contains the data to set the parameter value to.
1209+ * @throws SQLException if parameterIndex does not correspond to a parameter
1210+ * marker in the SQL statement;
1211+ * if the driver does not support national character sets;
1212+ * if the driver can detect that a data conversion
1213+ * error could occur; if a database access error occurs or
1214+ * this method is called on a closed <code>PreparedStatement</code>
1215+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
1216+ *
1217+ * @since 1.6
1218+ */
1219+ void setNClob(int parameterIndex, Reader reader)
1220+ throws SQLException;
1221+
1222+
1223+}
java/pkg/java/sql/PseudoColumnUsage.class+0−0

Binary file not shown.

java/pkg/java/sql/PseudoColumnUsage.java+57−0
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+
29+/**
30+ * Enumeration for pseudo/hidden column usage.
31+ *
32+ * @since 1.7
33+ * @see DatabaseMetaData#getPseudoColumns
34+ */
35+public enum PseudoColumnUsage {
36+
37+ /**
38+ * The pseudo/hidden column may only be used in a SELECT list.
39+ */
40+ SELECT_LIST_ONLY,
41+
42+ /**
43+ * The pseudo/hidden column may only be used in a WHERE clause.
44+ */
45+ WHERE_CLAUSE_ONLY,
46+
47+ /**
48+ * There are no restrictions on the usage of the pseudo/hidden columns.
49+ */
50+ NO_USAGE_RESTRICTIONS,
51+
52+ /**
53+ * The usage of the pseudo/hidden column cannot be determined.
54+ */
55+ USAGE_UNKNOWN
56+
57+}
java/pkg/java/sql/Ref.class+0−0

Binary file not shown.

java/pkg/java/sql/Ref.java+127−0
@@ -0,0 +1,127 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The mapping in the Java programming language of an SQL <code>REF</code>
30+ * value, which is a reference to an SQL structured type value in the database.
31+ * <P>
32+ * SQL <code>REF</code> values are stored in a table that contains
33+ * instances of a referenceable SQL structured type, and each <code>REF</code>
34+ * value is a unique identifier for one instance in that table.
35+ * An SQL <code>REF</code> value may be used in place of the
36+ * SQL structured type it references, either as a column value in a
37+ * table or an attribute value in a structured type.
38+ * <P>
39+ * Because an SQL <code>REF</code> value is a logical pointer to an
40+ * SQL structured type, a <code>Ref</code> object is by default also a logical
41+ * pointer. Thus, retrieving an SQL <code>REF</code> value as
42+ * a <code>Ref</code> object does not materialize
43+ * the attributes of the structured type on the client.
44+ * <P>
45+ * A <code>Ref</code> object can be stored in the database using the
46+ * <code>PreparedStatement.setRef</code> method.
47+ * <p>
48+ * All methods on the <code>Ref</code> interface must be fully implemented if the
49+ * JDBC driver supports the data type.
50+ *
51+ * @see Struct
52+ * @since 1.2
53+ */
54+public interface Ref {
55+
56+ /**
57+ * Retrieves the fully-qualified SQL name of the SQL structured type that
58+ * this <code>Ref</code> object references.
59+ *
60+ * @return the fully-qualified SQL name of the referenced SQL structured type
61+ * @exception SQLException if a database access error occurs
62+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
63+ * this method
64+ * @since 1.2
65+ */
66+ String getBaseTypeName() throws SQLException;
67+
68+ /**
69+ * Retrieves the referenced object and maps it to a Java type
70+ * using the given type map.
71+ *
72+ * @param map a <code>java.util.Map</code> object that contains
73+ * the mapping to use (the fully-qualified name of the SQL
74+ * structured type being referenced and the class object for
75+ * <code>SQLData</code> implementation to which the SQL
76+ * structured type will be mapped)
77+ * @return a Java <code>Object</code> that is the custom mapping for
78+ * the SQL structured type to which this <code>Ref</code>
79+ * object refers
80+ * @exception SQLException if a database access error occurs
81+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
82+ * this method
83+ * @since 1.4
84+ * @see #setObject
85+ */
86+ Object getObject(java.util.Map<String,Class<?>> map) throws SQLException;
87+
88+
89+ /**
90+ * Retrieves the SQL structured type instance referenced by
91+ * this <code>Ref</code> object. If the connection's type map has an entry
92+ * for the structured type, the instance will be custom mapped to
93+ * the Java class indicated in the type map. Otherwise, the
94+ * structured type instance will be mapped to a <code>Struct</code> object.
95+ *
96+ * @return a Java <code>Object</code> that is the mapping for
97+ * the SQL structured type to which this <code>Ref</code>
98+ * object refers
99+ * @exception SQLException if a database access error occurs
100+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
101+ * this method
102+ * @since 1.4
103+ * @see #setObject
104+ */
105+ Object getObject() throws SQLException;
106+
107+ /**
108+ * Sets the structured type value that this <code>Ref</code>
109+ * object references to the given instance of <code>Object</code>.
110+ * The driver converts this to an SQL structured type when it
111+ * sends it to the database.
112+ *
113+ * @param value an <code>Object</code> representing the SQL
114+ * structured type instance that this
115+ * <code>Ref</code> object will reference
116+ * @exception SQLException if a database access error occurs
117+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
118+ * this method
119+ * @since 1.4
120+ * @see #getObject()
121+ * @see #getObject(Map)
122+ * @see PreparedStatement#setObject(int, Object)
123+ * @see CallableStatement#setObject(String, Object)
124+ */
125+ void setObject(Object value) throws SQLException;
126+
127+}
java/pkg/java/sql/ResultSet.class+0−0

Binary file not shown.

java/pkg/java/sql/ResultSet.java+4139−0
@@ -0,0 +1,4139 @@
1+/*
2+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.math.BigDecimal;
29+import java.util.Calendar;
30+import java.io.Reader;
31+import java.io.InputStream;
32+
33+/**
34+ * A table of data representing a database result set, which
35+ * is usually generated by executing a statement that queries the database.
36+ *
37+ * <P>A <code>ResultSet</code> object maintains a cursor pointing
38+ * to its current row of data. Initially the cursor is positioned
39+ * before the first row. The <code>next</code> method moves the
40+ * cursor to the next row, and because it returns <code>false</code>
41+ * when there are no more rows in the <code>ResultSet</code> object,
42+ * it can be used in a <code>while</code> loop to iterate through
43+ * the result set.
44+ * <P>
45+ * A default <code>ResultSet</code> object is not updatable and
46+ * has a cursor that moves forward only. Thus, you can
47+ * iterate through it only once and only from the first row to the
48+ * last row. It is possible to
49+ * produce <code>ResultSet</code> objects that are scrollable and/or
50+ * updatable. The following code fragment, in which <code>con</code>
51+ * is a valid <code>Connection</code> object, illustrates how to make
52+ * a result set that is scrollable and insensitive to updates by others, and
53+ * that is updatable. See <code>ResultSet</code> fields for other
54+ * options.
55+ * <PRE>
56+ *
57+ * Statement stmt = con.createStatement(
58+ * ResultSet.TYPE_SCROLL_INSENSITIVE,
59+ * ResultSet.CONCUR_UPDATABLE);
60+ * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
61+ * // rs will be scrollable, will not show changes made by others,
62+ * // and will be updatable
63+ *
64+ * </PRE>
65+ * The <code>ResultSet</code> interface provides
66+ * <i>getter</i> methods (<code>getBoolean</code>, <code>getLong</code>, and so on)
67+ * for retrieving column values from the current row.
68+ * Values can be retrieved using either the index number of the
69+ * column or the name of the column. In general, using the
70+ * column index will be more efficient. Columns are numbered from 1.
71+ * For maximum portability, result set columns within each row should be
72+ * read in left-to-right order, and each column should be read only once.
73+ *
74+ * <P>For the getter methods, a JDBC driver attempts
75+ * to convert the underlying data to the Java type specified in the
76+ * getter method and returns a suitable Java value. The JDBC specification
77+ * has a table showing the allowable mappings from SQL types to Java types
78+ * that can be used by the <code>ResultSet</code> getter methods.
79+ * <P>
80+ * <P>Column names used as input to getter methods are case
81+ * insensitive. When a getter method is called with
82+ * a column name and several columns have the same name,
83+ * the value of the first matching column will be returned.
84+ * The column name option is
85+ * designed to be used when column names are used in the SQL
86+ * query that generated the result set.
87+ * For columns that are NOT explicitly named in the query, it
88+ * is best to use column numbers. If column names are used, the
89+ * programmer should take care to guarantee that they uniquely refer to
90+ * the intended columns, which can be assured with the SQL <i>AS</i> clause.
91+ * <P>
92+ * A set of updater methods were added to this interface
93+ * in the JDBC 2.0 API (Java<sup><font size=-2>TM</font></sup> 2 SDK,
94+ * Standard Edition, version 1.2). The comments regarding parameters
95+ * to the getter methods also apply to parameters to the
96+ * updater methods.
97+ *<P>
98+ * The updater methods may be used in two ways:
99+ * <ol>
100+ * <LI>to update a column value in the current row. In a scrollable
101+ * <code>ResultSet</code> object, the cursor can be moved backwards
102+ * and forwards, to an absolute position, or to a position
103+ * relative to the current row.
104+ * The following code fragment updates the <code>NAME</code> column
105+ * in the fifth row of the <code>ResultSet</code> object
106+ * <code>rs</code> and then uses the method <code>updateRow</code>
107+ * to update the data source table from which <code>rs</code> was derived.
108+ * <PRE>
109+ *
110+ * rs.absolute(5); // moves the cursor to the fifth row of rs
111+ * rs.updateString("NAME", "AINSWORTH"); // updates the
112+ * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code>
113+ * rs.updateRow(); // updates the row in the data source
114+ *
115+ * </PRE>
116+ * <LI>to insert column values into the insert row. An updatable
117+ * <code>ResultSet</code> object has a special row associated with
118+ * it that serves as a staging area for building a row to be inserted.
119+ * The following code fragment moves the cursor to the insert row, builds
120+ * a three-column row, and inserts it into <code>rs</code> and into
121+ * the data source table using the method <code>insertRow</code>.
122+ * <PRE>
123+ *
124+ * rs.moveToInsertRow(); // moves cursor to the insert row
125+ * rs.updateString(1, "AINSWORTH"); // updates the
126+ * // first column of the insert row to be <code>AINSWORTH</code>
127+ * rs.updateInt(2,35); // updates the second column to be <code>35</code>
128+ * rs.updateBoolean(3, true); // updates the third column to <code>true</code>
129+ * rs.insertRow();
130+ * rs.moveToCurrentRow();
131+ *
132+ * </PRE>
133+ * </ol>
134+ * <P>A <code>ResultSet</code> object is automatically closed when the
135+ * <code>Statement</code> object that
136+ * generated it is closed, re-executed, or used
137+ * to retrieve the next result from a sequence of multiple results.
138+ *
139+ * <P>The number, types and properties of a <code>ResultSet</code>
140+ * object's columns are provided by the <code>ResultSetMetaData</code>
141+ * object returned by the <code>ResultSet.getMetaData</code> method.
142+ *
143+ * @see Statement#executeQuery
144+ * @see Statement#getResultSet
145+ * @see ResultSetMetaData
146+ */
147+
148+public interface ResultSet extends Wrapper, AutoCloseable {
149+
150+ /**
151+ * Moves the cursor froward one row from its current position.
152+ * A <code>ResultSet</code> cursor is initially positioned
153+ * before the first row; the first call to the method
154+ * <code>next</code> makes the first row the current row; the
155+ * second call makes the second row the current row, and so on.
156+ * <p>
157+ * When a call to the <code>next</code> method returns <code>false</code>,
158+ * the cursor is positioned after the last row. Any
159+ * invocation of a <code>ResultSet</code> method which requires a
160+ * current row will result in a <code>SQLException</code> being thrown.
161+ * If the result set type is <code>TYPE_FORWARD_ONLY</code>, it is vendor specified
162+ * whether their JDBC driver implementation will return <code>false</code> or
163+ * throw an <code>SQLException</code> on a
164+ * subsequent call to <code>next</code>.
165+ *
166+ * <P>If an input stream is open for the current row, a call
167+ * to the method <code>next</code> will
168+ * implicitly close it. A <code>ResultSet</code> object's
169+ * warning chain is cleared when a new row is read.
170+ *
171+ * @return <code>true</code> if the new current row is valid;
172+ * <code>false</code> if there are no more rows
173+ * @exception SQLException if a database access error occurs or this method is
174+ * called on a closed result set
175+ */
176+ boolean next() throws SQLException;
177+
178+
179+ /**
180+ * Releases this <code>ResultSet</code> object's database and
181+ * JDBC resources immediately instead of waiting for
182+ * this to happen when it is automatically closed.
183+ *
184+ * <P>The closing of a <code>ResultSet</code> object does <strong>not</strong> close the <code>Blob</code>,
185+ * <code>Clob</code> or <code>NClob</code> objects created by the <code>ResultSet</code>. <code>Blob</code>,
186+ * <code>Clob</code> or <code>NClob</code> objects remain valid for at least the duration of the
187+ * transaction in which they are creataed, unless their <code>free</code> method is invoked.
188+ *<p>
189+ * When a <code>ResultSet</code> is closed, any <code>ResultSetMetaData</code>
190+ * instances that were created by calling the <code>getMetaData</code>
191+ * method remain accessible.
192+ *
193+ * <P><B>Note:</B> A <code>ResultSet</code> object
194+ * is automatically closed by the
195+ * <code>Statement</code> object that generated it when
196+ * that <code>Statement</code> object is closed,
197+ * re-executed, or is used to retrieve the next result from a
198+ * sequence of multiple results.
199+ *<p>
200+ * Calling the method <code>close</code> on a <code>ResultSet</code>
201+ * object that is already closed is a no-op.
202+ * <P>
203+ * <p>
204+ *
205+ * @exception SQLException if a database access error occurs
206+ */
207+ void close() throws SQLException;
208+
209+ /**
210+ * Reports whether
211+ * the last column read had a value of SQL <code>NULL</code>.
212+ * Note that you must first call one of the getter methods
213+ * on a column to try to read its value and then call
214+ * the method <code>wasNull</code> to see if the value read was
215+ * SQL <code>NULL</code>.
216+ *
217+ * @return <code>true</code> if the last column value read was SQL
218+ * <code>NULL</code> and <code>false</code> otherwise
219+ * @exception SQLException if a database access error occurs or this method is
220+ * called on a closed result set
221+ */
222+ boolean wasNull() throws SQLException;
223+
224+ // Methods for accessing results by column index
225+
226+ /**
227+ * Retrieves the value of the designated column in the current row
228+ * of this <code>ResultSet</code> object as
229+ * a <code>String</code> in the Java programming language.
230+ *
231+ * @param columnIndex the first column is 1, the second is 2, ...
232+ * @return the column value; if the value is SQL <code>NULL</code>, the
233+ * value returned is <code>null</code>
234+ * @exception SQLException if the columnIndex is not valid;
235+ * if a database access error occurs or this method is
236+ * called on a closed result set
237+ */
238+ String getString(int columnIndex) throws SQLException;
239+
240+ /**
241+ * Retrieves the value of the designated column in the current row
242+ * of this <code>ResultSet</code> object as
243+ * a <code>boolean</code> in the Java programming language.
244+ *
245+ * <P>If the designated column has a datatype of CHAR or VARCHAR
246+ * and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT
247+ * and contains a 0, a value of <code>false</code> is returned. If the designated column has a datatype
248+ * of CHAR or VARCHAR
249+ * and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT
250+ * and contains a 1, a value of <code>true</code> is returned.
251+ *
252+ * @param columnIndex the first column is 1, the second is 2, ...
253+ * @return the column value; if the value is SQL <code>NULL</code>, the
254+ * value returned is <code>false</code>
255+ * @exception SQLException if the columnIndex is not valid;
256+ * if a database access error occurs or this method is
257+ * called on a closed result set
258+ */
259+ boolean getBoolean(int columnIndex) throws SQLException;
260+
261+ /**
262+ * Retrieves the value of the designated column in the current row
263+ * of this <code>ResultSet</code> object as
264+ * a <code>byte</code> in the Java programming language.
265+ *
266+ * @param columnIndex the first column is 1, the second is 2, ...
267+ * @return the column value; if the value is SQL <code>NULL</code>, the
268+ * value returned is <code>0</code>
269+ * @exception SQLException if the columnIndex is not valid;
270+ * if a database access error occurs or this method is
271+ * called on a closed result set
272+ */
273+ byte getByte(int columnIndex) throws SQLException;
274+
275+ /**
276+ * Retrieves the value of the designated column in the current row
277+ * of this <code>ResultSet</code> object as
278+ * a <code>short</code> in the Java programming language.
279+ *
280+ * @param columnIndex the first column is 1, the second is 2, ...
281+ * @return the column value; if the value is SQL <code>NULL</code>, the
282+ * value returned is <code>0</code>
283+ * @exception SQLException if the columnIndex is not valid;
284+ * if a database access error occurs or this method is
285+ * called on a closed result set
286+ */
287+ short getShort(int columnIndex) throws SQLException;
288+
289+ /**
290+ * Retrieves the value of the designated column in the current row
291+ * of this <code>ResultSet</code> object as
292+ * an <code>int</code> in the Java programming language.
293+ *
294+ * @param columnIndex the first column is 1, the second is 2, ...
295+ * @return the column value; if the value is SQL <code>NULL</code>, the
296+ * value returned is <code>0</code>
297+ * @exception SQLException if the columnIndex is not valid;
298+ * if a database access error occurs or this method is
299+ * called on a closed result set
300+ */
301+ int getInt(int columnIndex) throws SQLException;
302+
303+ /**
304+ * Retrieves the value of the designated column in the current row
305+ * of this <code>ResultSet</code> object as
306+ * a <code>long</code> in the Java programming language.
307+ *
308+ * @param columnIndex the first column is 1, the second is 2, ...
309+ * @return the column value; if the value is SQL <code>NULL</code>, the
310+ * value returned is <code>0</code>
311+ * @exception SQLException if the columnIndex is not valid;
312+ * if a database access error occurs or this method is
313+ * called on a closed result set
314+ */
315+ long getLong(int columnIndex) throws SQLException;
316+
317+ /**
318+ * Retrieves the value of the designated column in the current row
319+ * of this <code>ResultSet</code> object as
320+ * a <code>float</code> in the Java programming language.
321+ *
322+ * @param columnIndex the first column is 1, the second is 2, ...
323+ * @return the column value; if the value is SQL <code>NULL</code>, the
324+ * value returned is <code>0</code>
325+ * @exception SQLException if the columnIndex is not valid;
326+ * if a database access error occurs or this method is
327+ * called on a closed result set
328+ */
329+ float getFloat(int columnIndex) throws SQLException;
330+
331+ /**
332+ * Retrieves the value of the designated column in the current row
333+ * of this <code>ResultSet</code> object as
334+ * a <code>double</code> in the Java programming language.
335+ *
336+ * @param columnIndex the first column is 1, the second is 2, ...
337+ * @return the column value; if the value is SQL <code>NULL</code>, the
338+ * value returned is <code>0</code>
339+ * @exception SQLException if the columnIndex is not valid;
340+ * if a database access error occurs or this method is
341+ * called on a closed result set
342+ */
343+ double getDouble(int columnIndex) throws SQLException;
344+
345+ /**
346+ * Retrieves the value of the designated column in the current row
347+ * of this <code>ResultSet</code> object as
348+ * a <code>java.sql.BigDecimal</code> in the Java programming language.
349+ *
350+ * @param columnIndex the first column is 1, the second is 2, ...
351+ * @param scale the number of digits to the right of the decimal point
352+ * @return the column value; if the value is SQL <code>NULL</code>, the
353+ * value returned is <code>null</code>
354+ * @exception SQLException if the columnIndex is not valid;
355+ * if a database access error occurs or this method is
356+ * called on a closed result set
357+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
358+ * this method
359+ * @deprecated
360+ */
361+ BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
362+
363+ /**
364+ * Retrieves the value of the designated column in the current row
365+ * of this <code>ResultSet</code> object as
366+ * a <code>byte</code> array in the Java programming language.
367+ * The bytes represent the raw values returned by the driver.
368+ *
369+ * @param columnIndex the first column is 1, the second is 2, ...
370+ * @return the column value; if the value is SQL <code>NULL</code>, the
371+ * value returned is <code>null</code>
372+ * @exception SQLException if the columnIndex is not valid;
373+ * if a database access error occurs or this method is
374+ * called on a closed result set
375+ */
376+ byte[] getBytes(int columnIndex) throws SQLException;
377+
378+ /**
379+ * Retrieves the value of the designated column in the current row
380+ * of this <code>ResultSet</code> object as
381+ * a <code>java.sql.Date</code> object in the Java programming language.
382+ *
383+ * @param columnIndex the first column is 1, the second is 2, ...
384+ * @return the column value; if the value is SQL <code>NULL</code>, the
385+ * value returned is <code>null</code>
386+ * @exception SQLException if the columnIndex is not valid;
387+ * if a database access error occurs or this method is
388+ * called on a closed result set
389+ */
390+ java.sql.Date getDate(int columnIndex) throws SQLException;
391+
392+ /**
393+ * Retrieves the value of the designated column in the current row
394+ * of this <code>ResultSet</code> object as
395+ * a <code>java.sql.Time</code> object in the Java programming language.
396+ *
397+ * @param columnIndex the first column is 1, the second is 2, ...
398+ * @return the column value; if the value is SQL <code>NULL</code>, the
399+ * value returned is <code>null</code>
400+ * @exception SQLException if the columnIndex is not valid;
401+ * if a database access error occurs or this method is
402+ * called on a closed result set
403+ */
404+ java.sql.Time getTime(int columnIndex) throws SQLException;
405+
406+ /**
407+ * Retrieves the value of the designated column in the current row
408+ * of this <code>ResultSet</code> object as
409+ * a <code>java.sql.Timestamp</code> object in the Java programming language.
410+ *
411+ * @param columnIndex the first column is 1, the second is 2, ...
412+ * @return the column value; if the value is SQL <code>NULL</code>, the
413+ * value returned is <code>null</code>
414+ * @exception SQLException if the columnIndex is not valid;
415+ * if a database access error occurs or this method is
416+ * called on a closed result set
417+ */
418+ java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException;
419+
420+ /**
421+ * Retrieves the value of the designated column in the current row
422+ * of this <code>ResultSet</code> object as
423+ * a stream of ASCII characters. The value can then be read in chunks from the
424+ * stream. This method is particularly
425+ * suitable for retrieving large <code>LONGVARCHAR</code> values.
426+ * The JDBC driver will
427+ * do any necessary conversion from the database format into ASCII.
428+ *
429+ * <P><B>Note:</B> All the data in the returned stream must be
430+ * read prior to getting the value of any other column. The next
431+ * call to a getter method implicitly closes the stream. Also, a
432+ * stream may return <code>0</code> when the method
433+ * <code>InputStream.available</code>
434+ * is called whether there is data available or not.
435+ *
436+ * @param columnIndex the first column is 1, the second is 2, ...
437+ * @return a Java input stream that delivers the database column value
438+ * as a stream of one-byte ASCII characters;
439+ * if the value is SQL <code>NULL</code>, the
440+ * value returned is <code>null</code>
441+ * @exception SQLException if the columnIndex is not valid;
442+ * if a database access error occurs or this method is
443+ * called on a closed result set
444+ */
445+ java.io.InputStream getAsciiStream(int columnIndex) throws SQLException;
446+
447+ /**
448+ * Retrieves the value of the designated column in the current row
449+ * of this <code>ResultSet</code> object as
450+ * as a stream of two-byte 3 characters. The first byte is
451+ * the high byte; the second byte is the low byte.
452+ *
453+ * The value can then be read in chunks from the
454+ * stream. This method is particularly
455+ * suitable for retrieving large <code>LONGVARCHAR</code>values. The
456+ * JDBC driver will do any necessary conversion from the database
457+ * format into Unicode.
458+ *
459+ * <P><B>Note:</B> All the data in the returned stream must be
460+ * read prior to getting the value of any other column. The next
461+ * call to a getter method implicitly closes the stream.
462+ * Also, a stream may return <code>0</code> when the method
463+ * <code>InputStream.available</code>
464+ * is called, whether there is data available or not.
465+ *
466+ * @param columnIndex the first column is 1, the second is 2, ...
467+ * @return a Java input stream that delivers the database column value
468+ * as a stream of two-byte Unicode characters;
469+ * if the value is SQL <code>NULL</code>, the value returned is
470+ * <code>null</code>
471+ *
472+ * @exception SQLException if the columnIndex is not valid;
473+ * if a database access error occurs or this method is
474+ * called on a closed result set
475+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
476+ * this method
477+ * @deprecated use <code>getCharacterStream</code> in place of
478+ * <code>getUnicodeStream</code>
479+ */
480+ java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
481+
482+ /**
483+ * Retrieves the value of the designated column in the current row
484+ * of this <code>ResultSet</code> object as a stream of
485+ * uninterpreted bytes. The value can then be read in chunks from the
486+ * stream. This method is particularly
487+ * suitable for retrieving large <code>LONGVARBINARY</code> values.
488+ *
489+ * <P><B>Note:</B> All the data in the returned stream must be
490+ * read prior to getting the value of any other column. The next
491+ * call to a getter method implicitly closes the stream. Also, a
492+ * stream may return <code>0</code> when the method
493+ * <code>InputStream.available</code>
494+ * is called whether there is data available or not.
495+ *
496+ * @param columnIndex the first column is 1, the second is 2, ...
497+ * @return a Java input stream that delivers the database column value
498+ * as a stream of uninterpreted bytes;
499+ * if the value is SQL <code>NULL</code>, the value returned is
500+ * <code>null</code>
501+ * @exception SQLException if the columnIndex is not valid;
502+ * if a database access error occurs or this method is
503+ * called on a closed result set
504+ */
505+ java.io.InputStream getBinaryStream(int columnIndex)
506+ throws SQLException;
507+
508+
509+ // Methods for accessing results by column label
510+
511+ /**
512+ * Retrieves the value of the designated column in the current row
513+ * of this <code>ResultSet</code> object as
514+ * a <code>String</code> in the Java programming language.
515+ *
516+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
517+ * @return the column value; if the value is SQL <code>NULL</code>, the
518+ * value returned is <code>null</code>
519+ * @exception SQLException if the columnLabel is not valid;
520+ * if a database access error occurs or this method is
521+ * called on a closed result set
522+ */
523+ String getString(String columnLabel) throws SQLException;
524+
525+ /**
526+ * Retrieves the value of the designated column in the current row
527+ * of this <code>ResultSet</code> object as
528+ * a <code>boolean</code> in the Java programming language.
529+ *
530+ * <P>If the designated column has a datatype of CHAR or VARCHAR
531+ * and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT
532+ * and contains a 0, a value of <code>false</code> is returned. If the designated column has a datatype
533+ * of CHAR or VARCHAR
534+ * and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT
535+ * and contains a 1, a value of <code>true</code> is returned.
536+ *
537+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
538+ * @return the column value; if the value is SQL <code>NULL</code>, the
539+ * value returned is <code>false</code>
540+ * @exception SQLException if the columnLabel is not valid;
541+ * if a database access error occurs or this method is
542+ * called on a closed result set
543+ */
544+ boolean getBoolean(String columnLabel) throws SQLException;
545+
546+ /**
547+ * Retrieves the value of the designated column in the current row
548+ * of this <code>ResultSet</code> object as
549+ * a <code>byte</code> in the Java programming language.
550+ *
551+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
552+ * @return the column value; if the value is SQL <code>NULL</code>, the
553+ * value returned is <code>0</code>
554+ * @exception SQLException if the columnLabel is not valid;
555+ * if a database access error occurs or this method is
556+ * called on a closed result set
557+ */
558+ byte getByte(String columnLabel) throws SQLException;
559+
560+ /**
561+ * Retrieves the value of the designated column in the current row
562+ * of this <code>ResultSet</code> object as
563+ * a <code>short</code> in the Java programming language.
564+ *
565+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
566+ * @return the column value; if the value is SQL <code>NULL</code>, the
567+ * value returned is <code>0</code>
568+ * @exception SQLException if the columnLabel is not valid;
569+ * if a database access error occurs or this method is
570+ * called on a closed result set
571+ */
572+ short getShort(String columnLabel) throws SQLException;
573+
574+ /**
575+ * Retrieves the value of the designated column in the current row
576+ * of this <code>ResultSet</code> object as
577+ * an <code>int</code> in the Java programming language.
578+ *
579+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
580+ * @return the column value; if the value is SQL <code>NULL</code>, the
581+ * value returned is <code>0</code>
582+ * @exception SQLException if the columnLabel is not valid;
583+ * if a database access error occurs or this method is
584+ * called on a closed result set
585+ */
586+ int getInt(String columnLabel) throws SQLException;
587+
588+ /**
589+ * Retrieves the value of the designated column in the current row
590+ * of this <code>ResultSet</code> object as
591+ * a <code>long</code> in the Java programming language.
592+ *
593+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
594+ * @return the column value; if the value is SQL <code>NULL</code>, the
595+ * value returned is <code>0</code>
596+ * @exception SQLException if the columnLabel is not valid;
597+ * if a database access error occurs or this method is
598+ * called on a closed result set
599+ */
600+ long getLong(String columnLabel) throws SQLException;
601+
602+ /**
603+ * Retrieves the value of the designated column in the current row
604+ * of this <code>ResultSet</code> object as
605+ * a <code>float</code> in the Java programming language.
606+ *
607+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
608+ * @return the column value; if the value is SQL <code>NULL</code>, the
609+ * value returned is <code>0</code>
610+ * @exception SQLException if the columnLabel is not valid;
611+ * if a database access error occurs or this method is
612+ * called on a closed result set
613+ */
614+ float getFloat(String columnLabel) throws SQLException;
615+
616+ /**
617+ * Retrieves the value of the designated column in the current row
618+ * of this <code>ResultSet</code> object as
619+ * a <code>double</code> in the Java programming language.
620+ *
621+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
622+ * @return the column value; if the value is SQL <code>NULL</code>, the
623+ * value returned is <code>0</code>
624+ * @exception SQLException if the columnLabel is not valid;
625+ * if a database access error occurs or this method is
626+ * called on a closed result set
627+ */
628+ double getDouble(String columnLabel) throws SQLException;
629+
630+ /**
631+ * Retrieves the value of the designated column in the current row
632+ * of this <code>ResultSet</code> object as
633+ * a <code>java.math.BigDecimal</code> in the Java programming language.
634+ *
635+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
636+ * @param scale the number of digits to the right of the decimal point
637+ * @return the column value; if the value is SQL <code>NULL</code>, the
638+ * value returned is <code>null</code>
639+ * @exception SQLException if the columnLabel is not valid;
640+ * if a database access error occurs or this method is
641+ * called on a closed result set
642+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
643+ * this method
644+ * @deprecated
645+ */
646+ BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException;
647+
648+ /**
649+ * Retrieves the value of the designated column in the current row
650+ * of this <code>ResultSet</code> object as
651+ * a <code>byte</code> array in the Java programming language.
652+ * The bytes represent the raw values returned by the driver.
653+ *
654+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
655+ * @return the column value; if the value is SQL <code>NULL</code>, the
656+ * value returned is <code>null</code>
657+ * @exception SQLException if the columnLabel is not valid;
658+ * if a database access error occurs or this method is
659+ * called on a closed result set
660+ */
661+ byte[] getBytes(String columnLabel) throws SQLException;
662+
663+ /**
664+ * Retrieves the value of the designated column in the current row
665+ * of this <code>ResultSet</code> object as
666+ * a <code>java.sql.Date</code> object in the Java programming language.
667+ *
668+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
669+ * @return the column value; if the value is SQL <code>NULL</code>, the
670+ * value returned is <code>null</code>
671+ * @exception SQLException if the columnLabel is not valid;
672+ * if a database access error occurs or this method is
673+ * called on a closed result set
674+ */
675+ java.sql.Date getDate(String columnLabel) throws SQLException;
676+
677+ /**
678+ * Retrieves the value of the designated column in the current row
679+ * of this <code>ResultSet</code> object as
680+ * a <code>java.sql.Time</code> object in the Java programming language.
681+ *
682+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
683+ * @return the column value;
684+ * if the value is SQL <code>NULL</code>,
685+ * the value returned is <code>null</code>
686+ * @exception SQLException if the columnLabel is not valid;
687+ * if a database access error occurs or this method is
688+ * called on a closed result set
689+ */
690+ java.sql.Time getTime(String columnLabel) throws SQLException;
691+
692+ /**
693+ * Retrieves the value of the designated column in the current row
694+ * of this <code>ResultSet</code> object as
695+ * a <code>java.sql.Timestamp</code> object in the Java programming language.
696+ *
697+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
698+ * @return the column value; if the value is SQL <code>NULL</code>, the
699+ * value returned is <code>null</code>
700+ * @exception SQLException if the columnLabel is not valid;
701+ * if a database access error occurs or this method is
702+ * called on a closed result set
703+ */
704+ java.sql.Timestamp getTimestamp(String columnLabel) throws SQLException;
705+
706+ /**
707+ * Retrieves the value of the designated column in the current row
708+ * of this <code>ResultSet</code> object as a stream of
709+ * ASCII characters. The value can then be read in chunks from the
710+ * stream. This method is particularly
711+ * suitable for retrieving large <code>LONGVARCHAR</code> values.
712+ * The JDBC driver will
713+ * do any necessary conversion from the database format into ASCII.
714+ *
715+ * <P><B>Note:</B> All the data in the returned stream must be
716+ * read prior to getting the value of any other column. The next
717+ * call to a getter method implicitly closes the stream. Also, a
718+ * stream may return <code>0</code> when the method <code>available</code>
719+ * is called whether there is data available or not.
720+ *
721+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
722+ * @return a Java input stream that delivers the database column value
723+ * as a stream of one-byte ASCII characters.
724+ * If the value is SQL <code>NULL</code>,
725+ * the value returned is <code>null</code>.
726+ * @exception SQLException if the columnLabel is not valid;
727+ * if a database access error occurs or this method is
728+ * called on a closed result set
729+ */
730+ java.io.InputStream getAsciiStream(String columnLabel) throws SQLException;
731+
732+ /**
733+ * Retrieves the value of the designated column in the current row
734+ * of this <code>ResultSet</code> object as a stream of two-byte
735+ * Unicode characters. The first byte is the high byte; the second
736+ * byte is the low byte.
737+ *
738+ * The value can then be read in chunks from the
739+ * stream. This method is particularly
740+ * suitable for retrieving large <code>LONGVARCHAR</code> values.
741+ * The JDBC technology-enabled driver will
742+ * do any necessary conversion from the database format into Unicode.
743+ *
744+ * <P><B>Note:</B> All the data in the returned stream must be
745+ * read prior to getting the value of any other column. The next
746+ * call to a getter method implicitly closes the stream.
747+ * Also, a stream may return <code>0</code> when the method
748+ * <code>InputStream.available</code> is called, whether there
749+ * is data available or not.
750+ *
751+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
752+ * @return a Java input stream that delivers the database column value
753+ * as a stream of two-byte Unicode characters.
754+ * If the value is SQL <code>NULL</code>, the value returned
755+ * is <code>null</code>.
756+ * @exception SQLException if the columnLabel is not valid;
757+ * if a database access error occurs or this method is
758+ * called on a closed result set
759+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
760+ * this method
761+ * @deprecated use <code>getCharacterStream</code> instead
762+ */
763+ java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException;
764+
765+ /**
766+ * Retrieves the value of the designated column in the current row
767+ * of this <code>ResultSet</code> object as a stream of uninterpreted
768+ * <code>byte</code>s.
769+ * The value can then be read in chunks from the
770+ * stream. This method is particularly
771+ * suitable for retrieving large <code>LONGVARBINARY</code>
772+ * values.
773+ *
774+ * <P><B>Note:</B> All the data in the returned stream must be
775+ * read prior to getting the value of any other column. The next
776+ * call to a getter method implicitly closes the stream. Also, a
777+ * stream may return <code>0</code> when the method <code>available</code>
778+ * is called whether there is data available or not.
779+ *
780+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
781+ * @return a Java input stream that delivers the database column value
782+ * as a stream of uninterpreted bytes;
783+ * if the value is SQL <code>NULL</code>, the result is <code>null</code>
784+ * @exception SQLException if the columnLabel is not valid;
785+ * if a database access error occurs or this method is
786+ * called on a closed result set
787+ */
788+ java.io.InputStream getBinaryStream(String columnLabel)
789+ throws SQLException;
790+
791+
792+ // Advanced features:
793+
794+ /**
795+ * Retrieves the first warning reported by calls on this
796+ * <code>ResultSet</code> object.
797+ * Subsequent warnings on this <code>ResultSet</code> object
798+ * will be chained to the <code>SQLWarning</code> object that
799+ * this method returns.
800+ *
801+ * <P>The warning chain is automatically cleared each time a new
802+ * row is read. This method may not be called on a <code>ResultSet</code>
803+ * object that has been closed; doing so will cause an
804+ * <code>SQLException</code> to be thrown.
805+ * <P>
806+ * <B>Note:</B> This warning chain only covers warnings caused
807+ * by <code>ResultSet</code> methods. Any warning caused by
808+ * <code>Statement</code> methods
809+ * (such as reading OUT parameters) will be chained on the
810+ * <code>Statement</code> object.
811+ *
812+ * @return the first <code>SQLWarning</code> object reported or
813+ * <code>null</code> if there are none
814+ * @exception SQLException if a database access error occurs or this method is
815+ * called on a closed result set
816+ */
817+ SQLWarning getWarnings() throws SQLException;
818+
819+ /**
820+ * Clears all warnings reported on this <code>ResultSet</code> object.
821+ * After this method is called, the method <code>getWarnings</code>
822+ * returns <code>null</code> until a new warning is
823+ * reported for this <code>ResultSet</code> object.
824+ *
825+ * @exception SQLException if a database access error occurs or this method is
826+ * called on a closed result set
827+ */
828+ void clearWarnings() throws SQLException;
829+
830+ /**
831+ * Retrieves the name of the SQL cursor used by this <code>ResultSet</code>
832+ * object.
833+ *
834+ * <P>In SQL, a result table is retrieved through a cursor that is
835+ * named. The current row of a result set can be updated or deleted
836+ * using a positioned update/delete statement that references the
837+ * cursor name. To insure that the cursor has the proper isolation
838+ * level to support update, the cursor's <code>SELECT</code> statement
839+ * should be of the form <code>SELECT FOR UPDATE</code>. If
840+ * <code>FOR UPDATE</code> is omitted, the positioned updates may fail.
841+ *
842+ * <P>The JDBC API supports this SQL feature by providing the name of the
843+ * SQL cursor used by a <code>ResultSet</code> object.
844+ * The current row of a <code>ResultSet</code> object
845+ * is also the current row of this SQL cursor.
846+ *
847+ * @return the SQL name for this <code>ResultSet</code> object's cursor
848+ * @exception SQLException if a database access error occurs or this method is called on a closed result set
849+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
850+ * this method
851+ */
852+ String getCursorName() throws SQLException;
853+
854+ /**
855+ * Retrieves the number, types and properties of
856+ * this <code>ResultSet</code> object's columns.
857+ *
858+ * @return the description of this <code>ResultSet</code> object's columns
859+ * @exception SQLException if a database access error occurs or this method is
860+ * called on a closed result set
861+ */
862+ ResultSetMetaData getMetaData() throws SQLException;
863+
864+ /**
865+ * <p>Gets the value of the designated column in the current row
866+ * of this <code>ResultSet</code> object as
867+ * an <code>Object</code> in the Java programming language.
868+ *
869+ * <p>This method will return the value of the given column as a
870+ * Java object. The type of the Java object will be the default
871+ * Java object type corresponding to the column's SQL type,
872+ * following the mapping for built-in types specified in the JDBC
873+ * specification. If the value is an SQL <code>NULL</code>,
874+ * the driver returns a Java <code>null</code>.
875+ *
876+ * <p>This method may also be used to read database-specific
877+ * abstract data types.
878+ *
879+ * In the JDBC 2.0 API, the behavior of method
880+ * <code>getObject</code> is extended to materialize
881+ * data of SQL user-defined types.
882+ * <p>
883+ * If <code>Connection.getTypeMap</code> does not throw a
884+ * <code>SQLFeatureNotSupportedException</code>,
885+ * then when a column contains a structured or distinct value,
886+ * the behavior of this method is as
887+ * if it were a call to: <code>getObject(columnIndex,
888+ * this.getStatement().getConnection().getTypeMap())</code>.
889+ *
890+ * If <code>Connection.getTypeMap</code> does throw a
891+ * <code>SQLFeatureNotSupportedException</code>,
892+ * then structured values are not supported, and distinct values
893+ * are mapped to the default Java class as determined by the
894+ * underlying SQL type of the DISTINCT type.
895+ *
896+ * @param columnIndex the first column is 1, the second is 2, ...
897+ * @return a <code>java.lang.Object</code> holding the column value
898+ * @exception SQLException if the columnIndex is not valid;
899+ * if a database access error occurs or this method is
900+ * called on a closed result set
901+ */
902+ Object getObject(int columnIndex) throws SQLException;
903+
904+ /**
905+ * <p>Gets the value of the designated column in the current row
906+ * of this <code>ResultSet</code> object as
907+ * an <code>Object</code> in the Java programming language.
908+ *
909+ * <p>This method will return the value of the given column as a
910+ * Java object. The type of the Java object will be the default
911+ * Java object type corresponding to the column's SQL type,
912+ * following the mapping for built-in types specified in the JDBC
913+ * specification. If the value is an SQL <code>NULL</code>,
914+ * the driver returns a Java <code>null</code>.
915+ * <P>
916+ * This method may also be used to read database-specific
917+ * abstract data types.
918+ * <P>
919+ * In the JDBC 2.0 API, the behavior of the method
920+ * <code>getObject</code> is extended to materialize
921+ * data of SQL user-defined types. When a column contains
922+ * a structured or distinct value, the behavior of this method is as
923+ * if it were a call to: <code>getObject(columnIndex,
924+ * this.getStatement().getConnection().getTypeMap())</code>.
925+ *
926+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
927+ * @return a <code>java.lang.Object</code> holding the column value
928+ * @exception SQLException if the columnLabel is not valid;
929+ * if a database access error occurs or this method is
930+ * called on a closed result set
931+ */
932+ Object getObject(String columnLabel) throws SQLException;
933+
934+ //----------------------------------------------------------------
935+
936+ /**
937+ * Maps the given <code>ResultSet</code> column label to its
938+ * <code>ResultSet</code> column index.
939+ *
940+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
941+ * @return the column index of the given column name
942+ * @exception SQLException if the <code>ResultSet</code> object
943+ * does not contain a column labeled <code>columnLabel</code>, a database access error occurs
944+ * or this method is called on a closed result set
945+ */
946+ int findColumn(String columnLabel) throws SQLException;
947+
948+
949+ //--------------------------JDBC 2.0-----------------------------------
950+
951+ //---------------------------------------------------------------------
952+ // Getters and Setters
953+ //---------------------------------------------------------------------
954+
955+ /**
956+ * Retrieves the value of the designated column in the current row
957+ * of this <code>ResultSet</code> object as a
958+ * <code>java.io.Reader</code> object.
959+ * @return a <code>java.io.Reader</code> object that contains the column
960+ * value; if the value is SQL <code>NULL</code>, the value returned is
961+ * <code>null</code> in the Java programming language.
962+ * @param columnIndex the first column is 1, the second is 2, ...
963+ * @exception SQLException if the columnIndex is not valid;
964+ * if a database access error occurs or this method is
965+ * called on a closed result set
966+ * @since 1.2
967+ */
968+ java.io.Reader getCharacterStream(int columnIndex) throws SQLException;
969+
970+ /**
971+ * Retrieves the value of the designated column in the current row
972+ * of this <code>ResultSet</code> object as a
973+ * <code>java.io.Reader</code> object.
974+ *
975+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
976+ * @return a <code>java.io.Reader</code> object that contains the column
977+ * value; if the value is SQL <code>NULL</code>, the value returned is
978+ * <code>null</code> in the Java programming language
979+ * @exception SQLException if the columnLabel is not valid;
980+ * if a database access error occurs or this method is
981+ * called on a closed result set
982+ * @since 1.2
983+ */
984+ java.io.Reader getCharacterStream(String columnLabel) throws SQLException;
985+
986+ /**
987+ * Retrieves the value of the designated column in the current row
988+ * of this <code>ResultSet</code> object as a
989+ * <code>java.math.BigDecimal</code> with full precision.
990+ *
991+ * @param columnIndex the first column is 1, the second is 2, ...
992+ * @return the column value (full precision);
993+ * if the value is SQL <code>NULL</code>, the value returned is
994+ * <code>null</code> in the Java programming language.
995+ * @exception SQLException if the columnIndex is not valid;
996+ * if a database access error occurs or this method is
997+ * called on a closed result set
998+ * @since 1.2
999+ */
1000+ BigDecimal getBigDecimal(int columnIndex) throws SQLException;
1001+
1002+ /**
1003+ * Retrieves the value of the designated column in the current row
1004+ * of this <code>ResultSet</code> object as a
1005+ * <code>java.math.BigDecimal</code> with full precision.
1006+ *
1007+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1008+ * @return the column value (full precision);
1009+ * if the value is SQL <code>NULL</code>, the value returned is
1010+ * <code>null</code> in the Java programming language.
1011+ * @exception SQLException if the columnLabel is not valid;
1012+ * if a database access error occurs or this method is
1013+ * called on a closed result set
1014+ * @since 1.2
1015+ *
1016+ */
1017+ BigDecimal getBigDecimal(String columnLabel) throws SQLException;
1018+
1019+ //---------------------------------------------------------------------
1020+ // Traversal/Positioning
1021+ //---------------------------------------------------------------------
1022+
1023+ /**
1024+ * Retrieves whether the cursor is before the first row in
1025+ * this <code>ResultSet</code> object.
1026+ * <p>
1027+ * <strong>Note:</strong>Support for the <code>isBeforeFirst</code> method
1028+ * is optional for <code>ResultSet</code>s with a result
1029+ * set type of <code>TYPE_FORWARD_ONLY</code>
1030+ *
1031+ * @return <code>true</code> if the cursor is before the first row;
1032+ * <code>false</code> if the cursor is at any other position or the
1033+ * result set contains no rows
1034+ * @exception SQLException if a database access error occurs or this method is
1035+ * called on a closed result set
1036+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1037+ * this method
1038+ * @since 1.2
1039+ */
1040+ boolean isBeforeFirst() throws SQLException;
1041+
1042+ /**
1043+ * Retrieves whether the cursor is after the last row in
1044+ * this <code>ResultSet</code> object.
1045+ * <p>
1046+ * <strong>Note:</strong>Support for the <code>isAfterLast</code> method
1047+ * is optional for <code>ResultSet</code>s with a result
1048+ * set type of <code>TYPE_FORWARD_ONLY</code>
1049+ *
1050+ * @return <code>true</code> if the cursor is after the last row;
1051+ * <code>false</code> if the cursor is at any other position or the
1052+ * result set contains no rows
1053+ * @exception SQLException if a database access error occurs or this method is
1054+ * called on a closed result set
1055+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1056+ * this method
1057+ * @since 1.2
1058+ */
1059+ boolean isAfterLast() throws SQLException;
1060+
1061+ /**
1062+ * Retrieves whether the cursor is on the first row of
1063+ * this <code>ResultSet</code> object.
1064+ * <p>
1065+ * <strong>Note:</strong>Support for the <code>isFirst</code> method
1066+ * is optional for <code>ResultSet</code>s with a result
1067+ * set type of <code>TYPE_FORWARD_ONLY</code>
1068+ *
1069+ * @return <code>true</code> if the cursor is on the first row;
1070+ * <code>false</code> otherwise
1071+ * @exception SQLException if a database access error occurs or this method is
1072+ * called on a closed result set
1073+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1074+ * this method
1075+ * @since 1.2
1076+ */
1077+ boolean isFirst() throws SQLException;
1078+
1079+ /**
1080+ * Retrieves whether the cursor is on the last row of
1081+ * this <code>ResultSet</code> object.
1082+ * <strong>Note:</strong> Calling the method <code>isLast</code> may be expensive
1083+ * because the JDBC driver
1084+ * might need to fetch ahead one row in order to determine
1085+ * whether the current row is the last row in the result set.
1086+ * <p>
1087+ * <strong>Note:</strong> Support for the <code>isLast</code> method
1088+ * is optional for <code>ResultSet</code>s with a result
1089+ * set type of <code>TYPE_FORWARD_ONLY</code>
1090+ * @return <code>true</code> if the cursor is on the last row;
1091+ * <code>false</code> otherwise
1092+ * @exception SQLException if a database access error occurs or this method is
1093+ * called on a closed result set
1094+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1095+ * this method
1096+ * @since 1.2
1097+ */
1098+ boolean isLast() throws SQLException;
1099+
1100+ /**
1101+ * Moves the cursor to the front of
1102+ * this <code>ResultSet</code> object, just before the
1103+ * first row. This method has no effect if the result set contains no rows.
1104+ *
1105+ * @exception SQLException if a database access error
1106+ * occurs; this method is called on a closed result set or the
1107+ * result set type is <code>TYPE_FORWARD_ONLY</code>
1108+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1109+ * this method
1110+ * @since 1.2
1111+ */
1112+ void beforeFirst() throws SQLException;
1113+
1114+ /**
1115+ * Moves the cursor to the end of
1116+ * this <code>ResultSet</code> object, just after the
1117+ * last row. This method has no effect if the result set contains no rows.
1118+ * @exception SQLException if a database access error
1119+ * occurs; this method is called on a closed result set
1120+ * or the result set type is <code>TYPE_FORWARD_ONLY</code>
1121+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1122+ * this method
1123+ * @since 1.2
1124+ */
1125+ void afterLast() throws SQLException;
1126+
1127+ /**
1128+ * Moves the cursor to the first row in
1129+ * this <code>ResultSet</code> object.
1130+ *
1131+ * @return <code>true</code> if the cursor is on a valid row;
1132+ * <code>false</code> if there are no rows in the result set
1133+ * @exception SQLException if a database access error
1134+ * occurs; this method is called on a closed result set
1135+ * or the result set type is <code>TYPE_FORWARD_ONLY</code>
1136+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1137+ * this method
1138+ * @since 1.2
1139+ */
1140+ boolean first() throws SQLException;
1141+
1142+ /**
1143+ * Moves the cursor to the last row in
1144+ * this <code>ResultSet</code> object.
1145+ *
1146+ * @return <code>true</code> if the cursor is on a valid row;
1147+ * <code>false</code> if there are no rows in the result set
1148+ * @exception SQLException if a database access error
1149+ * occurs; this method is called on a closed result set
1150+ * or the result set type is <code>TYPE_FORWARD_ONLY</code>
1151+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1152+ * this method
1153+ * @since 1.2
1154+ */
1155+ boolean last() throws SQLException;
1156+
1157+ /**
1158+ * Retrieves the current row number. The first row is number 1, the
1159+ * second number 2, and so on.
1160+ * <p>
1161+ * <strong>Note:</strong>Support for the <code>getRow</code> method
1162+ * is optional for <code>ResultSet</code>s with a result
1163+ * set type of <code>TYPE_FORWARD_ONLY</code>
1164+ *
1165+ * @return the current row number; <code>0</code> if there is no current row
1166+ * @exception SQLException if a database access error occurs
1167+ * or this method is called on a closed result set
1168+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1169+ * this method
1170+ * @since 1.2
1171+ */
1172+ int getRow() throws SQLException;
1173+
1174+ /**
1175+ * Moves the cursor to the given row number in
1176+ * this <code>ResultSet</code> object.
1177+ *
1178+ * <p>If the row number is positive, the cursor moves to
1179+ * the given row number with respect to the
1180+ * beginning of the result set. The first row is row 1, the second
1181+ * is row 2, and so on.
1182+ *
1183+ * <p>If the given row number is negative, the cursor moves to
1184+ * an absolute row position with respect to
1185+ * the end of the result set. For example, calling the method
1186+ * <code>absolute(-1)</code> positions the
1187+ * cursor on the last row; calling the method <code>absolute(-2)</code>
1188+ * moves the cursor to the next-to-last row, and so on.
1189+ *
1190+ * <p>If the row number specified is zero, the cursor is moved to
1191+ * before the first row.
1192+ *
1193+ * <p>An attempt to position the cursor beyond the first/last row in
1194+ * the result set leaves the cursor before the first row or after
1195+ * the last row.
1196+ *
1197+ * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
1198+ * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
1199+ * is the same as calling <code>last()</code>.
1200+ *
1201+ * @param row the number of the row to which the cursor should move.
1202+ * A value of zero indicates that the cursor will be positioned
1203+ * before the first row; a positive number indicates the row number
1204+ * counting from the beginning of the result set; a negative number
1205+ * indicates the row number counting from the end of the result set
1206+ * @return <code>true</code> if the cursor is moved to a position in this
1207+ * <code>ResultSet</code> object;
1208+ * <code>false</code> if the cursor is before the first row or after the
1209+ * last row
1210+ * @exception SQLException if a database access error
1211+ * occurs; this method is called on a closed result set
1212+ * or the result set type is <code>TYPE_FORWARD_ONLY</code>
1213+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1214+ * this method
1215+ * @since 1.2
1216+ */
1217+ boolean absolute( int row ) throws SQLException;
1218+
1219+ /**
1220+ * Moves the cursor a relative number of rows, either positive or negative.
1221+ * Attempting to move beyond the first/last row in the
1222+ * result set positions the cursor before/after the
1223+ * the first/last row. Calling <code>relative(0)</code> is valid, but does
1224+ * not change the cursor position.
1225+ *
1226+ * <p>Note: Calling the method <code>relative(1)</code>
1227+ * is identical to calling the method <code>next()</code> and
1228+ * calling the method <code>relative(-1)</code> is identical
1229+ * to calling the method <code>previous()</code>.
1230+ *
1231+ * @param rows an <code>int</code> specifying the number of rows to
1232+ * move from the current row; a positive number moves the cursor
1233+ * forward; a negative number moves the cursor backward
1234+ * @return <code>true</code> if the cursor is on a row;
1235+ * <code>false</code> otherwise
1236+ * @exception SQLException if a database access error occurs; this method
1237+ * is called on a closed result set or the result set type is
1238+ * <code>TYPE_FORWARD_ONLY</code>
1239+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1240+ * this method
1241+ * @since 1.2
1242+ */
1243+ boolean relative( int rows ) throws SQLException;
1244+
1245+ /**
1246+ * Moves the cursor to the previous row in this
1247+ * <code>ResultSet</code> object.
1248+ *<p>
1249+ * When a call to the <code>previous</code> method returns <code>false</code>,
1250+ * the cursor is positioned before the first row. Any invocation of a
1251+ * <code>ResultSet</code> method which requires a current row will result in a
1252+ * <code>SQLException</code> being thrown.
1253+ *<p>
1254+ * If an input stream is open for the current row, a call to the method
1255+ * <code>previous</code> will implicitly close it. A <code>ResultSet</code>
1256+ * object's warning change is cleared when a new row is read.
1257+ *<p>
1258+ *
1259+ * @return <code>true</code> if the cursor is now positioned on a valid row;
1260+ * <code>false</code> if the cursor is positioned before the first row
1261+ * @exception SQLException if a database access error
1262+ * occurs; this method is called on a closed result set
1263+ * or the result set type is <code>TYPE_FORWARD_ONLY</code>
1264+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1265+ * this method
1266+ * @since 1.2
1267+ */
1268+ boolean previous() throws SQLException;
1269+
1270+ //---------------------------------------------------------------------
1271+ // Properties
1272+ //---------------------------------------------------------------------
1273+
1274+ /**
1275+ * The constant indicating that the rows in a result set will be
1276+ * processed in a forward direction; first-to-last.
1277+ * This constant is used by the method <code>setFetchDirection</code>
1278+ * as a hint to the driver, which the driver may ignore.
1279+ * @since 1.2
1280+ */
1281+ int FETCH_FORWARD = 1000;
1282+
1283+ /**
1284+ * The constant indicating that the rows in a result set will be
1285+ * processed in a reverse direction; last-to-first.
1286+ * This constant is used by the method <code>setFetchDirection</code>
1287+ * as a hint to the driver, which the driver may ignore.
1288+ * @since 1.2
1289+ */
1290+ int FETCH_REVERSE = 1001;
1291+
1292+ /**
1293+ * The constant indicating that the order in which rows in a
1294+ * result set will be processed is unknown.
1295+ * This constant is used by the method <code>setFetchDirection</code>
1296+ * as a hint to the driver, which the driver may ignore.
1297+ */
1298+ int FETCH_UNKNOWN = 1002;
1299+
1300+ /**
1301+ * Gives a hint as to the direction in which the rows in this
1302+ * <code>ResultSet</code> object will be processed.
1303+ * The initial value is determined by the
1304+ * <code>Statement</code> object
1305+ * that produced this <code>ResultSet</code> object.
1306+ * The fetch direction may be changed at any time.
1307+ *
1308+ * @param direction an <code>int</code> specifying the suggested
1309+ * fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>,
1310+ * <code>ResultSet.FETCH_REVERSE</code>, or
1311+ * <code>ResultSet.FETCH_UNKNOWN</code>
1312+ * @exception SQLException if a database access error occurs; this
1313+ * method is called on a closed result set or
1314+ * the result set type is <code>TYPE_FORWARD_ONLY</code> and the fetch
1315+ * direction is not <code>FETCH_FORWARD</code>
1316+ * @since 1.2
1317+ * @see Statement#setFetchDirection
1318+ * @see #getFetchDirection
1319+ */
1320+ void setFetchDirection(int direction) throws SQLException;
1321+
1322+ /**
1323+ * Retrieves the fetch direction for this
1324+ * <code>ResultSet</code> object.
1325+ *
1326+ * @return the current fetch direction for this <code>ResultSet</code> object
1327+ * @exception SQLException if a database access error occurs
1328+ * or this method is called on a closed result set
1329+ * @since 1.2
1330+ * @see #setFetchDirection
1331+ */
1332+ int getFetchDirection() throws SQLException;
1333+
1334+ /**
1335+ * Gives the JDBC driver a hint as to the number of rows that should
1336+ * be fetched from the database when more rows are needed for this
1337+ * <code>ResultSet</code> object.
1338+ * If the fetch size specified is zero, the JDBC driver
1339+ * ignores the value and is free to make its own best guess as to what
1340+ * the fetch size should be. The default value is set by the
1341+ * <code>Statement</code> object
1342+ * that created the result set. The fetch size may be changed at any time.
1343+ *
1344+ * @param rows the number of rows to fetch
1345+ * @exception SQLException if a database access error occurs; this method
1346+ * is called on a closed result set or the
1347+ * condition <code>rows >= 0 </code> is not satisfied
1348+ * @since 1.2
1349+ * @see #getFetchSize
1350+ */
1351+ void setFetchSize(int rows) throws SQLException;
1352+
1353+ /**
1354+ * Retrieves the fetch size for this
1355+ * <code>ResultSet</code> object.
1356+ *
1357+ * @return the current fetch size for this <code>ResultSet</code> object
1358+ * @exception SQLException if a database access error occurs
1359+ * or this method is called on a closed result set
1360+ * @since 1.2
1361+ * @see #setFetchSize
1362+ */
1363+ int getFetchSize() throws SQLException;
1364+
1365+ /**
1366+ * The constant indicating the type for a <code>ResultSet</code> object
1367+ * whose cursor may move only forward.
1368+ * @since 1.2
1369+ */
1370+ int TYPE_FORWARD_ONLY = 1003;
1371+
1372+ /**
1373+ * The constant indicating the type for a <code>ResultSet</code> object
1374+ * that is scrollable but generally not sensitive to changes to the data
1375+ * that underlies the <code>ResultSet</code>.
1376+ * @since 1.2
1377+ */
1378+ int TYPE_SCROLL_INSENSITIVE = 1004;
1379+
1380+ /**
1381+ * The constant indicating the type for a <code>ResultSet</code> object
1382+ * that is scrollable and generally sensitive to changes to the data
1383+ * that underlies the <code>ResultSet</code>.
1384+ * @since 1.2
1385+ */
1386+ int TYPE_SCROLL_SENSITIVE = 1005;
1387+
1388+ /**
1389+ * Retrieves the type of this <code>ResultSet</code> object.
1390+ * The type is determined by the <code>Statement</code> object
1391+ * that created the result set.
1392+ *
1393+ * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
1394+ * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
1395+ * or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
1396+ * @exception SQLException if a database access error occurs
1397+ * or this method is called on a closed result set
1398+ * @since 1.2
1399+ */
1400+ int getType() throws SQLException;
1401+
1402+ /**
1403+ * The constant indicating the concurrency mode for a
1404+ * <code>ResultSet</code> object that may NOT be updated.
1405+ * @since 1.2
1406+ */
1407+ int CONCUR_READ_ONLY = 1007;
1408+
1409+ /**
1410+ * The constant indicating the concurrency mode for a
1411+ * <code>ResultSet</code> object that may be updated.
1412+ * @since 1.2
1413+ */
1414+ int CONCUR_UPDATABLE = 1008;
1415+
1416+ /**
1417+ * Retrieves the concurrency mode of this <code>ResultSet</code> object.
1418+ * The concurrency used is determined by the
1419+ * <code>Statement</code> object that created the result set.
1420+ *
1421+ * @return the concurrency type, either
1422+ * <code>ResultSet.CONCUR_READ_ONLY</code>
1423+ * or <code>ResultSet.CONCUR_UPDATABLE</code>
1424+ * @exception SQLException if a database access error occurs
1425+ * or this method is called on a closed result set
1426+ * @since 1.2
1427+ */
1428+ int getConcurrency() throws SQLException;
1429+
1430+ //---------------------------------------------------------------------
1431+ // Updates
1432+ //---------------------------------------------------------------------
1433+
1434+ /**
1435+ * Retrieves whether the current row has been updated. The value returned
1436+ * depends on whether or not the result set can detect updates.
1437+ * <p>
1438+ * <strong>Note:</strong> Support for the <code>rowUpdated</code> method is optional with a result set
1439+ * concurrency of <code>CONCUR_READ_ONLY</code>
1440+ * @return <code>true</code> if the current row is detected to
1441+ * have been visibly updated by the owner or another; <code>false</code> otherwise
1442+ * @exception SQLException if a database access error occurs
1443+ * or this method is called on a closed result set
1444+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1445+ * this method
1446+ * @see DatabaseMetaData#updatesAreDetected
1447+ * @since 1.2
1448+ */
1449+ boolean rowUpdated() throws SQLException;
1450+
1451+ /**
1452+ * Retrieves whether the current row has had an insertion.
1453+ * The value returned depends on whether or not this
1454+ * <code>ResultSet</code> object can detect visible inserts.
1455+ * <p>
1456+ * <strong>Note:</strong> Support for the <code>rowInserted</code> method is optional with a result set
1457+ * concurrency of <code>CONCUR_READ_ONLY</code>
1458+ * @return <code>true</code> if the current row is detected to
1459+ * have been inserted; <code>false</code> otherwise
1460+ * @exception SQLException if a database access error occurs
1461+ * or this method is called on a closed result set
1462+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1463+ * this method
1464+ *
1465+ * @see DatabaseMetaData#insertsAreDetected
1466+ * @since 1.2
1467+ */
1468+ boolean rowInserted() throws SQLException;
1469+
1470+ /**
1471+ * Retrieves whether a row has been deleted. A deleted row may leave
1472+ * a visible "hole" in a result set. This method can be used to
1473+ * detect holes in a result set. The value returned depends on whether
1474+ * or not this <code>ResultSet</code> object can detect deletions.
1475+ * <p>
1476+ * <strong>Note:</strong> Support for the <code>rowDeleted</code> method is optional with a result set
1477+ * concurrency of <code>CONCUR_READ_ONLY</code>
1478+ * @return <code>true</code> if the current row is detected to
1479+ * have been deleted by the owner or another; <code>false</code> otherwise
1480+ * @exception SQLException if a database access error occurs
1481+ * or this method is called on a closed result set
1482+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1483+ * this method
1484+ *
1485+ * @see DatabaseMetaData#deletesAreDetected
1486+ * @since 1.2
1487+ */
1488+ boolean rowDeleted() throws SQLException;
1489+
1490+ /**
1491+ * Updates the designated column with a <code>null</code> value.
1492+ *
1493+ * The updater methods are used to update column values in the
1494+ * current row or the insert row. The updater methods do not
1495+ * update the underlying database; instead the <code>updateRow</code>
1496+ * or <code>insertRow</code> methods are called to update the database.
1497+ *
1498+ * @param columnIndex the first column is 1, the second is 2, ...
1499+ * @exception SQLException if the columnIndex is not valid;
1500+ * if a database access error occurs;
1501+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1502+ * or this method is called on a closed result set
1503+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1504+ * this method
1505+ * @since 1.2
1506+ */
1507+ void updateNull(int columnIndex) throws SQLException;
1508+
1509+ /**
1510+ * Updates the designated column with a <code>boolean</code> value.
1511+ * The updater methods are used to update column values in the
1512+ * current row or the insert row. The updater methods do not
1513+ * update the underlying database; instead the <code>updateRow</code> or
1514+ * <code>insertRow</code> methods are called to update the database.
1515+ *
1516+ * @param columnIndex the first column is 1, the second is 2, ...
1517+ * @param x the new column value
1518+ * @exception SQLException if the columnIndex is not valid;
1519+ * if a database access error occurs;
1520+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1521+ * or this method is called on a closed result set
1522+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1523+ * this method
1524+ * @since 1.2
1525+ */
1526+ void updateBoolean(int columnIndex, boolean x) throws SQLException;
1527+
1528+ /**
1529+ * Updates the designated column with a <code>byte</code> value.
1530+ * The updater methods are used to update column values in the
1531+ * current row or the insert row. The updater methods do not
1532+ * update the underlying database; instead the <code>updateRow</code> or
1533+ * <code>insertRow</code> methods are called to update the database.
1534+ *
1535+ *
1536+ * @param columnIndex the first column is 1, the second is 2, ...
1537+ * @param x the new column value
1538+ * @exception SQLException if the columnIndex is not valid;
1539+ * if a database access error occurs;
1540+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1541+ * or this method is called on a closed result set
1542+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1543+ * this method
1544+ * @since 1.2
1545+ */
1546+ void updateByte(int columnIndex, byte x) throws SQLException;
1547+
1548+ /**
1549+ * Updates the designated column with a <code>short</code> value.
1550+ * The updater methods are used to update column values in the
1551+ * current row or the insert row. The updater methods do not
1552+ * update the underlying database; instead the <code>updateRow</code> or
1553+ * <code>insertRow</code> methods are called to update the database.
1554+ *
1555+ * @param columnIndex the first column is 1, the second is 2, ...
1556+ * @param x the new column value
1557+ * @exception SQLException if the columnIndex is not valid;
1558+ * if a database access error occurs;
1559+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1560+ * or this method is called on a closed result set
1561+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1562+ * this method
1563+ * @since 1.2
1564+ */
1565+ void updateShort(int columnIndex, short x) throws SQLException;
1566+
1567+ /**
1568+ * Updates the designated column with an <code>int</code> value.
1569+ * The updater methods are used to update column values in the
1570+ * current row or the insert row. The updater methods do not
1571+ * update the underlying database; instead the <code>updateRow</code> or
1572+ * <code>insertRow</code> methods are called to update the database.
1573+ *
1574+ * @param columnIndex the first column is 1, the second is 2, ...
1575+ * @param x the new column value
1576+ * @exception SQLException if the columnIndex is not valid;
1577+ * if a database access error occurs;
1578+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1579+ * or this method is called on a closed result set
1580+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1581+ * this method
1582+ * @since 1.2
1583+ */
1584+ void updateInt(int columnIndex, int x) throws SQLException;
1585+
1586+ /**
1587+ * Updates the designated column with a <code>long</code> value.
1588+ * The updater methods are used to update column values in the
1589+ * current row or the insert row. The updater methods do not
1590+ * update the underlying database; instead the <code>updateRow</code> or
1591+ * <code>insertRow</code> methods are called to update the database.
1592+ *
1593+ * @param columnIndex the first column is 1, the second is 2, ...
1594+ * @param x the new column value
1595+ * @exception SQLException if the columnIndex is not valid;
1596+ * if a database access error occurs;
1597+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1598+ * or this method is called on a closed result set
1599+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1600+ * this method
1601+ * @since 1.2
1602+ */
1603+ void updateLong(int columnIndex, long x) throws SQLException;
1604+
1605+ /**
1606+ * Updates the designated column with a <code>float</code> value.
1607+ * The updater methods are used to update column values in the
1608+ * current row or the insert row. The updater methods do not
1609+ * update the underlying database; instead the <code>updateRow</code> or
1610+ * <code>insertRow</code> methods are called to update the database.
1611+ *
1612+ * @param columnIndex the first column is 1, the second is 2, ...
1613+ * @param x the new column value
1614+ * @exception SQLException if the columnIndex is not valid;
1615+ * if a database access error occurs;
1616+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1617+ * or this method is called on a closed result set
1618+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1619+ * this method
1620+ * @since 1.2
1621+ */
1622+ void updateFloat(int columnIndex, float x) throws SQLException;
1623+
1624+ /**
1625+ * Updates the designated column with a <code>double</code> value.
1626+ * The updater methods are used to update column values in the
1627+ * current row or the insert row. The updater methods do not
1628+ * update the underlying database; instead the <code>updateRow</code> or
1629+ * <code>insertRow</code> methods are called to update the database.
1630+ *
1631+ * @param columnIndex the first column is 1, the second is 2, ...
1632+ * @param x the new column value
1633+ * @exception SQLException if the columnIndex is not valid;
1634+ * if a database access error occurs;
1635+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1636+ * or this method is called on a closed result set
1637+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1638+ * this method
1639+ * @since 1.2
1640+ */
1641+ void updateDouble(int columnIndex, double x) throws SQLException;
1642+
1643+ /**
1644+ * Updates the designated column with a <code>java.math.BigDecimal</code>
1645+ * value.
1646+ * The updater methods are used to update column values in the
1647+ * current row or the insert row. The updater methods do not
1648+ * update the underlying database; instead the <code>updateRow</code> or
1649+ * <code>insertRow</code> methods are called to update the database.
1650+ *
1651+ * @param columnIndex the first column is 1, the second is 2, ...
1652+ * @param x the new column value
1653+ * @exception SQLException if the columnIndex is not valid;
1654+ * if a database access error occurs;
1655+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1656+ * or this method is called on a closed result set
1657+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1658+ * this method
1659+ * @since 1.2
1660+ */
1661+ void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException;
1662+
1663+ /**
1664+ * Updates the designated column with a <code>String</code> value.
1665+ * The updater methods are used to update column values in the
1666+ * current row or the insert row. The updater methods do not
1667+ * update the underlying database; instead the <code>updateRow</code> or
1668+ * <code>insertRow</code> methods are called to update the database.
1669+ *
1670+ * @param columnIndex the first column is 1, the second is 2, ...
1671+ * @param x the new column value
1672+ * @exception SQLException if the columnIndex is not valid;
1673+ * if a database access error occurs;
1674+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1675+ * or this method is called on a closed result set
1676+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1677+ * this method
1678+ * @since 1.2
1679+ */
1680+ void updateString(int columnIndex, String x) throws SQLException;
1681+
1682+ /**
1683+ * Updates the designated column with a <code>byte</code> array value.
1684+ * The updater methods are used to update column values in the
1685+ * current row or the insert row. The updater methods do not
1686+ * update the underlying database; instead the <code>updateRow</code> or
1687+ * <code>insertRow</code> methods are called to update the database.
1688+ *
1689+ * @param columnIndex the first column is 1, the second is 2, ...
1690+ * @param x the new column value
1691+ * @exception SQLException if the columnIndex is not valid;
1692+ * if a database access error occurs;
1693+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1694+ * or this method is called on a closed result set
1695+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1696+ * this method
1697+ * @since 1.2
1698+ */
1699+ void updateBytes(int columnIndex, byte x[]) throws SQLException;
1700+
1701+ /**
1702+ * Updates the designated column with a <code>java.sql.Date</code> value.
1703+ * The updater methods are used to update column values in the
1704+ * current row or the insert row. The updater methods do not
1705+ * update the underlying database; instead the <code>updateRow</code> or
1706+ * <code>insertRow</code> methods are called to update the database.
1707+ *
1708+ * @param columnIndex the first column is 1, the second is 2, ...
1709+ * @param x the new column value
1710+ * @exception SQLException if the columnIndex is not valid;
1711+ * if a database access error occurs;
1712+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1713+ * or this method is called on a closed result set
1714+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1715+ * this method
1716+ * @since 1.2
1717+ */
1718+ void updateDate(int columnIndex, java.sql.Date x) throws SQLException;
1719+
1720+ /**
1721+ * Updates the designated column with a <code>java.sql.Time</code> value.
1722+ * The updater methods are used to update column values in the
1723+ * current row or the insert row. The updater methods do not
1724+ * update the underlying database; instead the <code>updateRow</code> or
1725+ * <code>insertRow</code> methods are called to update the database.
1726+ *
1727+ * @param columnIndex the first column is 1, the second is 2, ...
1728+ * @param x the new column value
1729+ * @exception SQLException if the columnIndex is not valid;
1730+ * if a database access error occurs;
1731+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1732+ * or this method is called on a closed result set
1733+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1734+ * this method
1735+ * @since 1.2
1736+ */
1737+ void updateTime(int columnIndex, java.sql.Time x) throws SQLException;
1738+
1739+ /**
1740+ * Updates the designated column with a <code>java.sql.Timestamp</code>
1741+ * value.
1742+ * The updater methods are used to update column values in the
1743+ * current row or the insert row. The updater methods do not
1744+ * update the underlying database; instead the <code>updateRow</code> or
1745+ * <code>insertRow</code> methods are called to update the database.
1746+ *
1747+ * @param columnIndex the first column is 1, the second is 2, ...
1748+ * @param x the new column value
1749+ * @exception SQLException if the columnIndex is not valid;
1750+ * if a database access error occurs;
1751+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1752+ * or this method is called on a closed result set
1753+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1754+ * this method
1755+ * @since 1.2
1756+ */
1757+ void updateTimestamp(int columnIndex, java.sql.Timestamp x)
1758+ throws SQLException;
1759+
1760+ /**
1761+ * Updates the designated column with an ascii stream value, which will have
1762+ * the specified number of bytes.
1763+ * The updater methods are used to update column values in the
1764+ * current row or the insert row. The updater methods do not
1765+ * update the underlying database; instead the <code>updateRow</code> or
1766+ * <code>insertRow</code> methods are called to update the database.
1767+ *
1768+ * @param columnIndex the first column is 1, the second is 2, ...
1769+ * @param x the new column value
1770+ * @param length the length of the stream
1771+ * @exception SQLException if the columnIndex is not valid;
1772+ * if a database access error occurs;
1773+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1774+ * or this method is called on a closed result set
1775+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1776+ * this method
1777+ * @since 1.2
1778+ */
1779+ void updateAsciiStream(int columnIndex,
1780+ java.io.InputStream x,
1781+ int length) throws SQLException;
1782+
1783+ /**
1784+ * Updates the designated column with a binary stream value, which will have
1785+ * the specified number of bytes.
1786+ * The updater methods are used to update column values in the
1787+ * current row or the insert row. The updater methods do not
1788+ * update the underlying database; instead the <code>updateRow</code> or
1789+ * <code>insertRow</code> methods are called to update the database.
1790+ *
1791+ * @param columnIndex the first column is 1, the second is 2, ...
1792+ * @param x the new column value
1793+ * @param length the length of the stream
1794+ * @exception SQLException if the columnIndex is not valid;
1795+ * if a database access error occurs;
1796+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1797+ * or this method is called on a closed result set
1798+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1799+ * this method
1800+ * @since 1.2
1801+ */
1802+ void updateBinaryStream(int columnIndex,
1803+ java.io.InputStream x,
1804+ int length) throws SQLException;
1805+
1806+ /**
1807+ * Updates the designated column with a character stream value, which will have
1808+ * the specified number of bytes.
1809+ * The updater methods are used to update column values in the
1810+ * current row or the insert row. The updater methods do not
1811+ * update the underlying database; instead the <code>updateRow</code> or
1812+ * <code>insertRow</code> methods are called to update the database.
1813+ *
1814+ * @param columnIndex the first column is 1, the second is 2, ...
1815+ * @param x the new column value
1816+ * @param length the length of the stream
1817+ * @exception SQLException if the columnIndex is not valid;
1818+ * if a database access error occurs;
1819+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1820+ * or this method is called on a closed result set
1821+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1822+ * this method
1823+ * @since 1.2
1824+ */
1825+ void updateCharacterStream(int columnIndex,
1826+ java.io.Reader x,
1827+ int length) throws SQLException;
1828+
1829+ /**
1830+ * Updates the designated column with an <code>Object</code> value.
1831+ * The updater methods are used to update column values in the
1832+ * current row or the insert row. The updater methods do not
1833+ * update the underlying database; instead the <code>updateRow</code> or
1834+ * <code>insertRow</code> methods are called to update the database.
1835+ *<p>
1836+ * If the second argument is an <code>InputStream</code> then the stream must contain
1837+ * the number of bytes specified by scaleOrLength. If the second argument is a
1838+ * <code>Reader</code> then the reader must contain the number of characters specified
1839+ * by scaleOrLength. If these conditions are not true the driver will generate a
1840+ * <code>SQLException</code> when the statement is executed.
1841+ *
1842+ * @param columnIndex the first column is 1, the second is 2, ...
1843+ * @param x the new column value
1844+ * @param scaleOrLength for an object of <code>java.math.BigDecimal</code> ,
1845+ * this is the number of digits after the decimal point. For
1846+ * Java Object types <code>InputStream</code> and <code>Reader</code>,
1847+ * this is the length
1848+ * of the data in the stream or reader. For all other types,
1849+ * this value will be ignored.
1850+ * @exception SQLException if the columnIndex is not valid;
1851+ * if a database access error occurs;
1852+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1853+ * or this method is called on a closed result set
1854+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1855+ * this method
1856+ * @since 1.2
1857+ */
1858+ void updateObject(int columnIndex, Object x, int scaleOrLength)
1859+ throws SQLException;
1860+
1861+ /**
1862+ * Updates the designated column with an <code>Object</code> value.
1863+ * The updater methods are used to update column values in the
1864+ * current row or the insert row. The updater methods do not
1865+ * update the underlying database; instead the <code>updateRow</code> or
1866+ * <code>insertRow</code> methods are called to update the database.
1867+ *
1868+ * @param columnIndex the first column is 1, the second is 2, ...
1869+ * @param x the new column value
1870+ * @exception SQLException if the columnIndex is not valid;
1871+ * if a database access error occurs;
1872+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1873+ * or this method is called on a closed result set
1874+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1875+ * this method
1876+ * @since 1.2
1877+ */
1878+ void updateObject(int columnIndex, Object x) throws SQLException;
1879+
1880+ /**
1881+ * Updates the designated column with a <code>null</code> value.
1882+ * The updater methods are used to update column values in the
1883+ * current row or the insert row. The updater methods do not
1884+ * update the underlying database; instead the <code>updateRow</code> or
1885+ * <code>insertRow</code> methods are called to update the database.
1886+ *
1887+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1888+ * @exception SQLException if the columnLabel is not valid;
1889+ * if a database access error occurs;
1890+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1891+ * or this method is called on a closed result set
1892+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1893+ * this method
1894+ * @since 1.2
1895+ */
1896+ void updateNull(String columnLabel) throws SQLException;
1897+
1898+ /**
1899+ * Updates the designated column with a <code>boolean</code> value.
1900+ * The updater methods are used to update column values in the
1901+ * current row or the insert row. The updater methods do not
1902+ * update the underlying database; instead the <code>updateRow</code> or
1903+ * <code>insertRow</code> methods are called to update the database.
1904+ *
1905+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1906+ * @param x the new column value
1907+ * @exception SQLException if the columnLabel is not valid;
1908+ * if a database access error occurs;
1909+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1910+ * or this method is called on a closed result set
1911+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1912+ * this method
1913+ * @since 1.2
1914+ */
1915+ void updateBoolean(String columnLabel, boolean x) throws SQLException;
1916+
1917+ /**
1918+ * Updates the designated column with a <code>byte</code> value.
1919+ * The updater methods are used to update column values in the
1920+ * current row or the insert row. The updater methods do not
1921+ * update the underlying database; instead the <code>updateRow</code> or
1922+ * <code>insertRow</code> methods are called to update the database.
1923+ *
1924+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1925+ * @param x the new column value
1926+ * @exception SQLException if the columnLabel is not valid;
1927+ * if a database access error occurs;
1928+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1929+ * or this method is called on a closed result set
1930+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1931+ * this method
1932+ * @since 1.2
1933+ */
1934+ void updateByte(String columnLabel, byte x) throws SQLException;
1935+
1936+ /**
1937+ * Updates the designated column with a <code>short</code> value.
1938+ * The updater methods are used to update column values in the
1939+ * current row or the insert row. The updater methods do not
1940+ * update the underlying database; instead the <code>updateRow</code> or
1941+ * <code>insertRow</code> methods are called to update the database.
1942+ *
1943+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1944+ * @param x the new column value
1945+ * @exception SQLException if the columnLabel is not valid;
1946+ * if a database access error occurs;
1947+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1948+ * or this method is called on a closed result set
1949+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1950+ * this method
1951+ * @since 1.2
1952+ */
1953+ void updateShort(String columnLabel, short x) throws SQLException;
1954+
1955+ /**
1956+ * Updates the designated column with an <code>int</code> value.
1957+ * The updater methods are used to update column values in the
1958+ * current row or the insert row. The updater methods do not
1959+ * update the underlying database; instead the <code>updateRow</code> or
1960+ * <code>insertRow</code> methods are called to update the database.
1961+ *
1962+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1963+ * @param x the new column value
1964+ * @exception SQLException if the columnLabel is not valid;
1965+ * if a database access error occurs;
1966+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1967+ * or this method is called on a closed result set
1968+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1969+ * this method
1970+ * @since 1.2
1971+ */
1972+ void updateInt(String columnLabel, int x) throws SQLException;
1973+
1974+ /**
1975+ * Updates the designated column with a <code>long</code> value.
1976+ * The updater methods are used to update column values in the
1977+ * current row or the insert row. The updater methods do not
1978+ * update the underlying database; instead the <code>updateRow</code> or
1979+ * <code>insertRow</code> methods are called to update the database.
1980+ *
1981+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
1982+ * @param x the new column value
1983+ * @exception SQLException if the columnLabel is not valid;
1984+ * if a database access error occurs;
1985+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
1986+ * or this method is called on a closed result set
1987+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
1988+ * this method
1989+ * @since 1.2
1990+ */
1991+ void updateLong(String columnLabel, long x) throws SQLException;
1992+
1993+ /**
1994+ * Updates the designated column with a <code>float </code> value.
1995+ * The updater methods are used to update column values in the
1996+ * current row or the insert row. The updater methods do not
1997+ * update the underlying database; instead the <code>updateRow</code> or
1998+ * <code>insertRow</code> methods are called to update the database.
1999+ *
2000+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2001+ * @param x the new column value
2002+ * @exception SQLException if the columnLabel is not valid;
2003+ * if a database access error occurs;
2004+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2005+ * or this method is called on a closed result set
2006+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2007+ * this method
2008+ * @since 1.2
2009+ */
2010+ void updateFloat(String columnLabel, float x) throws SQLException;
2011+
2012+ /**
2013+ * Updates the designated column with a <code>double</code> value.
2014+ * The updater methods are used to update column values in the
2015+ * current row or the insert row. The updater methods do not
2016+ * update the underlying database; instead the <code>updateRow</code> or
2017+ * <code>insertRow</code> methods are called to update the database.
2018+ *
2019+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2020+ * @param x the new column value
2021+ * @exception SQLException if the columnLabel is not valid;
2022+ * if a database access error occurs;
2023+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2024+ * or this method is called on a closed result set
2025+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2026+ * this method
2027+ * @since 1.2
2028+ */
2029+ void updateDouble(String columnLabel, double x) throws SQLException;
2030+
2031+ /**
2032+ * Updates the designated column with a <code>java.sql.BigDecimal</code>
2033+ * value.
2034+ * The updater methods are used to update column values in the
2035+ * current row or the insert row. The updater methods do not
2036+ * update the underlying database; instead the <code>updateRow</code> or
2037+ * <code>insertRow</code> methods are called to update the database.
2038+ *
2039+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2040+ * @param x the new column value
2041+ * @exception SQLException if the columnLabel is not valid;
2042+ * if a database access error occurs;
2043+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2044+ * or this method is called on a closed result set
2045+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2046+ * this method
2047+ * @since 1.2
2048+ */
2049+ void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException;
2050+
2051+ /**
2052+ * Updates the designated column with a <code>String</code> value.
2053+ * The updater methods are used to update column values in the
2054+ * current row or the insert row. The updater methods do not
2055+ * update the underlying database; instead the <code>updateRow</code> or
2056+ * <code>insertRow</code> methods are called to update the database.
2057+ *
2058+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2059+ * @param x the new column value
2060+ * @exception SQLException if the columnLabel is not valid;
2061+ * if a database access error occurs;
2062+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2063+ * or this method is called on a closed result set
2064+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2065+ * this method
2066+ * @since 1.2
2067+ */
2068+ void updateString(String columnLabel, String x) throws SQLException;
2069+
2070+ /**
2071+ * Updates the designated column with a byte array value.
2072+ *
2073+ * The updater methods are used to update column values in the
2074+ * current row or the insert row. The updater methods do not
2075+ * update the underlying database; instead the <code>updateRow</code>
2076+ * or <code>insertRow</code> methods are called to update the database.
2077+ *
2078+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2079+ * @param x the new column value
2080+ * @exception SQLException if the columnLabel is not valid;
2081+ * if a database access error occurs;
2082+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2083+ * or this method is called on a closed result set
2084+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2085+ * this method
2086+ * @since 1.2
2087+ */
2088+ void updateBytes(String columnLabel, byte x[]) throws SQLException;
2089+
2090+ /**
2091+ * Updates the designated column with a <code>java.sql.Date</code> value.
2092+ * The updater methods are used to update column values in the
2093+ * current row or the insert row. The updater methods do not
2094+ * update the underlying database; instead the <code>updateRow</code> or
2095+ * <code>insertRow</code> methods are called to update the database.
2096+ *
2097+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2098+ * @param x the new column value
2099+ * @exception SQLException if the columnLabel is not valid;
2100+ * if a database access error occurs;
2101+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2102+ * or this method is called on a closed result set
2103+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2104+ * this method
2105+ * @since 1.2
2106+ */
2107+ void updateDate(String columnLabel, java.sql.Date x) throws SQLException;
2108+
2109+ /**
2110+ * Updates the designated column with a <code>java.sql.Time</code> value.
2111+ * The updater methods are used to update column values in the
2112+ * current row or the insert row. The updater methods do not
2113+ * update the underlying database; instead the <code>updateRow</code> or
2114+ * <code>insertRow</code> methods are called to update the database.
2115+ *
2116+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2117+ * @param x the new column value
2118+ * @exception SQLException if the columnLabel is not valid;
2119+ * if a database access error occurs;
2120+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2121+ * or this method is called on a closed result set
2122+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2123+ * this method
2124+ * @since 1.2
2125+ */
2126+ void updateTime(String columnLabel, java.sql.Time x) throws SQLException;
2127+
2128+ /**
2129+ * Updates the designated column with a <code>java.sql.Timestamp</code>
2130+ * value.
2131+ * The updater methods are used to update column values in the
2132+ * current row or the insert row. The updater methods do not
2133+ * update the underlying database; instead the <code>updateRow</code> or
2134+ * <code>insertRow</code> methods are called to update the database.
2135+ *
2136+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2137+ * @param x the new column value
2138+ * @exception SQLException if the columnLabel is not valid;
2139+ * if a database access error occurs;
2140+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2141+ * or this method is called on a closed result set
2142+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2143+ * this method
2144+ * @since 1.2
2145+ */
2146+ void updateTimestamp(String columnLabel, java.sql.Timestamp x)
2147+ throws SQLException;
2148+
2149+ /**
2150+ * Updates the designated column with an ascii stream value, which will have
2151+ * the specified number of bytes.
2152+ * The updater methods are used to update column values in the
2153+ * current row or the insert row. The updater methods do not
2154+ * update the underlying database; instead the <code>updateRow</code> or
2155+ * <code>insertRow</code> methods are called to update the database.
2156+ *
2157+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2158+ * @param x the new column value
2159+ * @param length the length of the stream
2160+ * @exception SQLException if the columnLabel is not valid;
2161+ * if a database access error occurs;
2162+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2163+ * or this method is called on a closed result set
2164+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2165+ * this method
2166+ * @since 1.2
2167+ */
2168+ void updateAsciiStream(String columnLabel,
2169+ java.io.InputStream x,
2170+ int length) throws SQLException;
2171+
2172+ /**
2173+ * Updates the designated column with a binary stream value, which will have
2174+ * the specified number of bytes.
2175+ * The updater methods are used to update column values in the
2176+ * current row or the insert row. The updater methods do not
2177+ * update the underlying database; instead the <code>updateRow</code> or
2178+ * <code>insertRow</code> methods are called to update the database.
2179+ *
2180+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2181+ * @param x the new column value
2182+ * @param length the length of the stream
2183+ * @exception SQLException if the columnLabel is not valid;
2184+ * if a database access error occurs;
2185+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2186+ * or this method is called on a closed result set
2187+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2188+ * this method
2189+ * @since 1.2
2190+ */
2191+ void updateBinaryStream(String columnLabel,
2192+ java.io.InputStream x,
2193+ int length) throws SQLException;
2194+
2195+ /**
2196+ * Updates the designated column with a character stream value, which will have
2197+ * the specified number of bytes.
2198+ * The updater methods are used to update column values in the
2199+ * current row or the insert row. The updater methods do not
2200+ * update the underlying database; instead the <code>updateRow</code> or
2201+ * <code>insertRow</code> methods are called to update the database.
2202+ *
2203+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2204+ * @param reader the <code>java.io.Reader</code> object containing
2205+ * the new column value
2206+ * @param length the length of the stream
2207+ * @exception SQLException if the columnLabel is not valid;
2208+ * if a database access error occurs;
2209+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2210+ * or this method is called on a closed result set
2211+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2212+ * this method
2213+ * @since 1.2
2214+ */
2215+ void updateCharacterStream(String columnLabel,
2216+ java.io.Reader reader,
2217+ int length) throws SQLException;
2218+
2219+ /**
2220+ * Updates the designated column with an <code>Object</code> value.
2221+ * The updater methods are used to update column values in the
2222+ * current row or the insert row. The updater methods do not
2223+ * update the underlying database; instead the <code>updateRow</code> or
2224+ * <code>insertRow</code> methods are called to update the database.
2225+ *<p>
2226+ * If the second argument is an <code>InputStream</code> then the stream must contain
2227+ * the number of bytes specified by scaleOrLength. If the second argument is a
2228+ * <code>Reader</code> then the reader must contain the number of characters specified
2229+ * by scaleOrLength. If these conditions are not true the driver will generate a
2230+ * <code>SQLException</code> when the statement is executed.
2231+ *
2232+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2233+ * @param x the new column value
2234+ * @param scaleOrLength for an object of <code>java.math.BigDecimal</code> ,
2235+ * this is the number of digits after the decimal point. For
2236+ * Java Object types <code>InputStream</code> and <code>Reader</code>,
2237+ * this is the length
2238+ * of the data in the stream or reader. For all other types,
2239+ * this value will be ignored.
2240+ * @exception SQLException if the columnLabel is not valid;
2241+ * if a database access error occurs;
2242+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2243+ * or this method is called on a closed result set
2244+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2245+ * this method
2246+ * @since 1.2
2247+ */
2248+ void updateObject(String columnLabel, Object x, int scaleOrLength)
2249+ throws SQLException;
2250+
2251+ /**
2252+ * Updates the designated column with an <code>Object</code> value.
2253+ * The updater methods are used to update column values in the
2254+ * current row or the insert row. The updater methods do not
2255+ * update the underlying database; instead the <code>updateRow</code> or
2256+ * <code>insertRow</code> methods are called to update the database.
2257+ *
2258+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2259+ * @param x the new column value
2260+ * @exception SQLException if the columnLabel is not valid;
2261+ * if a database access error occurs;
2262+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2263+ * or this method is called on a closed result set
2264+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2265+ * this method
2266+ * @since 1.2
2267+ */
2268+ void updateObject(String columnLabel, Object x) throws SQLException;
2269+
2270+ /**
2271+ * Inserts the contents of the insert row into this
2272+ * <code>ResultSet</code> object and into the database.
2273+ * The cursor must be on the insert row when this method is called.
2274+ *
2275+ * @exception SQLException if a database access error occurs;
2276+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>,
2277+ * this method is called on a closed result set,
2278+ * if this method is called when the cursor is not on the insert row,
2279+ * or if not all of non-nullable columns in
2280+ * the insert row have been given a non-null value
2281+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2282+ * this method
2283+ * @since 1.2
2284+ */
2285+ void insertRow() throws SQLException;
2286+
2287+ /**
2288+ * Updates the underlying database with the new contents of the
2289+ * current row of this <code>ResultSet</code> object.
2290+ * This method cannot be called when the cursor is on the insert row.
2291+ *
2292+ * @exception SQLException if a database access error occurs;
2293+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>;
2294+ * this method is called on a closed result set or
2295+ * if this method is called when the cursor is on the insert row
2296+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2297+ * this method
2298+ * @since 1.2
2299+ */
2300+ void updateRow() throws SQLException;
2301+
2302+ /**
2303+ * Deletes the current row from this <code>ResultSet</code> object
2304+ * and from the underlying database. This method cannot be called when
2305+ * the cursor is on the insert row.
2306+ *
2307+ * @exception SQLException if a database access error occurs;
2308+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>;
2309+ * this method is called on a closed result set
2310+ * or if this method is called when the cursor is on the insert row
2311+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2312+ * this method
2313+ * @since 1.2
2314+ */
2315+ void deleteRow() throws SQLException;
2316+
2317+ /**
2318+ * Refreshes the current row with its most recent value in
2319+ * the database. This method cannot be called when
2320+ * the cursor is on the insert row.
2321+ *
2322+ * <P>The <code>refreshRow</code> method provides a way for an
2323+ * application to
2324+ * explicitly tell the JDBC driver to refetch a row(s) from the
2325+ * database. An application may want to call <code>refreshRow</code> when
2326+ * caching or prefetching is being done by the JDBC driver to
2327+ * fetch the latest value of a row from the database. The JDBC driver
2328+ * may actually refresh multiple rows at once if the fetch size is
2329+ * greater than one.
2330+ *
2331+ * <P> All values are refetched subject to the transaction isolation
2332+ * level and cursor sensitivity. If <code>refreshRow</code> is called after
2333+ * calling an updater method, but before calling
2334+ * the method <code>updateRow</code>, then the
2335+ * updates made to the row are lost. Calling the method
2336+ * <code>refreshRow</code> frequently will likely slow performance.
2337+ *
2338+ * @exception SQLException if a database access error
2339+ * occurs; this method is called on a closed result set;
2340+ * the result set type is <code>TYPE_FORWARD_ONLY</code> or if this
2341+ * method is called when the cursor is on the insert row
2342+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2343+ * this method or this method is not supported for the specified result
2344+ * set type and result set concurrency.
2345+ * @since 1.2
2346+ */
2347+ void refreshRow() throws SQLException;
2348+
2349+ /**
2350+ * Cancels the updates made to the current row in this
2351+ * <code>ResultSet</code> object.
2352+ * This method may be called after calling an
2353+ * updater method(s) and before calling
2354+ * the method <code>updateRow</code> to roll back
2355+ * the updates made to a row. If no updates have been made or
2356+ * <code>updateRow</code> has already been called, this method has no
2357+ * effect.
2358+ *
2359+ * @exception SQLException if a database access error
2360+ * occurs; this method is called on a closed result set;
2361+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2362+ * or if this method is called when the cursor is
2363+ * on the insert row
2364+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2365+ * this method
2366+ * @since 1.2
2367+ */
2368+ void cancelRowUpdates() throws SQLException;
2369+
2370+ /**
2371+ * Moves the cursor to the insert row. The current cursor position is
2372+ * remembered while the cursor is positioned on the insert row.
2373+ *
2374+ * The insert row is a special row associated with an updatable
2375+ * result set. It is essentially a buffer where a new row may
2376+ * be constructed by calling the updater methods prior to
2377+ * inserting the row into the result set.
2378+ *
2379+ * Only the updater, getter,
2380+ * and <code>insertRow</code> methods may be
2381+ * called when the cursor is on the insert row. All of the columns in
2382+ * a result set must be given a value each time this method is
2383+ * called before calling <code>insertRow</code>.
2384+ * An updater method must be called before a
2385+ * getter method can be called on a column value.
2386+ *
2387+ * @exception SQLException if a database access error occurs; this
2388+ * method is called on a closed result set
2389+ * or the result set concurrency is <code>CONCUR_READ_ONLY</code>
2390+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2391+ * this method
2392+ * @since 1.2
2393+ */
2394+ void moveToInsertRow() throws SQLException;
2395+
2396+ /**
2397+ * Moves the cursor to the remembered cursor position, usually the
2398+ * current row. This method has no effect if the cursor is not on
2399+ * the insert row.
2400+ *
2401+ * @exception SQLException if a database access error occurs; this
2402+ * method is called on a closed result set
2403+ * or the result set concurrency is <code>CONCUR_READ_ONLY</code>
2404+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2405+ * this method
2406+ * @since 1.2
2407+ */
2408+ void moveToCurrentRow() throws SQLException;
2409+
2410+ /**
2411+ * Retrieves the <code>Statement</code> object that produced this
2412+ * <code>ResultSet</code> object.
2413+ * If the result set was generated some other way, such as by a
2414+ * <code>DatabaseMetaData</code> method, this method may return
2415+ * <code>null</code>.
2416+ *
2417+ * @return the <code>Statment</code> object that produced
2418+ * this <code>ResultSet</code> object or <code>null</code>
2419+ * if the result set was produced some other way
2420+ * @exception SQLException if a database access error occurs
2421+ * or this method is called on a closed result set
2422+ * @since 1.2
2423+ */
2424+ Statement getStatement() throws SQLException;
2425+
2426+ /**
2427+ * Retrieves the value of the designated column in the current row
2428+ * of this <code>ResultSet</code> object as an <code>Object</code>
2429+ * in the Java programming language.
2430+ * If the value is an SQL <code>NULL</code>,
2431+ * the driver returns a Java <code>null</code>.
2432+ * This method uses the given <code>Map</code> object
2433+ * for the custom mapping of the
2434+ * SQL structured or distinct type that is being retrieved.
2435+ *
2436+ * @param columnIndex the first column is 1, the second is 2, ...
2437+ * @param map a <code>java.util.Map</code> object that contains the mapping
2438+ * from SQL type names to classes in the Java programming language
2439+ * @return an <code>Object</code> in the Java programming language
2440+ * representing the SQL value
2441+ * @exception SQLException if the columnIndex is not valid;
2442+ * if a database access error occurs
2443+ * or this method is called on a closed result set
2444+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2445+ * this method
2446+ * @since 1.2
2447+ */
2448+ Object getObject(int columnIndex, java.util.Map<String,Class<?>> map)
2449+ throws SQLException;
2450+
2451+ /**
2452+ * Retrieves the value of the designated column in the current row
2453+ * of this <code>ResultSet</code> object as a <code>Ref</code> object
2454+ * in the Java programming language.
2455+ *
2456+ * @param columnIndex the first column is 1, the second is 2, ...
2457+ * @return a <code>Ref</code> object representing an SQL <code>REF</code>
2458+ * value
2459+ * @exception SQLException if the columnIndex is not valid;
2460+ * if a database access error occurs
2461+ * or this method is called on a closed result set
2462+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2463+ * this method
2464+ * @since 1.2
2465+ */
2466+ Ref getRef(int columnIndex) throws SQLException;
2467+
2468+ /**
2469+ * Retrieves the value of the designated column in the current row
2470+ * of this <code>ResultSet</code> object as a <code>Blob</code> object
2471+ * in the Java programming language.
2472+ *
2473+ * @param columnIndex the first column is 1, the second is 2, ...
2474+ * @return a <code>Blob</code> object representing the SQL
2475+ * <code>BLOB</code> value in the specified column
2476+ * @exception SQLException if the columnIndex is not valid;
2477+ * if a database access error occurs
2478+ * or this method is called on a closed result set
2479+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2480+ * this method
2481+ * @since 1.2
2482+ */
2483+ Blob getBlob(int columnIndex) throws SQLException;
2484+
2485+ /**
2486+ * Retrieves the value of the designated column in the current row
2487+ * of this <code>ResultSet</code> object as a <code>Clob</code> object
2488+ * in the Java programming language.
2489+ *
2490+ * @param columnIndex the first column is 1, the second is 2, ...
2491+ * @return a <code>Clob</code> object representing the SQL
2492+ * <code>CLOB</code> value in the specified column
2493+ * @exception SQLException if the columnIndex is not valid;
2494+ * if a database access error occurs
2495+ * or this method is called on a closed result set
2496+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2497+ * this method
2498+ * @since 1.2
2499+ */
2500+ Clob getClob(int columnIndex) throws SQLException;
2501+
2502+ /**
2503+ * Retrieves the value of the designated column in the current row
2504+ * of this <code>ResultSet</code> object as an <code>Array</code> object
2505+ * in the Java programming language.
2506+ *
2507+ * @param columnIndex the first column is 1, the second is 2, ...
2508+ * @return an <code>Array</code> object representing the SQL
2509+ * <code>ARRAY</code> value in the specified column
2510+ * @exception SQLException if the columnIndex is not valid;
2511+ * if a database access error occurs
2512+ * or this method is called on a closed result set
2513+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2514+ * this method
2515+ * @since 1.2
2516+ */
2517+ Array getArray(int columnIndex) throws SQLException;
2518+
2519+ /**
2520+ * Retrieves the value of the designated column in the current row
2521+ * of this <code>ResultSet</code> object as an <code>Object</code>
2522+ * in the Java programming language.
2523+ * If the value is an SQL <code>NULL</code>,
2524+ * the driver returns a Java <code>null</code>.
2525+ * This method uses the specified <code>Map</code> object for
2526+ * custom mapping if appropriate.
2527+ *
2528+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2529+ * @param map a <code>java.util.Map</code> object that contains the mapping
2530+ * from SQL type names to classes in the Java programming language
2531+ * @return an <code>Object</code> representing the SQL value in the
2532+ * specified column
2533+ * @exception SQLException if the columnLabel is not valid;
2534+ * if a database access error occurs
2535+ * or this method is called on a closed result set
2536+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2537+ * this method
2538+ * @since 1.2
2539+ */
2540+ Object getObject(String columnLabel, java.util.Map<String,Class<?>> map)
2541+ throws SQLException;
2542+
2543+ /**
2544+ * Retrieves the value of the designated column in the current row
2545+ * of this <code>ResultSet</code> object as a <code>Ref</code> object
2546+ * in the Java programming language.
2547+ *
2548+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2549+ * @return a <code>Ref</code> object representing the SQL <code>REF</code>
2550+ * value in the specified column
2551+ * @exception SQLException if the columnLabel is not valid;
2552+ * if a database access error occurs
2553+ * or this method is called on a closed result set
2554+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2555+ * this method
2556+ * @since 1.2
2557+ */
2558+ Ref getRef(String columnLabel) throws SQLException;
2559+
2560+ /**
2561+ * Retrieves the value of the designated column in the current row
2562+ * of this <code>ResultSet</code> object as a <code>Blob</code> object
2563+ * in the Java programming language.
2564+ *
2565+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2566+ * @return a <code>Blob</code> object representing the SQL <code>BLOB</code>
2567+ * value in the specified column
2568+ * @exception SQLException if the columnLabel is not valid;
2569+ * if a database access error occurs
2570+ * or this method is called on a closed result set
2571+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2572+ * this method
2573+ * @since 1.2
2574+ */
2575+ Blob getBlob(String columnLabel) throws SQLException;
2576+
2577+ /**
2578+ * Retrieves the value of the designated column in the current row
2579+ * of this <code>ResultSet</code> object as a <code>Clob</code> object
2580+ * in the Java programming language.
2581+ *
2582+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2583+ * @return a <code>Clob</code> object representing the SQL <code>CLOB</code>
2584+ * value in the specified column
2585+ * @exception SQLException if the columnLabel is not valid;
2586+ * if a database access error occurs
2587+ * or this method is called on a closed result set
2588+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2589+ * this method
2590+ * @since 1.2
2591+ */
2592+ Clob getClob(String columnLabel) throws SQLException;
2593+
2594+ /**
2595+ * Retrieves the value of the designated column in the current row
2596+ * of this <code>ResultSet</code> object as an <code>Array</code> object
2597+ * in the Java programming language.
2598+ *
2599+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2600+ * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> value in
2601+ * the specified column
2602+ * @exception SQLException if the columnLabel is not valid;
2603+ * if a database access error occurs
2604+ * or this method is called on a closed result set
2605+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2606+ * this method
2607+ * @since 1.2
2608+ */
2609+ Array getArray(String columnLabel) throws SQLException;
2610+
2611+ /**
2612+ * Retrieves the value of the designated column in the current row
2613+ * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
2614+ * in the Java programming language.
2615+ * This method uses the given calendar to construct an appropriate millisecond
2616+ * value for the date if the underlying database does not store
2617+ * timezone information.
2618+ *
2619+ * @param columnIndex the first column is 1, the second is 2, ...
2620+ * @param cal the <code>java.util.Calendar</code> object
2621+ * to use in constructing the date
2622+ * @return the column value as a <code>java.sql.Date</code> object;
2623+ * if the value is SQL <code>NULL</code>,
2624+ * the value returned is <code>null</code> in the Java programming language
2625+ * @exception SQLException if the columnIndex is not valid;
2626+ * if a database access error occurs
2627+ * or this method is called on a closed result set
2628+ * @since 1.2
2629+ */
2630+ java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException;
2631+
2632+ /**
2633+ * Retrieves the value of the designated column in the current row
2634+ * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
2635+ * in the Java programming language.
2636+ * This method uses the given calendar to construct an appropriate millisecond
2637+ * value for the date if the underlying database does not store
2638+ * timezone information.
2639+ *
2640+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2641+ * @param cal the <code>java.util.Calendar</code> object
2642+ * to use in constructing the date
2643+ * @return the column value as a <code>java.sql.Date</code> object;
2644+ * if the value is SQL <code>NULL</code>,
2645+ * the value returned is <code>null</code> in the Java programming language
2646+ * @exception SQLException if the columnLabel is not valid;
2647+ * if a database access error occurs
2648+ * or this method is called on a closed result set
2649+ * @since 1.2
2650+ */
2651+ java.sql.Date getDate(String columnLabel, Calendar cal) throws SQLException;
2652+
2653+ /**
2654+ * Retrieves the value of the designated column in the current row
2655+ * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object
2656+ * in the Java programming language.
2657+ * This method uses the given calendar to construct an appropriate millisecond
2658+ * value for the time if the underlying database does not store
2659+ * timezone information.
2660+ *
2661+ * @param columnIndex the first column is 1, the second is 2, ...
2662+ * @param cal the <code>java.util.Calendar</code> object
2663+ * to use in constructing the time
2664+ * @return the column value as a <code>java.sql.Time</code> object;
2665+ * if the value is SQL <code>NULL</code>,
2666+ * the value returned is <code>null</code> in the Java programming language
2667+ * @exception SQLException if the columnIndex is not valid;
2668+ * if a database access error occurs
2669+ * or this method is called on a closed result set
2670+ * @since 1.2
2671+ */
2672+ java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException;
2673+
2674+ /**
2675+ * Retrieves the value of the designated column in the current row
2676+ * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object
2677+ * in the Java programming language.
2678+ * This method uses the given calendar to construct an appropriate millisecond
2679+ * value for the time if the underlying database does not store
2680+ * timezone information.
2681+ *
2682+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2683+ * @param cal the <code>java.util.Calendar</code> object
2684+ * to use in constructing the time
2685+ * @return the column value as a <code>java.sql.Time</code> object;
2686+ * if the value is SQL <code>NULL</code>,
2687+ * the value returned is <code>null</code> in the Java programming language
2688+ * @exception SQLException if the columnLabel is not valid;
2689+ * if a database access error occurs
2690+ * or this method is called on a closed result set
2691+ * @since 1.2
2692+ */
2693+ java.sql.Time getTime(String columnLabel, Calendar cal) throws SQLException;
2694+
2695+ /**
2696+ * Retrieves the value of the designated column in the current row
2697+ * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object
2698+ * in the Java programming language.
2699+ * This method uses the given calendar to construct an appropriate millisecond
2700+ * value for the timestamp if the underlying database does not store
2701+ * timezone information.
2702+ *
2703+ * @param columnIndex the first column is 1, the second is 2, ...
2704+ * @param cal the <code>java.util.Calendar</code> object
2705+ * to use in constructing the timestamp
2706+ * @return the column value as a <code>java.sql.Timestamp</code> object;
2707+ * if the value is SQL <code>NULL</code>,
2708+ * the value returned is <code>null</code> in the Java programming language
2709+ * @exception SQLException if the columnIndex is not valid;
2710+ * if a database access error occurs
2711+ * or this method is called on a closed result set
2712+ * @since 1.2
2713+ */
2714+ java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal)
2715+ throws SQLException;
2716+
2717+ /**
2718+ * Retrieves the value of the designated column in the current row
2719+ * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object
2720+ * in the Java programming language.
2721+ * This method uses the given calendar to construct an appropriate millisecond
2722+ * value for the timestamp if the underlying database does not store
2723+ * timezone information.
2724+ *
2725+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2726+ * @param cal the <code>java.util.Calendar</code> object
2727+ * to use in constructing the date
2728+ * @return the column value as a <code>java.sql.Timestamp</code> object;
2729+ * if the value is SQL <code>NULL</code>,
2730+ * the value returned is <code>null</code> in the Java programming language
2731+ * @exception SQLException if the columnLabel is not valid or
2732+ * if a database access error occurs
2733+ * or this method is called on a closed result set
2734+ * @since 1.2
2735+ */
2736+ java.sql.Timestamp getTimestamp(String columnLabel, Calendar cal)
2737+ throws SQLException;
2738+
2739+ //-------------------------- JDBC 3.0 ----------------------------------------
2740+
2741+ /**
2742+ * The constant indicating that open <code>ResultSet</code> objects with this
2743+ * holdability will remain open when the current transaction is commited.
2744+ *
2745+ * @since 1.4
2746+ */
2747+ int HOLD_CURSORS_OVER_COMMIT = 1;
2748+
2749+ /**
2750+ * The constant indicating that open <code>ResultSet</code> objects with this
2751+ * holdability will be closed when the current transaction is commited.
2752+ *
2753+ * @since 1.4
2754+ */
2755+ int CLOSE_CURSORS_AT_COMMIT = 2;
2756+
2757+ /**
2758+ * Retrieves the value of the designated column in the current row
2759+ * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
2760+ * object in the Java programming language.
2761+ *
2762+ * @param columnIndex the index of the column 1 is the first, 2 is the second,...
2763+ * @return the column value as a <code>java.net.URL</code> object;
2764+ * if the value is SQL <code>NULL</code>,
2765+ * the value returned is <code>null</code> in the Java programming language
2766+ * @exception SQLException if the columnIndex is not valid;
2767+ * if a database access error occurs; this method
2768+ * is called on a closed result set or if a URL is malformed
2769+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2770+ * this method
2771+ * @since 1.4
2772+ */
2773+ java.net.URL getURL(int columnIndex) throws SQLException;
2774+
2775+ /**
2776+ * Retrieves the value of the designated column in the current row
2777+ * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
2778+ * object in the Java programming language.
2779+ *
2780+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2781+ * @return the column value as a <code>java.net.URL</code> object;
2782+ * if the value is SQL <code>NULL</code>,
2783+ * the value returned is <code>null</code> in the Java programming language
2784+ * @exception SQLException if the columnLabel is not valid;
2785+ * if a database access error occurs; this method
2786+ * is called on a closed result set or if a URL is malformed
2787+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2788+ * this method
2789+ * @since 1.4
2790+ */
2791+ java.net.URL getURL(String columnLabel) throws SQLException;
2792+
2793+ /**
2794+ * Updates the designated column with a <code>java.sql.Ref</code> value.
2795+ * The updater methods are used to update column values in the
2796+ * current row or the insert row. The updater methods do not
2797+ * update the underlying database; instead the <code>updateRow</code> or
2798+ * <code>insertRow</code> methods are called to update the database.
2799+ *
2800+ * @param columnIndex the first column is 1, the second is 2, ...
2801+ * @param x the new column value
2802+ * @exception SQLException if the columnIndex is not valid;
2803+ * if a database access error occurs;
2804+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2805+ * or this method is called on a closed result set
2806+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2807+ * this method
2808+ * @since 1.4
2809+ */
2810+ void updateRef(int columnIndex, java.sql.Ref x) throws SQLException;
2811+
2812+ /**
2813+ * Updates the designated column with a <code>java.sql.Ref</code> value.
2814+ * The updater methods are used to update column values in the
2815+ * current row or the insert row. The updater methods do not
2816+ * update the underlying database; instead the <code>updateRow</code> or
2817+ * <code>insertRow</code> methods are called to update the database.
2818+ *
2819+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2820+ * @param x the new column value
2821+ * @exception SQLException if the columnLabel is not valid;
2822+ * if a database access error occurs;
2823+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2824+ * or this method is called on a closed result set
2825+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2826+ * this method
2827+ * @since 1.4
2828+ */
2829+ void updateRef(String columnLabel, java.sql.Ref x) throws SQLException;
2830+
2831+ /**
2832+ * Updates the designated column with a <code>java.sql.Blob</code> value.
2833+ * The updater methods are used to update column values in the
2834+ * current row or the insert row. The updater methods do not
2835+ * update the underlying database; instead the <code>updateRow</code> or
2836+ * <code>insertRow</code> methods are called to update the database.
2837+ *
2838+ * @param columnIndex the first column is 1, the second is 2, ...
2839+ * @param x the new column value
2840+ * @exception SQLException if the columnIndex is not valid;
2841+ * if a database access error occurs;
2842+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2843+ * or this method is called on a closed result set
2844+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2845+ * this method
2846+ * @since 1.4
2847+ */
2848+ void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException;
2849+
2850+ /**
2851+ * Updates the designated column with a <code>java.sql.Blob</code> value.
2852+ * The updater methods are used to update column values in the
2853+ * current row or the insert row. The updater methods do not
2854+ * update the underlying database; instead the <code>updateRow</code> or
2855+ * <code>insertRow</code> methods are called to update the database.
2856+ *
2857+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2858+ * @param x the new column value
2859+ * @exception SQLException if the columnLabel is not valid;
2860+ * if a database access error occurs;
2861+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2862+ * or this method is called on a closed result set
2863+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2864+ * this method
2865+ * @since 1.4
2866+ */
2867+ void updateBlob(String columnLabel, java.sql.Blob x) throws SQLException;
2868+
2869+ /**
2870+ * Updates the designated column with a <code>java.sql.Clob</code> value.
2871+ * The updater methods are used to update column values in the
2872+ * current row or the insert row. The updater methods do not
2873+ * update the underlying database; instead the <code>updateRow</code> or
2874+ * <code>insertRow</code> methods are called to update the database.
2875+ *
2876+ * @param columnIndex the first column is 1, the second is 2, ...
2877+ * @param x the new column value
2878+ * @exception SQLException if the columnIndex is not valid;
2879+ * if a database access error occurs;
2880+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2881+ * or this method is called on a closed result set
2882+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2883+ * this method
2884+ * @since 1.4
2885+ */
2886+ void updateClob(int columnIndex, java.sql.Clob x) throws SQLException;
2887+
2888+ /**
2889+ * Updates the designated column with a <code>java.sql.Clob</code> value.
2890+ * The updater methods are used to update column values in the
2891+ * current row or the insert row. The updater methods do not
2892+ * update the underlying database; instead the <code>updateRow</code> or
2893+ * <code>insertRow</code> methods are called to update the database.
2894+ *
2895+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2896+ * @param x the new column value
2897+ * @exception SQLException if the columnLabel is not valid;
2898+ * if a database access error occurs;
2899+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2900+ * or this method is called on a closed result set
2901+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2902+ * this method
2903+ * @since 1.4
2904+ */
2905+ void updateClob(String columnLabel, java.sql.Clob x) throws SQLException;
2906+
2907+ /**
2908+ * Updates the designated column with a <code>java.sql.Array</code> value.
2909+ * The updater methods are used to update column values in the
2910+ * current row or the insert row. The updater methods do not
2911+ * update the underlying database; instead the <code>updateRow</code> or
2912+ * <code>insertRow</code> methods are called to update the database.
2913+ *
2914+ * @param columnIndex the first column is 1, the second is 2, ...
2915+ * @param x the new column value
2916+ * @exception SQLException if the columnIndex is not valid;
2917+ * if a database access error occurs;
2918+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2919+ * or this method is called on a closed result set
2920+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2921+ * this method
2922+ * @since 1.4
2923+ */
2924+ void updateArray(int columnIndex, java.sql.Array x) throws SQLException;
2925+
2926+ /**
2927+ * Updates the designated column with a <code>java.sql.Array</code> value.
2928+ * The updater methods are used to update column values in the
2929+ * current row or the insert row. The updater methods do not
2930+ * update the underlying database; instead the <code>updateRow</code> or
2931+ * <code>insertRow</code> methods are called to update the database.
2932+ *
2933+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2934+ * @param x the new column value
2935+ * @exception SQLException if the columnLabel is not valid;
2936+ * if a database access error occurs;
2937+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2938+ * or this method is called on a closed result set
2939+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2940+ * this method
2941+ * @since 1.4
2942+ */
2943+ void updateArray(String columnLabel, java.sql.Array x) throws SQLException;
2944+
2945+ //------------------------- JDBC 4.0 -----------------------------------
2946+
2947+ /**
2948+ * Retrieves the value of the designated column in the current row of this
2949+ * <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java
2950+ * programming language.
2951+ *
2952+ * @param columnIndex the first column is 1, the second 2, ...
2953+ * @return the column value; if the value is a SQL <code>NULL</code> the
2954+ * value returned is <code>null</code>
2955+ * @throws SQLException if the columnIndex is not valid;
2956+ * if a database access error occurs
2957+ * or this method is called on a closed result set
2958+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2959+ * this method
2960+ * @since 1.6
2961+ */
2962+ RowId getRowId(int columnIndex) throws SQLException;
2963+
2964+ /**
2965+ * Retrieves the value of the designated column in the current row of this
2966+ * <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java
2967+ * programming language.
2968+ *
2969+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
2970+ * @return the column value ; if the value is a SQL <code>NULL</code> the
2971+ * value returned is <code>null</code>
2972+ * @throws SQLException if the columnLabel is not valid;
2973+ * if a database access error occurs
2974+ * or this method is called on a closed result set
2975+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2976+ * this method
2977+ * @since 1.6
2978+ */
2979+ RowId getRowId(String columnLabel) throws SQLException;
2980+
2981+ /**
2982+ * Updates the designated column with a <code>RowId</code> value. The updater
2983+ * methods are used to update column values in the current row or the insert
2984+ * row. The updater methods do not update the underlying database; instead
2985+ * the <code>updateRow</code> or <code>insertRow</code> methods are called
2986+ * to update the database.
2987+ *
2988+ * @param columnIndex the first column is 1, the second 2, ...
2989+ * @param x the column value
2990+ * @exception SQLException if the columnIndex is not valid;
2991+ * if a database access error occurs;
2992+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
2993+ * or this method is called on a closed result set
2994+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
2995+ * this method
2996+ * @since 1.6
2997+ */
2998+ void updateRowId(int columnIndex, RowId x) throws SQLException;
2999+
3000+ /**
3001+ * Updates the designated column with a <code>RowId</code> value. The updater
3002+ * methods are used to update column values in the current row or the insert
3003+ * row. The updater methods do not update the underlying database; instead
3004+ * the <code>updateRow</code> or <code>insertRow</code> methods are called
3005+ * to update the database.
3006+ *
3007+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3008+ * @param x the column value
3009+ * @exception SQLException if the columnLabel is not valid;
3010+ * if a database access error occurs;
3011+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3012+ * or this method is called on a closed result set
3013+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3014+ * this method
3015+ * @since 1.6
3016+ */
3017+ void updateRowId(String columnLabel, RowId x) throws SQLException;
3018+
3019+ /**
3020+ * Retrieves the holdability of this <code>ResultSet</code> object
3021+ * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
3022+ * @throws SQLException if a database access error occurs
3023+ * or this method is called on a closed result set
3024+ * @since 1.6
3025+ */
3026+ int getHoldability() throws SQLException;
3027+
3028+ /**
3029+ * Retrieves whether this <code>ResultSet</code> object has been closed. A <code>ResultSet</code> is closed if the
3030+ * method close has been called on it, or if it is automatically closed.
3031+ *
3032+ * @return true if this <code>ResultSet</code> object is closed; false if it is still open
3033+ * @throws SQLException if a database access error occurs
3034+ * @since 1.6
3035+ */
3036+ boolean isClosed() throws SQLException;
3037+
3038+ /**
3039+ * Updates the designated column with a <code>String</code> value.
3040+ * It is intended for use when updating <code>NCHAR</code>,<code>NVARCHAR</code>
3041+ * and <code>LONGNVARCHAR</code> columns.
3042+ * The updater methods are used to update column values in the
3043+ * current row or the insert row. The updater methods do not
3044+ * update the underlying database; instead the <code>updateRow</code> or
3045+ * <code>insertRow</code> methods are called to update the database.
3046+ *
3047+ * @param columnIndex the first column is 1, the second 2, ...
3048+ * @param nString the value for the column to be updated
3049+ * @throws SQLException if the columnIndex is not valid;
3050+ * if the driver does not support national
3051+ * character sets; if the driver can detect that a data conversion
3052+ * error could occur; this method is called on a closed result set;
3053+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3054+ * or if a database access error occurs
3055+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3056+ * this method
3057+ * @since 1.6
3058+ */
3059+ void updateNString(int columnIndex, String nString) throws SQLException;
3060+
3061+ /**
3062+ * Updates the designated column with a <code>String</code> value.
3063+ * It is intended for use when updating <code>NCHAR</code>,<code>NVARCHAR</code>
3064+ * and <code>LONGNVARCHAR</code> columns.
3065+ * The updater methods are used to update column values in the
3066+ * current row or the insert row. The updater methods do not
3067+ * update the underlying database; instead the <code>updateRow</code> or
3068+ * <code>insertRow</code> methods are called to update the database.
3069+ *
3070+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3071+ * @param nString the value for the column to be updated
3072+ * @throws SQLException if the columnLabel is not valid;
3073+ * if the driver does not support national
3074+ * character sets; if the driver can detect that a data conversion
3075+ * error could occur; this method is called on a closed result set;
3076+ * the result set concurrency is <CODE>CONCUR_READ_ONLY</code>
3077+ * or if a database access error occurs
3078+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3079+ * this method
3080+ * @since 1.6
3081+ */
3082+ void updateNString(String columnLabel, String nString) throws SQLException;
3083+
3084+ /**
3085+ * Updates the designated column with a <code>java.sql.NClob</code> value.
3086+ * The updater methods are used to update column values in the
3087+ * current row or the insert row. The updater methods do not
3088+ * update the underlying database; instead the <code>updateRow</code> or
3089+ * <code>insertRow</code> methods are called to update the database.
3090+ *
3091+ * @param columnIndex the first column is 1, the second 2, ...
3092+ * @param nClob the value for the column to be updated
3093+ * @throws SQLException if the columnIndex is not valid;
3094+ * if the driver does not support national
3095+ * character sets; if the driver can detect that a data conversion
3096+ * error could occur; this method is called on a closed result set;
3097+ * if a database access error occurs or
3098+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3099+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3100+ * this method
3101+ * @since 1.6
3102+ */
3103+ void updateNClob(int columnIndex, NClob nClob) throws SQLException;
3104+
3105+ /**
3106+ * Updates the designated column with a <code>java.sql.NClob</code> value.
3107+ * The updater methods are used to update column values in the
3108+ * current row or the insert row. The updater methods do not
3109+ * update the underlying database; instead the <code>updateRow</code> or
3110+ * <code>insertRow</code> methods are called to update the database.
3111+ *
3112+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3113+ * @param nClob the value for the column to be updated
3114+ * @throws SQLException if the columnLabel is not valid;
3115+ * if the driver does not support national
3116+ * character sets; if the driver can detect that a data conversion
3117+ * error could occur; this method is called on a closed result set;
3118+ * if a database access error occurs or
3119+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3120+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3121+ * this method
3122+ * @since 1.6
3123+ */
3124+ void updateNClob(String columnLabel, NClob nClob) throws SQLException;
3125+
3126+ /**
3127+ * Retrieves the value of the designated column in the current row
3128+ * of this <code>ResultSet</code> object as a <code>NClob</code> object
3129+ * in the Java programming language.
3130+ *
3131+ * @param columnIndex the first column is 1, the second is 2, ...
3132+ * @return a <code>NClob</code> object representing the SQL
3133+ * <code>NCLOB</code> value in the specified column
3134+ * @exception SQLException if the columnIndex is not valid;
3135+ * if the driver does not support national
3136+ * character sets; if the driver can detect that a data conversion
3137+ * error could occur; this method is called on a closed result set
3138+ * or if a database access error occurs
3139+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3140+ * this method
3141+ * @since 1.6
3142+ */
3143+ NClob getNClob(int columnIndex) throws SQLException;
3144+
3145+ /**
3146+ * Retrieves the value of the designated column in the current row
3147+ * of this <code>ResultSet</code> object as a <code>NClob</code> object
3148+ * in the Java programming language.
3149+ *
3150+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3151+ * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
3152+ * value in the specified column
3153+ * @exception SQLException if the columnLabel is not valid;
3154+ * if the driver does not support national
3155+ * character sets; if the driver can detect that a data conversion
3156+ * error could occur; this method is called on a closed result set
3157+ * or if a database access error occurs
3158+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3159+ * this method
3160+ * @since 1.6
3161+ */
3162+ NClob getNClob(String columnLabel) throws SQLException;
3163+
3164+ /**
3165+ * Retrieves the value of the designated column in the current row of
3166+ * this <code>ResultSet</code> as a
3167+ * <code>java.sql.SQLXML</code> object in the Java programming language.
3168+ * @param columnIndex the first column is 1, the second is 2, ...
3169+ * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
3170+ * @throws SQLException if the columnIndex is not valid;
3171+ * if a database access error occurs
3172+ * or this method is called on a closed result set
3173+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3174+ * this method
3175+ * @since 1.6
3176+ */
3177+ SQLXML getSQLXML(int columnIndex) throws SQLException;
3178+
3179+ /**
3180+ * Retrieves the value of the designated column in the current row of
3181+ * this <code>ResultSet</code> as a
3182+ * <code>java.sql.SQLXML</code> object in the Java programming language.
3183+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3184+ * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
3185+ * @throws SQLException if the columnLabel is not valid;
3186+ * if a database access error occurs
3187+ * or this method is called on a closed result set
3188+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3189+ * this method
3190+ * @since 1.6
3191+ */
3192+ SQLXML getSQLXML(String columnLabel) throws SQLException;
3193+ /**
3194+ * Updates the designated column with a <code>java.sql.SQLXML</code> value.
3195+ * The updater
3196+ * methods are used to update column values in the current row or the insert
3197+ * row. The updater methods do not update the underlying database; instead
3198+ * the <code>updateRow</code> or <code>insertRow</code> methods are called
3199+ * to update the database.
3200+ * <p>
3201+ *
3202+ * @param columnIndex the first column is 1, the second 2, ...
3203+ * @param xmlObject the value for the column to be updated
3204+ * @throws SQLException if the columnIndex is not valid;
3205+ * if a database access error occurs; this method
3206+ * is called on a closed result set;
3207+ * the <code>java.xml.transform.Result</code>,
3208+ * <code>Writer</code> or <code>OutputStream</code> has not been closed
3209+ * for the <code>SQLXML</code> object;
3210+ * if there is an error processing the XML value or
3211+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>. The <code>getCause</code> method
3212+ * of the exception may provide a more detailed exception, for example, if the
3213+ * stream does not contain valid XML.
3214+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3215+ * this method
3216+ * @since 1.6
3217+ */
3218+ void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException;
3219+ /**
3220+ * Updates the designated column with a <code>java.sql.SQLXML</code> value.
3221+ * The updater
3222+ * methods are used to update column values in the current row or the insert
3223+ * row. The updater methods do not update the underlying database; instead
3224+ * the <code>updateRow</code> or <code>insertRow</code> methods are called
3225+ * to update the database.
3226+ * <p>
3227+ *
3228+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3229+ * @param xmlObject the column value
3230+ * @throws SQLException if the columnLabel is not valid;
3231+ * if a database access error occurs; this method
3232+ * is called on a closed result set;
3233+ * the <code>java.xml.transform.Result</code>,
3234+ * <code>Writer</code> or <code>OutputStream</code> has not been closed
3235+ * for the <code>SQLXML</code> object;
3236+ * if there is an error processing the XML value or
3237+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>. The <code>getCause</code> method
3238+ * of the exception may provide a more detailed exception, for example, if the
3239+ * stream does not contain valid XML.
3240+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3241+ * this method
3242+ * @since 1.6
3243+ */
3244+ void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException;
3245+
3246+ /**
3247+ * Retrieves the value of the designated column in the current row
3248+ * of this <code>ResultSet</code> object as
3249+ * a <code>String</code> in the Java programming language.
3250+ * It is intended for use when
3251+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
3252+ * and <code>LONGNVARCHAR</code> columns.
3253+ *
3254+ * @param columnIndex the first column is 1, the second is 2, ...
3255+ * @return the column value; if the value is SQL <code>NULL</code>, the
3256+ * value returned is <code>null</code>
3257+ * @exception SQLException if the columnIndex is not valid;
3258+ * if a database access error occurs
3259+ * or this method is called on a closed result set
3260+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3261+ * this method
3262+ * @since 1.6
3263+ */
3264+ String getNString(int columnIndex) throws SQLException;
3265+
3266+
3267+ /**
3268+ * Retrieves the value of the designated column in the current row
3269+ * of this <code>ResultSet</code> object as
3270+ * a <code>String</code> in the Java programming language.
3271+ * It is intended for use when
3272+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
3273+ * and <code>LONGNVARCHAR</code> columns.
3274+ *
3275+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3276+ * @return the column value; if the value is SQL <code>NULL</code>, the
3277+ * value returned is <code>null</code>
3278+ * @exception SQLException if the columnLabel is not valid;
3279+ * if a database access error occurs
3280+ * or this method is called on a closed result set
3281+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3282+ * this method
3283+ * @since 1.6
3284+ */
3285+ String getNString(String columnLabel) throws SQLException;
3286+
3287+
3288+ /**
3289+ * Retrieves the value of the designated column in the current row
3290+ * of this <code>ResultSet</code> object as a
3291+ * <code>java.io.Reader</code> object.
3292+ * It is intended for use when
3293+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
3294+ * and <code>LONGNVARCHAR</code> columns.
3295+ *
3296+ * @return a <code>java.io.Reader</code> object that contains the column
3297+ * value; if the value is SQL <code>NULL</code>, the value returned is
3298+ * <code>null</code> in the Java programming language.
3299+ * @param columnIndex the first column is 1, the second is 2, ...
3300+ * @exception SQLException if the columnIndex is not valid;
3301+ * if a database access error occurs
3302+ * or this method is called on a closed result set
3303+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3304+ * this method
3305+ * @since 1.6
3306+ */
3307+ java.io.Reader getNCharacterStream(int columnIndex) throws SQLException;
3308+
3309+ /**
3310+ * Retrieves the value of the designated column in the current row
3311+ * of this <code>ResultSet</code> object as a
3312+ * <code>java.io.Reader</code> object.
3313+ * It is intended for use when
3314+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
3315+ * and <code>LONGNVARCHAR</code> columns.
3316+ *
3317+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3318+ * @return a <code>java.io.Reader</code> object that contains the column
3319+ * value; if the value is SQL <code>NULL</code>, the value returned is
3320+ * <code>null</code> in the Java programming language
3321+ * @exception SQLException if the columnLabel is not valid;
3322+ * if a database access error occurs
3323+ * or this method is called on a closed result set
3324+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3325+ * this method
3326+ * @since 1.6
3327+ */
3328+ java.io.Reader getNCharacterStream(String columnLabel) throws SQLException;
3329+
3330+ /**
3331+ * Updates the designated column with a character stream value, which will have
3332+ * the specified number of bytes. The
3333+ * driver does the necessary conversion from Java character format to
3334+ * the national character set in the database.
3335+ * It is intended for use when
3336+ * updating <code>NCHAR</code>,<code>NVARCHAR</code>
3337+ * and <code>LONGNVARCHAR</code> columns.
3338+ * <p>
3339+ * The updater methods are used to update column values in the
3340+ * current row or the insert row. The updater methods do not
3341+ * update the underlying database; instead the <code>updateRow</code> or
3342+ * <code>insertRow</code> methods are called to update the database.
3343+ *
3344+ * @param columnIndex the first column is 1, the second is 2, ...
3345+ * @param x the new column value
3346+ * @param length the length of the stream
3347+ * @exception SQLException if the columnIndex is not valid;
3348+ * if a database access error occurs;
3349+ * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
3350+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3351+ * this method
3352+ * @since 1.6
3353+ */
3354+ void updateNCharacterStream(int columnIndex,
3355+ java.io.Reader x,
3356+ long length) throws SQLException;
3357+
3358+ /**
3359+ * Updates the designated column with a character stream value, which will have
3360+ * the specified number of bytes. The
3361+ * driver does the necessary conversion from Java character format to
3362+ * the national character set in the database.
3363+ * It is intended for use when
3364+ * updating <code>NCHAR</code>,<code>NVARCHAR</code>
3365+ * and <code>LONGNVARCHAR</code> columns.
3366+ * <p>
3367+ * The updater methods are used to update column values in the
3368+ * current row or the insert row. The updater methods do not
3369+ * update the underlying database; instead the <code>updateRow</code> or
3370+ * <code>insertRow</code> methods are called to update the database.
3371+ *
3372+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3373+ * @param reader the <code>java.io.Reader</code> object containing
3374+ * the new column value
3375+ * @param length the length of the stream
3376+ * @exception SQLException if the columnLabel is not valid;
3377+ * if a database access error occurs;
3378+ * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
3379+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3380+ * this method
3381+ * @since 1.6
3382+ */
3383+ void updateNCharacterStream(String columnLabel,
3384+ java.io.Reader reader,
3385+ long length) throws SQLException;
3386+ /**
3387+ * Updates the designated column with an ascii stream value, which will have
3388+ * the specified number of bytes.
3389+ * <p>
3390+ * The updater methods are used to update column values in the
3391+ * current row or the insert row. The updater methods do not
3392+ * update the underlying database; instead the <code>updateRow</code> or
3393+ * <code>insertRow</code> methods are called to update the database.
3394+ *
3395+ * @param columnIndex the first column is 1, the second is 2, ...
3396+ * @param x the new column value
3397+ * @param length the length of the stream
3398+ * @exception SQLException if the columnIndex is not valid;
3399+ * if a database access error occurs;
3400+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3401+ * or this method is called on a closed result set
3402+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3403+ * this method
3404+ * @since 1.6
3405+ */
3406+ void updateAsciiStream(int columnIndex,
3407+ java.io.InputStream x,
3408+ long length) throws SQLException;
3409+
3410+ /**
3411+ * Updates the designated column with a binary stream value, which will have
3412+ * the specified number of bytes.
3413+ * <p>
3414+ * The updater methods are used to update column values in the
3415+ * current row or the insert row. The updater methods do not
3416+ * update the underlying database; instead the <code>updateRow</code> or
3417+ * <code>insertRow</code> methods are called to update the database.
3418+ *
3419+ * @param columnIndex the first column is 1, the second is 2, ...
3420+ * @param x the new column value
3421+ * @param length the length of the stream
3422+ * @exception SQLException if the columnIndex is not valid;
3423+ * if a database access error occurs;
3424+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3425+ * or this method is called on a closed result set
3426+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3427+ * this method
3428+ * @since 1.6
3429+ */
3430+ void updateBinaryStream(int columnIndex,
3431+ java.io.InputStream x,
3432+ long length) throws SQLException;
3433+
3434+ /**
3435+ * Updates the designated column with a character stream value, which will have
3436+ * the specified number of bytes.
3437+ * <p>
3438+ * The updater methods are used to update column values in the
3439+ * current row or the insert row. The updater methods do not
3440+ * update the underlying database; instead the <code>updateRow</code> or
3441+ * <code>insertRow</code> methods are called to update the database.
3442+ *
3443+ * @param columnIndex the first column is 1, the second is 2, ...
3444+ * @param x the new column value
3445+ * @param length the length of the stream
3446+ * @exception SQLException if the columnIndex is not valid;
3447+ * if a database access error occurs;
3448+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3449+ * or this method is called on a closed result set
3450+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3451+ * this method
3452+ * @since 1.6
3453+ */
3454+ void updateCharacterStream(int columnIndex,
3455+ java.io.Reader x,
3456+ long length) throws SQLException;
3457+ /**
3458+ * Updates the designated column with an ascii stream value, which will have
3459+ * the specified number of bytes.
3460+ * <p>
3461+ * The updater methods are used to update column values in the
3462+ * current row or the insert row. The updater methods do not
3463+ * update the underlying database; instead the <code>updateRow</code> or
3464+ * <code>insertRow</code> methods are called to update the database.
3465+ *
3466+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3467+ * @param x the new column value
3468+ * @param length the length of the stream
3469+ * @exception SQLException if the columnLabel is not valid;
3470+ * if a database access error occurs;
3471+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3472+ * or this method is called on a closed result set
3473+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3474+ * this method
3475+ * @since 1.6
3476+ */
3477+ void updateAsciiStream(String columnLabel,
3478+ java.io.InputStream x,
3479+ long length) throws SQLException;
3480+
3481+ /**
3482+ * Updates the designated column with a binary stream value, which will have
3483+ * the specified number of bytes.
3484+ * <p>
3485+ * The updater methods are used to update column values in the
3486+ * current row or the insert row. The updater methods do not
3487+ * update the underlying database; instead the <code>updateRow</code> or
3488+ * <code>insertRow</code> methods are called to update the database.
3489+ *
3490+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3491+ * @param x the new column value
3492+ * @param length the length of the stream
3493+ * @exception SQLException if the columnLabel is not valid;
3494+ * if a database access error occurs;
3495+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3496+ * or this method is called on a closed result set
3497+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3498+ * this method
3499+ * @since 1.6
3500+ */
3501+ void updateBinaryStream(String columnLabel,
3502+ java.io.InputStream x,
3503+ long length) throws SQLException;
3504+
3505+ /**
3506+ * Updates the designated column with a character stream value, which will have
3507+ * the specified number of bytes.
3508+ * <p>
3509+ * The updater methods are used to update column values in the
3510+ * current row or the insert row. The updater methods do not
3511+ * update the underlying database; instead the <code>updateRow</code> or
3512+ * <code>insertRow</code> methods are called to update the database.
3513+ *
3514+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3515+ * @param reader the <code>java.io.Reader</code> object containing
3516+ * the new column value
3517+ * @param length the length of the stream
3518+ * @exception SQLException if the columnLabel is not valid;
3519+ * if a database access error occurs;
3520+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3521+ * or this method is called on a closed result set
3522+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3523+ * this method
3524+ * @since 1.6
3525+ */
3526+ void updateCharacterStream(String columnLabel,
3527+ java.io.Reader reader,
3528+ long length) throws SQLException;
3529+ /**
3530+ * Updates the designated column using the given input stream, which
3531+ * will have the specified number of bytes.
3532+ *
3533+ * <p>
3534+ * The updater methods are used to update column values in the
3535+ * current row or the insert row. The updater methods do not
3536+ * update the underlying database; instead the <code>updateRow</code> or
3537+ * <code>insertRow</code> methods are called to update the database.
3538+ *
3539+ * @param columnIndex the first column is 1, the second is 2, ...
3540+ * @param inputStream An object that contains the data to set the parameter
3541+ * value to.
3542+ * @param length the number of bytes in the parameter data.
3543+ * @exception SQLException if the columnIndex is not valid;
3544+ * if a database access error occurs;
3545+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3546+ * or this method is called on a closed result set
3547+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3548+ * this method
3549+ * @since 1.6
3550+ */
3551+ void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException;
3552+
3553+ /**
3554+ * Updates the designated column using the given input stream, which
3555+ * will have the specified number of bytes.
3556+ *
3557+ * <p>
3558+ * The updater methods are used to update column values in the
3559+ * current row or the insert row. The updater methods do not
3560+ * update the underlying database; instead the <code>updateRow</code> or
3561+ * <code>insertRow</code> methods are called to update the database.
3562+ *
3563+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3564+ * @param inputStream An object that contains the data to set the parameter
3565+ * value to.
3566+ * @param length the number of bytes in the parameter data.
3567+ * @exception SQLException if the columnLabel is not valid;
3568+ * if a database access error occurs;
3569+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3570+ * or this method is called on a closed result set
3571+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3572+ * this method
3573+ * @since 1.6
3574+ */
3575+ void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException;
3576+
3577+ /**
3578+ * Updates the designated column using the given <code>Reader</code>
3579+ * object, which is the given number of characters long.
3580+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
3581+ * parameter, it may be more practical to send it via a
3582+ * <code>java.io.Reader</code> object. The JDBC driver will
3583+ * do any necessary conversion from UNICODE to the database char format.
3584+ *
3585+ * <p>
3586+ * The updater methods are used to update column values in the
3587+ * current row or the insert row. The updater methods do not
3588+ * update the underlying database; instead the <code>updateRow</code> or
3589+ * <code>insertRow</code> methods are called to update the database.
3590+ *
3591+ * @param columnIndex the first column is 1, the second is 2, ...
3592+ * @param reader An object that contains the data to set the parameter value to.
3593+ * @param length the number of characters in the parameter data.
3594+ * @exception SQLException if the columnIndex is not valid;
3595+ * if a database access error occurs;
3596+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3597+ * or this method is called on a closed result set
3598+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3599+ * this method
3600+ * @since 1.6
3601+ */
3602+ void updateClob(int columnIndex, Reader reader, long length) throws SQLException;
3603+
3604+ /**
3605+ * Updates the designated column using the given <code>Reader</code>
3606+ * object, which is the given number of characters long.
3607+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
3608+ * parameter, it may be more practical to send it via a
3609+ * <code>java.io.Reader</code> object. The JDBC driver will
3610+ * do any necessary conversion from UNICODE to the database char format.
3611+ *
3612+ * <p>
3613+ * The updater methods are used to update column values in the
3614+ * current row or the insert row. The updater methods do not
3615+ * update the underlying database; instead the <code>updateRow</code> or
3616+ * <code>insertRow</code> methods are called to update the database.
3617+ *
3618+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3619+ * @param reader An object that contains the data to set the parameter value to.
3620+ * @param length the number of characters in the parameter data.
3621+ * @exception SQLException if the columnLabel is not valid;
3622+ * if a database access error occurs;
3623+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3624+ * or this method is called on a closed result set
3625+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3626+ * this method
3627+ * @since 1.6
3628+ */
3629+ void updateClob(String columnLabel, Reader reader, long length) throws SQLException;
3630+ /**
3631+ * Updates the designated column using the given <code>Reader</code>
3632+ * object, which is the given number of characters long.
3633+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
3634+ * parameter, it may be more practical to send it via a
3635+ * <code>java.io.Reader</code> object. The JDBC driver will
3636+ * do any necessary conversion from UNICODE to the database char format.
3637+ *
3638+ * <p>
3639+ * The updater methods are used to update column values in the
3640+ * current row or the insert row. The updater methods do not
3641+ * update the underlying database; instead the <code>updateRow</code> or
3642+ * <code>insertRow</code> methods are called to update the database.
3643+ *
3644+ * @param columnIndex the first column is 1, the second 2, ...
3645+ * @param reader An object that contains the data to set the parameter value to.
3646+ * @param length the number of characters in the parameter data.
3647+ * @throws SQLException if the columnIndex is not valid;
3648+ * if the driver does not support national
3649+ * character sets; if the driver can detect that a data conversion
3650+ * error could occur; this method is called on a closed result set,
3651+ * if a database access error occurs or
3652+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3653+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3654+ * this method
3655+ * @since 1.6
3656+ */
3657+ void updateNClob(int columnIndex, Reader reader, long length) throws SQLException;
3658+
3659+ /**
3660+ * Updates the designated column using the given <code>Reader</code>
3661+ * object, which is the given number of characters long.
3662+ * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
3663+ * parameter, it may be more practical to send it via a
3664+ * <code>java.io.Reader</code> object. The JDBC driver will
3665+ * do any necessary conversion from UNICODE to the database char format.
3666+ *
3667+ * <p>
3668+ * The updater methods are used to update column values in the
3669+ * current row or the insert row. The updater methods do not
3670+ * update the underlying database; instead the <code>updateRow</code> or
3671+ * <code>insertRow</code> methods are called to update the database.
3672+ *
3673+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3674+ * @param reader An object that contains the data to set the parameter value to.
3675+ * @param length the number of characters in the parameter data.
3676+ * @throws SQLException if the columnLabel is not valid;
3677+ * if the driver does not support national
3678+ * character sets; if the driver can detect that a data conversion
3679+ * error could occur; this method is called on a closed result set;
3680+ * if a database access error occurs or
3681+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3682+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3683+ * this method
3684+ * @since 1.6
3685+ */
3686+ void updateNClob(String columnLabel, Reader reader, long length) throws SQLException;
3687+
3688+ //---
3689+
3690+ /**
3691+ * Updates the designated column with a character stream value.
3692+ * The data will be read from the stream
3693+ * as needed until end-of-stream is reached. The
3694+ * driver does the necessary conversion from Java character format to
3695+ * the national character set in the database.
3696+ * It is intended for use when
3697+ * updating <code>NCHAR</code>,<code>NVARCHAR</code>
3698+ * and <code>LONGNVARCHAR</code> columns.
3699+ * <p>
3700+ * The updater methods are used to update column values in the
3701+ * current row or the insert row. The updater methods do not
3702+ * update the underlying database; instead the <code>updateRow</code> or
3703+ * <code>insertRow</code> methods are called to update the database.
3704+ *
3705+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3706+ * it might be more efficient to use a version of
3707+ * <code>updateNCharacterStream</code> which takes a length parameter.
3708+ *
3709+ * @param columnIndex the first column is 1, the second is 2, ...
3710+ * @param x the new column value
3711+ * @exception SQLException if the columnIndex is not valid;
3712+ * if a database access error occurs;
3713+ * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
3714+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3715+ * this method
3716+ * @since 1.6
3717+ */
3718+ void updateNCharacterStream(int columnIndex,
3719+ java.io.Reader x) throws SQLException;
3720+
3721+ /**
3722+ * Updates the designated column with a character stream value.
3723+ * The data will be read from the stream
3724+ * as needed until end-of-stream is reached. The
3725+ * driver does the necessary conversion from Java character format to
3726+ * the national character set in the database.
3727+ * It is intended for use when
3728+ * updating <code>NCHAR</code>,<code>NVARCHAR</code>
3729+ * and <code>LONGNVARCHAR</code> columns.
3730+ * <p>
3731+ * The updater methods are used to update column values in the
3732+ * current row or the insert row. The updater methods do not
3733+ * update the underlying database; instead the <code>updateRow</code> or
3734+ * <code>insertRow</code> methods are called to update the database.
3735+ *
3736+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3737+ * it might be more efficient to use a version of
3738+ * <code>updateNCharacterStream</code> which takes a length parameter.
3739+ *
3740+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3741+ * @param reader the <code>java.io.Reader</code> object containing
3742+ * the new column value
3743+ * @exception SQLException if the columnLabel is not valid;
3744+ * if a database access error occurs;
3745+ * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
3746+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3747+ * this method
3748+ * @since 1.6
3749+ */
3750+ void updateNCharacterStream(String columnLabel,
3751+ java.io.Reader reader) throws SQLException;
3752+ /**
3753+ * Updates the designated column with an ascii stream value.
3754+ * The data will be read from the stream
3755+ * as needed until end-of-stream is reached.
3756+ * <p>
3757+ * The updater methods are used to update column values in the
3758+ * current row or the insert row. The updater methods do not
3759+ * update the underlying database; instead the <code>updateRow</code> or
3760+ * <code>insertRow</code> methods are called to update the database.
3761+ *
3762+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3763+ * it might be more efficient to use a version of
3764+ * <code>updateAsciiStream</code> which takes a length parameter.
3765+ *
3766+ * @param columnIndex the first column is 1, the second is 2, ...
3767+ * @param x the new column value
3768+ * @exception SQLException if the columnIndex is not valid;
3769+ * if a database access error occurs;
3770+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3771+ * or this method is called on a closed result set
3772+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3773+ * this method
3774+ * @since 1.6
3775+ */
3776+ void updateAsciiStream(int columnIndex,
3777+ java.io.InputStream x) throws SQLException;
3778+
3779+ /**
3780+ * Updates the designated column with a binary stream value.
3781+ * The data will be read from the stream
3782+ * as needed until end-of-stream is reached.
3783+ * <p>
3784+ * The updater methods are used to update column values in the
3785+ * current row or the insert row. The updater methods do not
3786+ * update the underlying database; instead the <code>updateRow</code> or
3787+ * <code>insertRow</code> methods are called to update the database.
3788+ *
3789+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3790+ * it might be more efficient to use a version of
3791+ * <code>updateBinaryStream</code> which takes a length parameter.
3792+ *
3793+ * @param columnIndex the first column is 1, the second is 2, ...
3794+ * @param x the new column value
3795+ * @exception SQLException if the columnIndex is not valid;
3796+ * if a database access error occurs;
3797+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3798+ * or this method is called on a closed result set
3799+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3800+ * this method
3801+ * @since 1.6
3802+ */
3803+ void updateBinaryStream(int columnIndex,
3804+ java.io.InputStream x) throws SQLException;
3805+
3806+ /**
3807+ * Updates the designated column with a character stream value.
3808+ * The data will be read from the stream
3809+ * as needed until end-of-stream is reached.
3810+ * <p>
3811+ * The updater methods are used to update column values in the
3812+ * current row or the insert row. The updater methods do not
3813+ * update the underlying database; instead the <code>updateRow</code> or
3814+ * <code>insertRow</code> methods are called to update the database.
3815+ *
3816+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3817+ * it might be more efficient to use a version of
3818+ * <code>updateCharacterStream</code> which takes a length parameter.
3819+ *
3820+ * @param columnIndex the first column is 1, the second is 2, ...
3821+ * @param x the new column value
3822+ * @exception SQLException if the columnIndex is not valid;
3823+ * if a database access error occurs;
3824+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3825+ * or this method is called on a closed result set
3826+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3827+ * this method
3828+ * @since 1.6
3829+ */
3830+ void updateCharacterStream(int columnIndex,
3831+ java.io.Reader x) throws SQLException;
3832+ /**
3833+ * Updates the designated column with an ascii stream value.
3834+ * The data will be read from the stream
3835+ * as needed until end-of-stream is reached.
3836+ * <p>
3837+ * The updater methods are used to update column values in the
3838+ * current row or the insert row. The updater methods do not
3839+ * update the underlying database; instead the <code>updateRow</code> or
3840+ * <code>insertRow</code> methods are called to update the database.
3841+ *
3842+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3843+ * it might be more efficient to use a version of
3844+ * <code>updateAsciiStream</code> which takes a length parameter.
3845+ *
3846+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3847+ * @param x the new column value
3848+ * @exception SQLException if the columnLabel is not valid;
3849+ * if a database access error occurs;
3850+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3851+ * or this method is called on a closed result set
3852+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3853+ * this method
3854+ * @since 1.6
3855+ */
3856+ void updateAsciiStream(String columnLabel,
3857+ java.io.InputStream x) throws SQLException;
3858+
3859+ /**
3860+ * Updates the designated column with a binary stream value.
3861+ * The data will be read from the stream
3862+ * as needed until end-of-stream is reached.
3863+ * <p>
3864+ * The updater methods are used to update column values in the
3865+ * current row or the insert row. The updater methods do not
3866+ * update the underlying database; instead the <code>updateRow</code> or
3867+ * <code>insertRow</code> methods are called to update the database.
3868+ *
3869+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3870+ * it might be more efficient to use a version of
3871+ * <code>updateBinaryStream</code> which takes a length parameter.
3872+ *
3873+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3874+ * @param x the new column value
3875+ * @exception SQLException if the columnLabel is not valid;
3876+ * if a database access error occurs;
3877+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3878+ * or this method is called on a closed result set
3879+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3880+ * this method
3881+ * @since 1.6
3882+ */
3883+ void updateBinaryStream(String columnLabel,
3884+ java.io.InputStream x) throws SQLException;
3885+
3886+ /**
3887+ * Updates the designated column with a character stream value.
3888+ * The data will be read from the stream
3889+ * as needed until end-of-stream is reached.
3890+ * <p>
3891+ * The updater methods are used to update column values in the
3892+ * current row or the insert row. The updater methods do not
3893+ * update the underlying database; instead the <code>updateRow</code> or
3894+ * <code>insertRow</code> methods are called to update the database.
3895+ *
3896+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3897+ * it might be more efficient to use a version of
3898+ * <code>updateCharacterStream</code> which takes a length parameter.
3899+ *
3900+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3901+ * @param reader the <code>java.io.Reader</code> object containing
3902+ * the new column value
3903+ * @exception SQLException if the columnLabel is not valid; if a database access error occurs;
3904+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3905+ * or this method is called on a closed result set
3906+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3907+ * this method
3908+ * @since 1.6
3909+ */
3910+ void updateCharacterStream(String columnLabel,
3911+ java.io.Reader reader) throws SQLException;
3912+ /**
3913+ * Updates the designated column using the given input stream. The data will be read from the stream
3914+ * as needed until end-of-stream is reached.
3915+ * <p>
3916+ * The updater methods are used to update column values in the
3917+ * current row or the insert row. The updater methods do not
3918+ * update the underlying database; instead the <code>updateRow</code> or
3919+ * <code>insertRow</code> methods are called to update the database.
3920+ *
3921+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3922+ * it might be more efficient to use a version of
3923+ * <code>updateBlob</code> which takes a length parameter.
3924+ *
3925+ * @param columnIndex the first column is 1, the second is 2, ...
3926+ * @param inputStream An object that contains the data to set the parameter
3927+ * value to.
3928+ * @exception SQLException if the columnIndex is not valid; if a database access error occurs;
3929+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3930+ * or this method is called on a closed result set
3931+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3932+ * this method
3933+ * @since 1.6
3934+ */
3935+ void updateBlob(int columnIndex, InputStream inputStream) throws SQLException;
3936+
3937+ /**
3938+ * Updates the designated column using the given input stream. The data will be read from the stream
3939+ * as needed until end-of-stream is reached.
3940+ * <p>
3941+ * The updater methods are used to update column values in the
3942+ * current row or the insert row. The updater methods do not
3943+ * update the underlying database; instead the <code>updateRow</code> or
3944+ * <code>insertRow</code> methods are called to update the database.
3945+ *
3946+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3947+ * it might be more efficient to use a version of
3948+ * <code>updateBlob</code> which takes a length parameter.
3949+ *
3950+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
3951+ * @param inputStream An object that contains the data to set the parameter
3952+ * value to.
3953+ * @exception SQLException if the columnLabel is not valid; if a database access error occurs;
3954+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3955+ * or this method is called on a closed result set
3956+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3957+ * this method
3958+ * @since 1.6
3959+ */
3960+ void updateBlob(String columnLabel, InputStream inputStream) throws SQLException;
3961+
3962+ /**
3963+ * Updates the designated column using the given <code>Reader</code>
3964+ * object.
3965+ * The data will be read from the stream
3966+ * as needed until end-of-stream is reached. The JDBC driver will
3967+ * do any necessary conversion from UNICODE to the database char format.
3968+ *
3969+ * <p>
3970+ * The updater methods are used to update column values in the
3971+ * current row or the insert row. The updater methods do not
3972+ * update the underlying database; instead the <code>updateRow</code> or
3973+ * <code>insertRow</code> methods are called to update the database.
3974+ *
3975+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
3976+ * it might be more efficient to use a version of
3977+ * <code>updateClob</code> which takes a length parameter.
3978+ *
3979+ * @param columnIndex the first column is 1, the second is 2, ...
3980+ * @param reader An object that contains the data to set the parameter value to.
3981+ * @exception SQLException if the columnIndex is not valid;
3982+ * if a database access error occurs;
3983+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
3984+ * or this method is called on a closed result set
3985+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
3986+ * this method
3987+ * @since 1.6
3988+ */
3989+ void updateClob(int columnIndex, Reader reader) throws SQLException;
3990+
3991+ /**
3992+ * Updates the designated column using the given <code>Reader</code>
3993+ * object.
3994+ * The data will be read from the stream
3995+ * as needed until end-of-stream is reached. The JDBC driver will
3996+ * do any necessary conversion from UNICODE to the database char format.
3997+ *
3998+ * <p>
3999+ * The updater methods are used to update column values in the
4000+ * current row or the insert row. The updater methods do not
4001+ * update the underlying database; instead the <code>updateRow</code> or
4002+ * <code>insertRow</code> methods are called to update the database.
4003+ *
4004+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
4005+ * it might be more efficient to use a version of
4006+ * <code>updateClob</code> which takes a length parameter.
4007+ *
4008+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
4009+ * @param reader An object that contains the data to set the parameter value to.
4010+ * @exception SQLException if the columnLabel is not valid; if a database access error occurs;
4011+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
4012+ * or this method is called on a closed result set
4013+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
4014+ * this method
4015+ * @since 1.6
4016+ */
4017+ void updateClob(String columnLabel, Reader reader) throws SQLException;
4018+ /**
4019+ * Updates the designated column using the given <code>Reader</code>
4020+ *
4021+ * The data will be read from the stream
4022+ * as needed until end-of-stream is reached. The JDBC driver will
4023+ * do any necessary conversion from UNICODE to the database char format.
4024+ *
4025+ * <p>
4026+ * The updater methods are used to update column values in the
4027+ * current row or the insert row. The updater methods do not
4028+ * update the underlying database; instead the <code>updateRow</code> or
4029+ * <code>insertRow</code> methods are called to update the database.
4030+ *
4031+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
4032+ * it might be more efficient to use a version of
4033+ * <code>updateNClob</code> which takes a length parameter.
4034+ *
4035+ * @param columnIndex the first column is 1, the second 2, ...
4036+ * @param reader An object that contains the data to set the parameter value to.
4037+ * @throws SQLException if the columnIndex is not valid;
4038+ * if the driver does not support national
4039+ * character sets; if the driver can detect that a data conversion
4040+ * error could occur; this method is called on a closed result set,
4041+ * if a database access error occurs or
4042+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
4043+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
4044+ * this method
4045+ * @since 1.6
4046+ */
4047+ void updateNClob(int columnIndex, Reader reader) throws SQLException;
4048+
4049+ /**
4050+ * Updates the designated column using the given <code>Reader</code>
4051+ * object.
4052+ * The data will be read from the stream
4053+ * as needed until end-of-stream is reached. The JDBC driver will
4054+ * do any necessary conversion from UNICODE to the database char format.
4055+ *
4056+ * <p>
4057+ * The updater methods are used to update column values in the
4058+ * current row or the insert row. The updater methods do not
4059+ * update the underlying database; instead the <code>updateRow</code> or
4060+ * <code>insertRow</code> methods are called to update the database.
4061+ *
4062+ * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
4063+ * it might be more efficient to use a version of
4064+ * <code>updateNClob</code> which takes a length parameter.
4065+ *
4066+ * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
4067+ * @param reader An object that contains the data to set the parameter value to.
4068+ * @throws SQLException if the columnLabel is not valid; if the driver does not support national
4069+ * character sets; if the driver can detect that a data conversion
4070+ * error could occur; this method is called on a closed result set;
4071+ * if a database access error occurs or
4072+ * the result set concurrency is <code>CONCUR_READ_ONLY</code>
4073+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
4074+ * this method
4075+ * @since 1.6
4076+ */
4077+ void updateNClob(String columnLabel, Reader reader) throws SQLException;
4078+
4079+ //------------------------- JDBC 4.1 -----------------------------------
4080+
4081+
4082+ /**
4083+ *<p>Retrieves the value of the designated column in the current row
4084+ * of this <code>ResultSet</code> object and will convert from the
4085+ * SQL type of the column to the requested Java data type, if the
4086+ * conversion is supported. If the conversion is not
4087+ * supported or null is specified for the type, a
4088+ * <code>SQLException</code> is thrown.
4089+ *<p>
4090+ * At a minimum, an implementation must support the conversions defined in
4091+ * Appendix B, Table B-3 and conversion of appropriate user defined SQL
4092+ * types to a Java type which implements {@code SQLData}, or {@code Struct}.
4093+ * Additional conversions may be supported and are vendor defined.
4094+ *
4095+ * @param columnIndex the first column is 1, the second is 2, ...
4096+ * @param type Class representing the Java data type to convert the designated
4097+ * column to.
4098+ * @return an instance of {@code type} holding the column value
4099+ * @throws SQLException if conversion is not supported, type is null or
4100+ * another error occurs. The getCause() method of the
4101+ * exception may provide a more detailed exception, for example, if
4102+ * a conversion error occurs
4103+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support
4104+ * this method
4105+ * @since 1.7
4106+ */
4107+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException;
4108+
4109+
4110+ /**
4111+ *<p>Retrieves the value of the designated column in the current row
4112+ * of this <code>ResultSet</code> object and will convert from the
4113+ * SQL type of the column to the requested Java data type, if the
4114+ * conversion is supported. If the conversion is not
4115+ * supported or null is specified for the type, a
4116+ * <code>SQLException</code> is thrown.
4117+ *<p>
4118+ * At a minimum, an implementation must support the conversions defined in
4119+ * Appendix B, Table B-3 and conversion of appropriate user defined SQL
4120+ * types to a Java type which implements {@code SQLData}, or {@code Struct}.
4121+ * Additional conversions may be supported and are vendor defined.
4122+ *
4123+ * @param columnLabel the label for the column specified with the SQL AS clause.
4124+ * If the SQL AS clause was not specified, then the label is the name
4125+ * of the column
4126+ * @param type Class representing the Java data type to convert the designated
4127+ * column to.
4128+ * @return an instance of {@code type} holding the column value
4129+ * @throws SQLException if conversion is not supported, type is null or
4130+ * another error occurs. The getCause() method of the
4131+ * exception may provide a more detailed exception, for example, if
4132+ * a conversion error occurs
4133+ * @throws SQLFeatureNotSupportedException if the JDBC driver does not support
4134+ * this method
4135+ * @since 1.7
4136+ */
4137+ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException;
4138+
4139+}
java/pkg/java/sql/ResultSetMetaData.class+0−0

Binary file not shown.

java/pkg/java/sql/ResultSetMetaData.java+277−0
@@ -0,0 +1,277 @@
1+/*
2+ * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * An object that can be used to get information about the types
30+ * and properties of the columns in a <code>ResultSet</code> object.
31+ * The following code fragment creates the <code>ResultSet</code> object rs,
32+ * creates the <code>ResultSetMetaData</code> object rsmd, and uses rsmd
33+ * to find out how many columns rs has and whether the first column in rs
34+ * can be used in a <code>WHERE</code> clause.
35+ * <PRE>
36+ *
37+ * ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
38+ * ResultSetMetaData rsmd = rs.getMetaData();
39+ * int numberOfColumns = rsmd.getColumnCount();
40+ * boolean b = rsmd.isSearchable(1);
41+ *
42+ * </PRE>
43+ */
44+
45+public interface ResultSetMetaData extends Wrapper {
46+
47+ /**
48+ * Returns the number of columns in this <code>ResultSet</code> object.
49+ *
50+ * @return the number of columns
51+ * @exception SQLException if a database access error occurs
52+ */
53+ int getColumnCount() throws SQLException;
54+
55+ /**
56+ * Indicates whether the designated column is automatically numbered.
57+ *
58+ * @param column the first column is 1, the second is 2, ...
59+ * @return <code>true</code> if so; <code>false</code> otherwise
60+ * @exception SQLException if a database access error occurs
61+ */
62+ boolean isAutoIncrement(int column) throws SQLException;
63+
64+ /**
65+ * Indicates whether a column's case matters.
66+ *
67+ * @param column the first column is 1, the second is 2, ...
68+ * @return <code>true</code> if so; <code>false</code> otherwise
69+ * @exception SQLException if a database access error occurs
70+ */
71+ boolean isCaseSensitive(int column) throws SQLException;
72+
73+ /**
74+ * Indicates whether the designated column can be used in a where clause.
75+ *
76+ * @param column the first column is 1, the second is 2, ...
77+ * @return <code>true</code> if so; <code>false</code> otherwise
78+ * @exception SQLException if a database access error occurs
79+ */
80+ boolean isSearchable(int column) throws SQLException;
81+
82+ /**
83+ * Indicates whether the designated column is a cash value.
84+ *
85+ * @param column the first column is 1, the second is 2, ...
86+ * @return <code>true</code> if so; <code>false</code> otherwise
87+ * @exception SQLException if a database access error occurs
88+ */
89+ boolean isCurrency(int column) throws SQLException;
90+
91+ /**
92+ * Indicates the nullability of values in the designated column.
93+ *
94+ * @param column the first column is 1, the second is 2, ...
95+ * @return the nullability status of the given column; one of <code>columnNoNulls</code>,
96+ * <code>columnNullable</code> or <code>columnNullableUnknown</code>
97+ * @exception SQLException if a database access error occurs
98+ */
99+ int isNullable(int column) throws SQLException;
100+
101+ /**
102+ * The constant indicating that a
103+ * column does not allow <code>NULL</code> values.
104+ */
105+ int columnNoNulls = 0;
106+
107+ /**
108+ * The constant indicating that a
109+ * column allows <code>NULL</code> values.
110+ */
111+ int columnNullable = 1;
112+
113+ /**
114+ * The constant indicating that the
115+ * nullability of a column's values is unknown.
116+ */
117+ int columnNullableUnknown = 2;
118+
119+ /**
120+ * Indicates whether values in the designated column are signed numbers.
121+ *
122+ * @param column the first column is 1, the second is 2, ...
123+ * @return <code>true</code> if so; <code>false</code> otherwise
124+ * @exception SQLException if a database access error occurs
125+ */
126+ boolean isSigned(int column) throws SQLException;
127+
128+ /**
129+ * Indicates the designated column's normal maximum width in characters.
130+ *
131+ * @param column the first column is 1, the second is 2, ...
132+ * @return the normal maximum number of characters allowed as the width
133+ * of the designated column
134+ * @exception SQLException if a database access error occurs
135+ */
136+ int getColumnDisplaySize(int column) throws SQLException;
137+
138+ /**
139+ * Gets the designated column's suggested title for use in printouts and
140+ * displays. The suggested title is usually specified by the SQL <code>AS</code>
141+ * clause. If a SQL <code>AS</code> is not specified, the value returned from
142+ * <code>getColumnLabel</code> will be the same as the value returned by the
143+ * <code>getColumnName</code> method.
144+ *
145+ * @param column the first column is 1, the second is 2, ...
146+ * @return the suggested column title
147+ * @exception SQLException if a database access error occurs
148+ */
149+ String getColumnLabel(int column) throws SQLException;
150+
151+ /**
152+ * Get the designated column's name.
153+ *
154+ * @param column the first column is 1, the second is 2, ...
155+ * @return column name
156+ * @exception SQLException if a database access error occurs
157+ */
158+ String getColumnName(int column) throws SQLException;
159+
160+ /**
161+ * Get the designated column's table's schema.
162+ *
163+ * @param column the first column is 1, the second is 2, ...
164+ * @return schema name or "" if not applicable
165+ * @exception SQLException if a database access error occurs
166+ */
167+ String getSchemaName(int column) throws SQLException;
168+
169+ /**
170+ * Get the designated column's specified column size.
171+ * For numeric data, this is the maximum precision. For character data, this is the length in characters.
172+ * For datetime datatypes, this is the length in characters of the String representation (assuming the
173+ * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
174+ * this is the length in bytes. 0 is returned for data types where the
175+ * column size is not applicable.
176+ *
177+ * @param column the first column is 1, the second is 2, ...
178+ * @return precision
179+ * @exception SQLException if a database access error occurs
180+ */
181+ int getPrecision(int column) throws SQLException;
182+
183+ /**
184+ * Gets the designated column's number of digits to right of the decimal point.
185+ * 0 is returned for data types where the scale is not applicable.
186+ *
187+ * @param column the first column is 1, the second is 2, ...
188+ * @return scale
189+ * @exception SQLException if a database access error occurs
190+ */
191+ int getScale(int column) throws SQLException;
192+
193+ /**
194+ * Gets the designated column's table name.
195+ *
196+ * @param column the first column is 1, the second is 2, ...
197+ * @return table name or "" if not applicable
198+ * @exception SQLException if a database access error occurs
199+ */
200+ String getTableName(int column) throws SQLException;
201+
202+ /**
203+ * Gets the designated column's table's catalog name.
204+ *
205+ * @param column the first column is 1, the second is 2, ...
206+ * @return the name of the catalog for the table in which the given column
207+ * appears or "" if not applicable
208+ * @exception SQLException if a database access error occurs
209+ */
210+ String getCatalogName(int column) throws SQLException;
211+
212+ /**
213+ * Retrieves the designated column's SQL type.
214+ *
215+ * @param column the first column is 1, the second is 2, ...
216+ * @return SQL type from java.sql.Types
217+ * @exception SQLException if a database access error occurs
218+ * @see Types
219+ */
220+ int getColumnType(int column) throws SQLException;
221+
222+ /**
223+ * Retrieves the designated column's database-specific type name.
224+ *
225+ * @param column the first column is 1, the second is 2, ...
226+ * @return type name used by the database. If the column type is
227+ * a user-defined type, then a fully-qualified type name is returned.
228+ * @exception SQLException if a database access error occurs
229+ */
230+ String getColumnTypeName(int column) throws SQLException;
231+
232+ /**
233+ * Indicates whether the designated column is definitely not writable.
234+ *
235+ * @param column the first column is 1, the second is 2, ...
236+ * @return <code>true</code> if so; <code>false</code> otherwise
237+ * @exception SQLException if a database access error occurs
238+ */
239+ boolean isReadOnly(int column) throws SQLException;
240+
241+ /**
242+ * Indicates whether it is possible for a write on the designated column to succeed.
243+ *
244+ * @param column the first column is 1, the second is 2, ...
245+ * @return <code>true</code> if so; <code>false</code> otherwise
246+ * @exception SQLException if a database access error occurs
247+ */
248+ boolean isWritable(int column) throws SQLException;
249+
250+ /**
251+ * Indicates whether a write on the designated column will definitely succeed.
252+ *
253+ * @param column the first column is 1, the second is 2, ...
254+ * @return <code>true</code> if so; <code>false</code> otherwise
255+ * @exception SQLException if a database access error occurs
256+ */
257+ boolean isDefinitelyWritable(int column) throws SQLException;
258+
259+ //--------------------------JDBC 2.0-----------------------------------
260+
261+ /**
262+ * <p>Returns the fully-qualified name of the Java class whose instances
263+ * are manufactured if the method <code>ResultSet.getObject</code>
264+ * is called to retrieve a value
265+ * from the column. <code>ResultSet.getObject</code> may return a subclass of the
266+ * class returned by this method.
267+ *
268+ * @param column the first column is 1, the second is 2, ...
269+ * @return the fully-qualified name of the class in the Java programming
270+ * language that would be used by the method
271+ * <code>ResultSet.getObject</code> to retrieve the value in the specified
272+ * column. This is the class name used for custom mapping.
273+ * @exception SQLException if a database access error occurs
274+ * @since 1.2
275+ */
276+ String getColumnClassName(int column) throws SQLException;
277+}
java/pkg/java/sql/RowId.class+0−0

Binary file not shown.

java/pkg/java/sql/RowId.java+120−0
@@ -0,0 +1,120 @@
1+/*
2+ * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ *
30+ * The representation (mapping) in the Java programming language of an SQL ROWID
31+ * value. An SQL ROWID is a built-in type, a value of which can be thought of as
32+ * an address for its identified row in a database table. Whether that address
33+ * is logical or, in any respects, physical is determined by its originating data
34+ * source.
35+ * <p>
36+ * Methods in the interfaces <code>ResultSet</code>, <code>CallableStatement</code>,
37+ * and <code>PreparedStatement</code>, such as <code>getRowId</code> and <code>setRowId</code>
38+ * allow a programmer to access a SQL <code>ROWID</code> value. The <code>RowId</code>
39+ * interface provides a method
40+ * for representing the value of the <code>ROWID</code> as a byte array or as a
41+ * <code>String</code>.
42+ * <p>
43+ * The method <code>getRowIdLifetime</code> in the interface <code>DatabaseMetaData</code>,
44+ * can be used
45+ * to determine if a <code>RowId</code> object remains valid for the duration of the transaction in
46+ * which the <code>RowId</code> was created, the duration of the session in which
47+ * the <code>RowId</code> was created,
48+ * or, effectively, for as long as its identified row is not deleted. In addition
49+ * to specifying the duration of its valid lifetime outside its originating data
50+ * source, <code>getRowIdLifetime</code> specifies the duration of a <code>ROWID</code>
51+ * value's valid lifetime
52+ * within its originating data source. In this, it differs from a large object,
53+ * because there is no limit on the valid lifetime of a large object within its
54+ * originating data source.
55+ * <p>
56+ * All methods on the <code>RowId</code> interface must be fully implemented if the
57+ * JDBC driver supports the data type.
58+ *
59+ * @see java.sql.DatabaseMetaData
60+ * @since 1.6
61+ */
62+
63+public interface RowId {
64+ /**
65+ * Compares this <code>RowId</code> to the specified object. The result is
66+ * <code>true</code> if and only if the argument is not null and is a RowId
67+ * object that represents the same ROWID as this object.
68+ * <p>
69+ * It is important
70+ * to consider both the origin and the valid lifetime of a <code>RowId</code>
71+ * when comparing it to another <code>RowId</code>. If both are valid, and
72+ * both are from the same table on the same data source, then if they are equal
73+ * they identify
74+ * the same row; if one or more is no longer guaranteed to be valid, or if
75+ * they originate from different data sources, or different tables on the
76+ * same data source, they may be equal but still
77+ * not identify the same row.
78+ *
79+ * @param obj the <code>Object</code> to compare this <code>RowId</code> object
80+ * against.
81+ * @return true if the <code>RowId</code>s are equal; false otherwise
82+ * @since 1.6
83+ */
84+ boolean equals(Object obj);
85+
86+ /**
87+ * Returns an array of bytes representing the value of the SQL <code>ROWID</code>
88+ * designated by this <code>java.sql.RowId</code> object.
89+ *
90+ * @return an array of bytes, whose length is determined by the driver supplying
91+ * the connection, representing the value of the ROWID designated by this
92+ * java.sql.RowId object.
93+ */
94+ byte[] getBytes();
95+
96+ /**
97+ * Returns a String representing the value of the SQL ROWID designated by this
98+ * <code>java.sql.RowId</code> object.
99+ * <p>
100+ *Like <code>java.sql.Date.toString()</code>
101+ * returns the contents of its DATE as the <code>String</code> "2004-03-17"
102+ * rather than as DATE literal in SQL (which would have been the <code>String</code>
103+ * DATE "2004-03-17"), toString()
104+ * returns the contents of its ROWID in a form specific to the driver supplying
105+ * the connection, and possibly not as a <code>ROWID</code> literal.
106+ *
107+ * @return a String whose format is determined by the driver supplying the
108+ * connection, representing the value of the <code>ROWID</code> designated
109+ * by this <code>java.sql.RowId</code> object.
110+ */
111+ String toString();
112+
113+ /**
114+ * Returns a hash code value of this <code>RowId</code> object.
115+ *
116+ * @return a hash code for the <code>RowId</code>
117+ */
118+ int hashCode();
119+
120+}
java/pkg/java/sql/RowIdLifetime.class+0−0

Binary file not shown.

java/pkg/java/sql/RowIdLifetime.java+67−0
@@ -0,0 +1,67 @@
1+/*
2+ * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.*;
29+
30+/**
31+ * Enumeration for RowId life-time values.
32+ *
33+ * @since 1.6
34+ */
35+
36+public enum RowIdLifetime {
37+
38+ /**
39+ * Indicates that this data source does not support the ROWID type.
40+ */
41+ ROWID_UNSUPPORTED,
42+
43+ /**
44+ * Indicates that the lifetime of a RowId from this data source is indeterminate;
45+ * but not one of ROWID_VALID_TRANSACTION, ROWID_VALID_SESSION, or,
46+ * ROWID_VALID_FOREVER.
47+ */
48+ ROWID_VALID_OTHER,
49+
50+ /**
51+ * Indicates that the lifetime of a RowId from this data source is at least the
52+ * containing session.
53+ */
54+ ROWID_VALID_SESSION,
55+
56+ /**
57+ * Indicates that the lifetime of a RowId from this data source is at least the
58+ * containing transaction.
59+ */
60+ ROWID_VALID_TRANSACTION,
61+
62+ /**
63+ * Indicates that the lifetime of a RowId from this data source is, effectively,
64+ * unlimited.
65+ */
66+ ROWID_VALID_FOREVER
67+}
java/pkg/java/sql/SQLClientInfoException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLClientInfoException.java+321−0
@@ -0,0 +1,321 @@
1+/*
2+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+package java.sql;
26+
27+import java.util.Map;
28+
29+/**
30+ * The subclass of {@link SQLException} is thrown when one or more client info properties
31+ * could not be set on a <code>Connection</code>. In addition to the information provided
32+ * by <code>SQLException</code>, a <code>SQLClientInfoException</code> provides a list of client info
33+ * properties that were not set.
34+ *
35+ * Some databases do not allow multiple client info properties to be set
36+ * atomically. For those databases, it is possible that some of the client
37+ * info properties had been set even though the <code>Connection.setClientInfo</code>
38+ * method threw an exception. An application can use the <code>getFailedProperties </code>
39+ * method to retrieve a list of client info properties that were not set. The
40+ * properties are identified by passing a
41+ * <code>Map&lt;String,ClientInfoStatus&gt;</code> to
42+ * the appropriate <code>SQLClientInfoException</code> constructor.
43+ * <p>
44+ * @see ClientInfoStatus
45+ * @see Connection#setClientInfo
46+ * @since 1.6
47+ */
48+public class SQLClientInfoException extends SQLException {
49+
50+
51+
52+
53+ private Map<String, ClientInfoStatus> failedProperties;
54+
55+ /**
56+ * Constructs a <code>SQLClientInfoException</code> Object.
57+ * The <code>reason</code>,
58+ * <code>SQLState</code>, and failedProperties list are initialized to
59+ * <code> null</code> and the vendor code is initialized to 0.
60+ * The <code>cause</code> is not initialized, and may subsequently be
61+ * initialized by a call to the
62+ * {@link Throwable#initCause(java.lang.Throwable)} method.
63+ * <p>
64+ *
65+ * @since 1.6
66+ */
67+ public SQLClientInfoException() {
68+
69+ this.failedProperties = null;
70+ }
71+
72+ /**
73+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
74+ * given <code>failedProperties</code>.
75+ * The <code>reason</code> and <code>SQLState</code> are initialized
76+ * to <code>null</code> and the vendor code is initialized to 0.
77+ *
78+ * The <code>cause</code> is not initialized, and may subsequently be
79+ * initialized by a call to the
80+ * {@link Throwable#initCause(java.lang.Throwable)} method.
81+ * <p>
82+ *
83+ * @param failedProperties A Map containing the property values that could not
84+ * be set. The keys in the Map
85+ * contain the names of the client info
86+ * properties that could not be set and
87+ * the values contain one of the reason codes
88+ * defined in <code>ClientInfoStatus</code>
89+ * <p>
90+ * @since 1.6
91+ */
92+ public SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties) {
93+
94+ this.failedProperties = failedProperties;
95+ }
96+
97+ /**
98+ * Constructs a <code>SQLClientInfoException</code> object initialized with
99+ * a given <code>cause</code> and <code>failedProperties</code>.
100+ *
101+ * The <code>reason</code> is initialized to <code>null</code> if
102+ * <code>cause==null</code> or to <code>cause.toString()</code> if
103+ * <code>cause!=null</code> and the vendor code is initialized to 0.
104+ *
105+ * <p>
106+ *
107+ * @param failedProperties A Map containing the property values that could not
108+ * be set. The keys in the Map
109+ * contain the names of the client info
110+ * properties that could not be set and
111+ * the values contain one of the reason codes
112+ * defined in <code>ClientInfoStatus</code>
113+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
114+ * the cause is non-existent or unknown.
115+ * <p>
116+ * @since 1.6
117+ */
118+ public SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties,
119+ Throwable cause) {
120+
121+ super(cause != null?cause.toString():null);
122+ initCause(cause);
123+ this.failedProperties = failedProperties;
124+ }
125+
126+ /**
127+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
128+ * given <code>reason</code> and <code>failedProperties</code>.
129+ * The <code>SQLState</code> is initialized
130+ * to <code>null</code> and the vendor code is initialized to 0.
131+ *
132+ * The <code>cause</code> is not initialized, and may subsequently be
133+ * initialized by a call to the
134+ * {@link Throwable#initCause(java.lang.Throwable)} method.
135+ * <p>
136+ *
137+ * @param reason a description of the exception
138+ * @param failedProperties A Map containing the property values that could not
139+ * be set. The keys in the Map
140+ * contain the names of the client info
141+ * properties that could not be set and
142+ * the values contain one of the reason codes
143+ * defined in <code>ClientInfoStatus</code>
144+ * <p>
145+ * @since 1.6
146+ */
147+ public SQLClientInfoException(String reason,
148+ Map<String, ClientInfoStatus> failedProperties) {
149+
150+ super(reason);
151+ this.failedProperties = failedProperties;
152+ }
153+
154+ /**
155+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
156+ * given <code>reason</code>, <code>cause</code> and
157+ * <code>failedProperties</code>.
158+ * The <code>SQLState</code> is initialized
159+ * to <code>null</code> and the vendor code is initialized to 0.
160+ * <p>
161+ *
162+ * @param reason a description of the exception
163+ * @param failedProperties A Map containing the property values that could not
164+ * be set. The keys in the Map
165+ * contain the names of the client info
166+ * properties that could not be set and
167+ * the values contain one of the reason codes
168+ * defined in <code>ClientInfoStatus</code>
169+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
170+ * the cause is non-existent or unknown.
171+ * <p>
172+ * @since 1.6
173+ */
174+ public SQLClientInfoException(String reason,
175+ Map<String, ClientInfoStatus> failedProperties,
176+ Throwable cause) {
177+
178+ super(reason);
179+ initCause(cause);
180+ this.failedProperties = failedProperties;
181+ }
182+
183+ /**
184+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
185+ * given <code>reason</code>, <code>SQLState</code> and
186+ * <code>failedProperties</code>.
187+ * The <code>cause</code> is not initialized, and may subsequently be
188+ * initialized by a call to the
189+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
190+ * is initialized to 0.
191+ * <p>
192+ *
193+ * @param reason a description of the exception
194+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
195+ * @param failedProperties A Map containing the property values that could not
196+ * be set. The keys in the Map
197+ * contain the names of the client info
198+ * properties that could not be set and
199+ * the values contain one of the reason codes
200+ * defined in <code>ClientInfoStatus</code>
201+ * <p>
202+ * @since 1.6
203+ */
204+ public SQLClientInfoException(String reason,
205+ String SQLState,
206+ Map<String, ClientInfoStatus> failedProperties) {
207+
208+ super(reason, SQLState);
209+ this.failedProperties = failedProperties;
210+ }
211+
212+ /**
213+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
214+ * given <code>reason</code>, <code>SQLState</code>, <code>cause</code>
215+ * and <code>failedProperties</code>. The vendor code is initialized to 0.
216+ * <p>
217+ *
218+ * @param reason a description of the exception
219+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
220+ * @param failedProperties A Map containing the property values that could not
221+ * be set. The keys in the Map
222+ * contain the names of the client info
223+ * properties that could not be set and
224+ * the values contain one of the reason codes
225+ * defined in <code>ClientInfoStatus</code>
226+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
227+ * the cause is non-existent or unknown.
228+ * <p>
229+ * @since 1.6
230+ */
231+ public SQLClientInfoException(String reason,
232+ String SQLState,
233+ Map<String, ClientInfoStatus> failedProperties,
234+ Throwable cause) {
235+
236+ super(reason, SQLState);
237+ initCause(cause);
238+ this.failedProperties = failedProperties;
239+ }
240+
241+ /**
242+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
243+ * given <code>reason</code>, <code>SQLState</code>,
244+ * <code>vendorCode</code> and <code>failedProperties</code>.
245+ * The <code>cause</code> is not initialized, and may subsequently be
246+ * initialized by a call to the
247+ * {@link Throwable#initCause(java.lang.Throwable)} method.
248+ * <p>
249+ *
250+ * @param reason a description of the exception
251+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
252+ * @param vendorCode a database vendor-specific exception code
253+ * @param failedProperties A Map containing the property values that could not
254+ * be set. The keys in the Map
255+ * contain the names of the client info
256+ * properties that could not be set and
257+ * the values contain one of the reason codes
258+ * defined in <code>ClientInfoStatus</code>
259+ * <p>
260+ * @since 1.6
261+ */
262+ public SQLClientInfoException(String reason,
263+ String SQLState,
264+ int vendorCode,
265+ Map<String, ClientInfoStatus> failedProperties) {
266+
267+ super(reason, SQLState, vendorCode);
268+ this.failedProperties = failedProperties;
269+ }
270+
271+ /**
272+ * Constructs a <code>SQLClientInfoException</code> object initialized with a
273+ * given <code>reason</code>, <code>SQLState</code>,
274+ * <code>cause</code>, <code>vendorCode</code> and
275+ * <code>failedProperties</code>.
276+ * <p>
277+ *
278+ * @param reason a description of the exception
279+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
280+ * @param vendorCode a database vendor-specific exception code
281+ * @param failedProperties A Map containing the property values that could not
282+ * be set. The keys in the Map
283+ * contain the names of the client info
284+ * properties that could not be set and
285+ * the values contain one of the reason codes
286+ * defined in <code>ClientInfoStatus</code>
287+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
288+ * the cause is non-existent or unknown.
289+ * <p>
290+ * @since 1.6
291+ */
292+ public SQLClientInfoException(String reason,
293+ String SQLState,
294+ int vendorCode,
295+ Map<String, ClientInfoStatus> failedProperties,
296+ Throwable cause) {
297+
298+ super(reason, SQLState, vendorCode);
299+ initCause(cause);
300+ this.failedProperties = failedProperties;
301+ }
302+
303+ /**
304+ * Returns the list of client info properties that could not be set. The
305+ * keys in the Map contain the names of the client info
306+ * properties that could not be set and the values contain one of the
307+ * reason codes defined in <code>ClientInfoStatus</code>
308+ * <p>
309+ *
310+ * @return Map list containing the client info properties that could
311+ * not be set
312+ * <p>
313+ * @since 1.6
314+ */
315+ public Map<String, ClientInfoStatus> getFailedProperties() {
316+
317+ return this.failedProperties;
318+ }
319+
320+ private static final long serialVersionUID = -4319604256824655880L;
321+}
java/pkg/java/sql/SQLData.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLData.java+137−0
@@ -0,0 +1,137 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The interface used for the custom mapping of an SQL user-defined type (UDT) to
30+ * a class in the Java programming language. The class object for a class
31+ * implementing the <code>SQLData</code> interface will be entered in the
32+ * appropriate <code>Connection</code> object's type map along with the SQL
33+ * name of the UDT for which it is a custom mapping.
34+ * <P>
35+ * Typically, a <code>SQLData</code> implementation
36+ * will define a field for each attribute of an SQL structured type or a
37+ * single field for an SQL <code>DISTINCT</code> type. When the UDT is
38+ * retrieved from a data source with the <code>ResultSet.getObject</code>
39+ * method, it will be mapped as an instance of this class. A programmer
40+ * can operate on this class instance just as on any other object in the
41+ * Java programming language and then store any changes made to it by
42+ * calling the <code>PreparedStatement.setObject</code> method,
43+ * which will map it back to the SQL type.
44+ * <p>
45+ * It is expected that the implementation of the class for a custom
46+ * mapping will be done by a tool. In a typical implementation, the
47+ * programmer would simply supply the name of the SQL UDT, the name of
48+ * the class to which it is being mapped, and the names of the fields to
49+ * which each of the attributes of the UDT is to be mapped. The tool will use
50+ * this information to implement the <code>SQLData.readSQL</code> and
51+ * <code>SQLData.writeSQL</code> methods. The <code>readSQL</code> method
52+ * calls the appropriate <code>SQLInput</code> methods to read
53+ * each attribute from an <code>SQLInput</code> object, and the
54+ * <code>writeSQL</code> method calls <code>SQLOutput</code> methods
55+ * to write each attribute back to the data source via an
56+ * <code>SQLOutput</code> object.
57+ * <P>
58+ * An application programmer will not normally call <code>SQLData</code> methods
59+ * directly, and the <code>SQLInput</code> and <code>SQLOutput</code> methods
60+ * are called internally by <code>SQLData</code> methods, not by application code.
61+ *
62+ * @since 1.2
63+ */
64+public interface SQLData {
65+
66+ /**
67+ * Returns the fully-qualified
68+ * name of the SQL user-defined type that this object represents.
69+ * This method is called by the JDBC driver to get the name of the
70+ * UDT instance that is being mapped to this instance of
71+ * <code>SQLData</code>.
72+ *
73+ * @return the type name that was passed to the method <code>readSQL</code>
74+ * when this object was constructed and populated
75+ * @exception SQLException if there is a database access error
76+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
77+ * this method
78+ * @since 1.2
79+ */
80+ String getSQLTypeName() throws SQLException;
81+
82+ /**
83+ * Populates this object with data read from the database.
84+ * The implementation of the method must follow this protocol:
85+ * <UL>
86+ * <LI>It must read each of the attributes or elements of the SQL
87+ * type from the given input stream. This is done
88+ * by calling a method of the input stream to read each
89+ * item, in the order that they appear in the SQL definition
90+ * of the type.
91+ * <LI>The method <code>readSQL</code> then
92+ * assigns the data to appropriate fields or
93+ * elements (of this or other objects).
94+ * Specifically, it must call the appropriate <i>reader</i> method
95+ * (<code>SQLInput.readString</code>, <code>SQLInput.readBigDecimal</code>,
96+ * and so on) method(s) to do the following:
97+ * for a distinct type, read its single data element;
98+ * for a structured type, read a value for each attribute of the SQL type.
99+ * </UL>
100+ * The JDBC driver initializes the input stream with a type map
101+ * before calling this method, which is used by the appropriate
102+ * <code>SQLInput</code> reader method on the stream.
103+ *
104+ * @param stream the <code>SQLInput</code> object from which to read the data for
105+ * the value that is being custom mapped
106+ * @param typeName the SQL type name of the value on the data stream
107+ * @exception SQLException if there is a database access error
108+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
109+ * this method
110+ * @see SQLInput
111+ * @since 1.2
112+ */
113+ void readSQL (SQLInput stream, String typeName) throws SQLException;
114+
115+ /**
116+ * Writes this object to the given SQL data stream, converting it back to
117+ * its SQL value in the data source.
118+ * The implementation of the method must follow this protocol:<BR>
119+ * It must write each of the attributes of the SQL type
120+ * to the given output stream. This is done by calling a
121+ * method of the output stream to write each item, in the order that
122+ * they appear in the SQL definition of the type.
123+ * Specifically, it must call the appropriate <code>SQLOutput</code> writer
124+ * method(s) (<code>writeInt</code>, <code>writeString</code>, and so on)
125+ * to do the following: for a Distinct Type, write its single data element;
126+ * for a Structured Type, write a value for each attribute of the SQL type.
127+ *
128+ * @param stream the <code>SQLOutput</code> object to which to write the data for
129+ * the value that was custom mapped
130+ * @exception SQLException if there is a database access error
131+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
132+ * this method
133+ * @see SQLOutput
134+ * @since 1.2
135+ */
136+ void writeSQL (SQLOutput stream) throws SQLException;
137+}
java/pkg/java/sql/SQLDataException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLDataException.java+173−0
@@ -0,0 +1,173 @@
1+/*
2+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when the SQLState class value
30+ * is '<i>22</i>', or under vendor-specified conditions. This indicates
31+ * various data errors, including but not limited to data conversion errors,
32+ * division by 0, and invalid arguments to functions.
33+ * <p>
34+ * Please consult your driver vendor documentation for the vendor-specified
35+ * conditions for which this <code>Exception</code> may be thrown.
36+ * @since 1.6
37+ */
38+public class SQLDataException extends SQLNonTransientException {
39+
40+ /**
41+ * Constructs a <code>SQLDataException</code> object.
42+ * The <code>reason</code>, <code>SQLState</code> are initialized
43+ * to <code>null</code> and the vendor code is initialized to 0.
44+ *
45+ * The <code>cause</code> is not initialized, and may subsequently be
46+ * initialized by a call to
47+ * {@link Throwable#initCause(java.lang.Throwable)} method.
48+ * <p>
49+ *
50+ * @since 1.6
51+ */
52+ public SQLDataException() {
53+ super();
54+ }
55+
56+ /**
57+ * Constructs a <code>SQLDataException</code> object with a given
58+ * <code>reason</code>.
59+ * The <code>SQLState</code> is initialized
60+ * to <code>null</code> and the vendor code is initialized to 0.
61+ *
62+ * The <code>cause</code> is not initialized, and may subsequently be
63+ * initialized by a call to
64+ * {@link Throwable#initCause(java.lang.Throwable)} method.
65+ * <p>
66+ *
67+ * @param reason a description of the exception
68+ * @since 1.6
69+ */
70+ public SQLDataException(String reason) {
71+ super(reason);
72+ }
73+
74+ /**
75+ * Constructs a <code>SQLDataException</code> object with a given
76+ * <code>reason</code> and <code>SQLState</code>. The
77+ * vendor code is initialized to 0.
78+ *
79+ * The <code>cause</code> is not initialized, and may subsequently be
80+ * initialized by a call to
81+ * {@link Throwable#initCause(java.lang.Throwable)} method.
82+ * <p>
83+ * @param reason a description of the exception
84+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
85+ * @since 1.6
86+ */
87+ public SQLDataException(String reason, String SQLState) {
88+ super(reason, SQLState);
89+ }
90+
91+ /**
92+ * Constructs a <code>SQLDataException</code> object with a given
93+ * <code>reason</code>, <code>SQLState</code> and
94+ * <code>vendorCode</code>.
95+ *
96+ * The <code>cause</code> is not initialized, and may subsequently be
97+ * initialized by a call to
98+ * {@link Throwable#initCause(java.lang.Throwable)} method.
99+ * <p>
100+ * @param reason a description of the exception
101+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
102+ * @param vendorCode a database vendor specific exception code
103+ * @since 1.6
104+ */
105+ public SQLDataException(String reason, String SQLState, int vendorCode) {
106+ super(reason, SQLState, vendorCode);
107+ }
108+
109+ /**
110+ * Constructs a <code>SQLDataException</code> object with a given
111+ * <code>cause</code>.
112+ * The <code>SQLState</code> is initialized
113+ * to <code>null</code> and the vendor code is initialized to 0.
114+ * The <code>reason</code> is initialized to <code>null</code> if
115+ * <code>cause==null</code> or to <code>cause.toString()</code> if
116+ * <code>cause!=null</code>.
117+ * <p>
118+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
119+ * the cause is non-existent or unknown.
120+ * @since 1.6
121+ */
122+ public SQLDataException(Throwable cause) {
123+ super(cause);
124+ }
125+
126+ /**
127+ * Constructs a <code>SQLDataException</code> object with a given
128+ * <code>reason</code> and <code>cause</code>.
129+ * The <code>SQLState</code> is initialized to <code>null</code>
130+ * and the vendor code is initialized to 0.
131+ * <p>
132+ * @param reason a description of the exception.
133+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
134+ * the cause is non-existent or unknown.
135+ * @since 1.6
136+ */
137+ public SQLDataException(String reason, Throwable cause) {
138+ super(reason, cause);
139+ }
140+
141+ /**
142+ * Constructs a <code>SQLDataException</code> object with a given
143+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
144+ * The vendor code is initialized to 0.
145+ * <p>
146+ * @param reason a description of the exception.
147+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
148+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
149+ * the cause is non-existent or unknown.
150+ * @since 1.6
151+ */
152+ public SQLDataException(String reason, String SQLState, Throwable cause) {
153+ super(reason, SQLState, cause);
154+ }
155+
156+ /**
157+ * Constructs a <code>SQLDataException</code> object with a given
158+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
159+ * and <code>cause</code>.
160+ * <p>
161+ * @param reason a description of the exception
162+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
163+ * @param vendorCode a database vendor-specific exception code
164+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
165+ * the cause is non-existent or unknown.
166+ * @since 1.6
167+ */
168+ public SQLDataException(String reason, String SQLState, int vendorCode, Throwable cause) {
169+ super(reason, SQLState, vendorCode, cause);
170+ }
171+
172+ private static final long serialVersionUID = -6889123282670549800L;
173+}
java/pkg/java/sql/SQLException$1.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLException.java+375−0
@@ -0,0 +1,375 @@
1+/*
2+ * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+import java.util.Iterator;
29+import java.util.NoSuchElementException;
30+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
31+
32+/**
33+ * <P>An exception that provides information on a database access
34+ * error or other errors.
35+ *
36+ * <P>Each <code>SQLException</code> provides several kinds of information:
37+ * <UL>
38+ * <LI> a string describing the error. This is used as the Java Exception
39+ * message, available via the method <code>getMesasge</code>.
40+ * <LI> a "SQLstate" string, which follows either the XOPEN SQLstate conventions
41+ * or the SQL:2003 conventions.
42+ * The values of the SQLState string are described in the appropriate spec.
43+ * The <code>DatabaseMetaData</code> method <code>getSQLStateType</code>
44+ * can be used to discover whether the driver returns the XOPEN type or
45+ * the SQL:2003 type.
46+ * <LI> an integer error code that is specific to each vendor. Normally this will
47+ * be the actual error code returned by the underlying database.
48+ * <LI> a chain to a next Exception. This can be used to provide additional
49+ * error information.
50+ * <LI> the causal relationship, if any for this <code>SQLException</code>.
51+ * </UL>
52+ */
53+public class SQLException extends java.lang.Exception
54+ implements Iterable<Throwable> {
55+
56+ /**
57+ * Constructs a <code>SQLException</code> object with a given
58+ * <code>reason</code>, <code>SQLState</code> and
59+ * <code>vendorCode</code>.
60+ *
61+ * The <code>cause</code> is not initialized, and may subsequently be
62+ * initialized by a call to the
63+ * {@link Throwable#initCause(java.lang.Throwable)} method.
64+ * <p>
65+ * @param reason a description of the exception
66+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
67+ * @param vendorCode a database vendor-specific exception code
68+ */
69+ public SQLException(String reason, String SQLState, int vendorCode) {
70+ super(reason);
71+ this.SQLState = SQLState;
72+ this.vendorCode = vendorCode;
73+ if (!(this instanceof SQLWarning)) {
74+ if (DriverManager.getLogWriter() != null) {
75+ DriverManager.println("SQLState(" + SQLState +
76+ ") vendor code(" + vendorCode + ")");
77+ printStackTrace(DriverManager.getLogWriter());
78+ }
79+ }
80+ }
81+
82+
83+ /**
84+ * Constructs a <code>SQLException</code> object with a given
85+ * <code>reason</code> and <code>SQLState</code>.
86+ *
87+ * The <code>cause</code> is not initialized, and may subsequently be
88+ * initialized by a call to the
89+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
90+ * is initialized to 0.
91+ * <p>
92+ * @param reason a description of the exception
93+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
94+ */
95+ public SQLException(String reason, String SQLState) {
96+ super(reason);
97+ this.SQLState = SQLState;
98+ this.vendorCode = 0;
99+ if (!(this instanceof SQLWarning)) {
100+ if (DriverManager.getLogWriter() != null) {
101+ printStackTrace(DriverManager.getLogWriter());
102+ DriverManager.println("SQLException: SQLState(" + SQLState + ")");
103+ }
104+ }
105+ }
106+
107+ /**
108+ * Constructs a <code>SQLException</code> object with a given
109+ * <code>reason</code>. The <code>SQLState</code> is initialized to
110+ * <code>null</code> and the vender code is initialized to 0.
111+ *
112+ * The <code>cause</code> is not initialized, and may subsequently be
113+ * initialized by a call to the
114+ * {@link Throwable#initCause(java.lang.Throwable)} method.
115+ * <p>
116+ * @param reason a description of the exception
117+ */
118+ public SQLException(String reason) {
119+ super(reason);
120+ this.SQLState = null;
121+ this.vendorCode = 0;
122+ if (!(this instanceof SQLWarning)) {
123+ if (DriverManager.getLogWriter() != null) {
124+ printStackTrace(DriverManager.getLogWriter());
125+ }
126+ }
127+ }
128+
129+ /**
130+ * Constructs a <code>SQLException</code> object.
131+ * The <code>reason</code>, <code>SQLState</code> are initialized
132+ * to <code>null</code> and the vendor code is initialized to 0.
133+ *
134+ * The <code>cause</code> is not initialized, and may subsequently be
135+ * initialized by a call to the
136+ * {@link Throwable#initCause(java.lang.Throwable)} method.
137+ * <p>
138+ */
139+ public SQLException() {
140+ super();
141+ this.SQLState = null;
142+ this.vendorCode = 0;
143+ if (!(this instanceof SQLWarning)) {
144+ if (DriverManager.getLogWriter() != null) {
145+ printStackTrace(DriverManager.getLogWriter());
146+ }
147+ }
148+ }
149+
150+ /**
151+ * Constructs a <code>SQLException</code> object with a given
152+ * <code>cause</code>.
153+ * The <code>SQLState</code> is initialized
154+ * to <code>null</code> and the vendor code is initialized to 0.
155+ * The <code>reason</code> is initialized to <code>null</code> if
156+ * <code>cause==null</code> or to <code>cause.toString()</code> if
157+ * <code>cause!=null</code>.
158+ * <p>
159+ * @param cause the underlying reason for this <code>SQLException</code>
160+ * (which is saved for later retrieval by the <code>getCause()</code> method);
161+ * may be null indicating the cause is non-existent or unknown.
162+ * @since 1.6
163+ */
164+ public SQLException(Throwable cause) {
165+ super(cause);
166+
167+ if (!(this instanceof SQLWarning)) {
168+ if (DriverManager.getLogWriter() != null) {
169+ printStackTrace(DriverManager.getLogWriter());
170+ }
171+ }
172+ }
173+
174+ /**
175+ * Constructs a <code>SQLException</code> object with a given
176+ * <code>reason</code> and <code>cause</code>.
177+ * The <code>SQLState</code> is initialized to <code>null</code>
178+ * and the vendor code is initialized to 0.
179+ * <p>
180+ * @param reason a description of the exception.
181+ * @param cause the underlying reason for this <code>SQLException</code>
182+ * (which is saved for later retrieval by the <code>getCause()</code> method);
183+ * may be null indicating the cause is non-existent or unknown.
184+ * @since 1.6
185+ */
186+ public SQLException(String reason, Throwable cause) {
187+ super(reason,cause);
188+
189+ if (!(this instanceof SQLWarning)) {
190+ if (DriverManager.getLogWriter() != null) {
191+ printStackTrace(DriverManager.getLogWriter());
192+ }
193+ }
194+ }
195+
196+ /**
197+ * Constructs a <code>SQLException</code> object with a given
198+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
199+ * The vendor code is initialized to 0.
200+ * <p>
201+ * @param reason a description of the exception.
202+ * @param sqlState an XOPEN or SQL:2003 code identifying the exception
203+ * @param cause the underlying reason for this <code>SQLException</code>
204+ * (which is saved for later retrieval by the
205+ * <code>getCause()</code> method); may be null indicating
206+ * the cause is non-existent or unknown.
207+ * @since 1.6
208+ */
209+ public SQLException(String reason, String sqlState, Throwable cause) {
210+ super(reason,cause);
211+
212+ this.SQLState = sqlState;
213+ this.vendorCode = 0;
214+ if (!(this instanceof SQLWarning)) {
215+ if (DriverManager.getLogWriter() != null) {
216+ printStackTrace(DriverManager.getLogWriter());
217+ DriverManager.println("SQLState(" + SQLState + ")");
218+ }
219+ }
220+ }
221+
222+ /**
223+ * Constructs a <code>SQLException</code> object with a given
224+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
225+ * and <code>cause</code>.
226+ * <p>
227+ * @param reason a description of the exception
228+ * @param sqlState an XOPEN or SQL:2003 code identifying the exception
229+ * @param vendorCode a database vendor-specific exception code
230+ * @param cause the underlying reason for this <code>SQLException</code>
231+ * (which is saved for later retrieval by the <code>getCause()</code> method);
232+ * may be null indicating the cause is non-existent or unknown.
233+ * @since 1.6
234+ */
235+ public SQLException(String reason, String sqlState, int vendorCode, Throwable cause) {
236+ super(reason,cause);
237+
238+ this.SQLState = sqlState;
239+ this.vendorCode = vendorCode;
240+ if (!(this instanceof SQLWarning)) {
241+ if (DriverManager.getLogWriter() != null) {
242+ DriverManager.println("SQLState(" + SQLState +
243+ ") vendor code(" + vendorCode + ")");
244+ printStackTrace(DriverManager.getLogWriter());
245+ }
246+ }
247+ }
248+
249+ /**
250+ * Retrieves the SQLState for this <code>SQLException</code> object.
251+ *
252+ * @return the SQLState value
253+ */
254+ public String getSQLState() {
255+ return (SQLState);
256+ }
257+
258+ /**
259+ * Retrieves the vendor-specific exception code
260+ * for this <code>SQLException</code> object.
261+ *
262+ * @return the vendor's error code
263+ */
264+ public int getErrorCode() {
265+ return (vendorCode);
266+ }
267+
268+ /**
269+ * Retrieves the exception chained to this
270+ * <code>SQLException</code> object by setNextException(SQLException ex).
271+ *
272+ * @return the next <code>SQLException</code> object in the chain;
273+ * <code>null</code> if there are none
274+ * @see #setNextException
275+ */
276+ public SQLException getNextException() {
277+ return (next);
278+ }
279+
280+ /**
281+ * Adds an <code>SQLException</code> object to the end of the chain.
282+ *
283+ * @param ex the new exception that will be added to the end of
284+ * the <code>SQLException</code> chain
285+ * @see #getNextException
286+ */
287+ public void setNextException(SQLException ex) {
288+
289+ SQLException current = this;
290+ for(;;) {
291+ SQLException next=current.next;
292+ if (next != null) {
293+ current = next;
294+ continue;
295+ }
296+
297+ if (nextUpdater.compareAndSet(current,null,ex)) {
298+ return;
299+ }
300+ current=current.next;
301+ }
302+ }
303+
304+ /**
305+ * Returns an iterator over the chained SQLExceptions. The iterator will
306+ * be used to iterate over each SQLException and its underlying cause
307+ * (if any).
308+ *
309+ * @return an iterator over the chained SQLExceptions and causes in the proper
310+ * order
311+ *
312+ * @since 1.6
313+ */
314+ public Iterator<Throwable> iterator() {
315+
316+ return new Iterator<Throwable>() {
317+
318+ SQLException firstException = SQLException.this;
319+ SQLException nextException = firstException.getNextException();
320+ Throwable cause = firstException.getCause();
321+
322+ public boolean hasNext() {
323+ if(firstException != null || nextException != null || cause != null)
324+ return true;
325+ return false;
326+ }
327+
328+ public Throwable next() {
329+ Throwable throwable = null;
330+ if(firstException != null){
331+ throwable = firstException;
332+ firstException = null;
333+ }
334+ else if(cause != null){
335+ throwable = cause;
336+ cause = cause.getCause();
337+ }
338+ else if(nextException != null){
339+ throwable = nextException;
340+ cause = nextException.getCause();
341+ nextException = nextException.getNextException();
342+ }
343+ else
344+ throw new NoSuchElementException();
345+ return throwable;
346+ }
347+
348+ public void remove() {
349+ throw new UnsupportedOperationException();
350+ }
351+
352+ };
353+
354+ }
355+
356+ /**
357+ * @serial
358+ */
359+ private String SQLState;
360+
361+ /**
362+ * @serial
363+ */
364+ private int vendorCode;
365+
366+ /**
367+ * @serial
368+ */
369+ private volatile SQLException next;
370+
371+ private static final AtomicReferenceFieldUpdater<SQLException,SQLException> nextUpdater =
372+ AtomicReferenceFieldUpdater.newUpdater(SQLException.class,SQLException.class,"next");
373+
374+ private static final long serialVersionUID = 2135244094396331484L;
375+}
java/pkg/java/sql/SQLFeatureNotSupportedException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLFeatureNotSupportedException.java+179−0
@@ -0,0 +1,179 @@
1+/*
2+ * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when the SQLState class value is '<i>0A</i>'
30+ * ( the value is 'zero' A).
31+ * This indicates that the JDBC driver does not support an optional JDBC feature.
32+ * Optional JDBC features can fall into the fallowing categories:
33+ *<p>
34+ *<UL>
35+ *<LI>no support for an optional feature
36+ *<LI>no support for an optional overloaded method
37+ *<LI>no support for an optional mode for a method. The mode for a method is
38+ *determined based on constants passed as parameter values to a method
39+ *</UL>
40+ *
41+ * @since 1.6
42+ */
43+public class SQLFeatureNotSupportedException extends SQLNonTransientException {
44+
45+ /**
46+ * Constructs a <code>SQLFeatureNotSupportedException</code> object.
47+ * The <code>reason</code>, <code>SQLState</code> are initialized
48+ * to <code>null</code> and the vendor code is initialized to 0.
49+ *
50+ * The <code>cause</code> is not initialized, and may subsequently be
51+ * initialized by a call to the
52+ * {@link Throwable#initCause(java.lang.Throwable)} method.
53+ * <p>
54+ * @since 1.6
55+ */
56+ public SQLFeatureNotSupportedException() {
57+ super();
58+ }
59+
60+ /**
61+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
62+ * with a given <code>reason</code>. The <code>SQLState</code>
63+ * is initialized to <code>null</code> and the vender code is initialized
64+ * to 0.
65+ *
66+ * The <code>cause</code> is not initialized, and may subsequently be
67+ * initialized by a call to the
68+ * {@link Throwable#initCause(java.lang.Throwable)} method.
69+ * <p>
70+ * @param reason a description of the exception
71+ * @since 1.6
72+ */
73+ public SQLFeatureNotSupportedException(String reason) {
74+ super(reason);
75+ }
76+
77+ /**
78+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
79+ * with a given <code>reason</code> and <code>SQLState</code>.
80+ *
81+ * The <code>cause</code> is not initialized, and may subsequently be
82+ * initialized by a call to the
83+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
84+ * is initialized to 0.
85+ * <p>
86+ * @param reason a description of the exception
87+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
88+ * @since 1.6
89+ */
90+ public SQLFeatureNotSupportedException(String reason, String SQLState) {
91+ super(reason,SQLState);
92+ }
93+
94+ /**
95+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
96+ * with a given <code>reason</code>, <code>SQLState</code> and
97+ * <code>vendorCode</code>.
98+ *
99+ * The <code>cause</code> is not initialized, and may subsequently be
100+ * initialized by a call to the
101+ * {@link Throwable#initCause(java.lang.Throwable)} method.
102+ * <p>
103+ * @param reason a description of the exception
104+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
105+ * @param vendorCode a database vendor specific exception code
106+ * @since 1.6
107+ */
108+ public SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode) {
109+ super(reason,SQLState,vendorCode);
110+ }
111+
112+ /**
113+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
114+ * with a given <code>cause</code>.
115+ * The <code>SQLState</code> is initialized
116+ * to <code>null</code> and the vendor code is initialized to 0.
117+ * The <code>reason</code> is initialized to <code>null</code> if
118+ * <code>cause==null</code> or to <code>cause.toString()</code> if
119+ * <code>cause!=null</code>.
120+ * <p>
121+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval bythe <code>getCause()</code> method); may be null indicating
122+ * the cause is non-existent or unknown.
123+ * @since 1.6
124+ */
125+ public SQLFeatureNotSupportedException(Throwable cause) {
126+ super(cause);
127+ }
128+
129+ /**
130+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
131+ * with a given
132+ * <code>reason</code> and <code>cause</code>.
133+ * The <code>SQLState</code> is initialized to <code>null</code>
134+ * and the vendor code is initialized to 0.
135+ * <p>
136+ * @param reason a description of the exception.
137+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
138+ * the cause is non-existent or unknown.
139+ * @since 1.6
140+ */
141+ public SQLFeatureNotSupportedException(String reason, Throwable cause) {
142+ super(reason,cause);
143+ }
144+
145+ /**
146+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
147+ * with a given
148+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
149+ * The vendor code is initialized to 0.
150+ * <p>
151+ * @param reason a description of the exception.
152+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
153+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
154+ * the cause is non-existent or unknown.
155+ * @since 1.6
156+ */
157+ public SQLFeatureNotSupportedException(String reason, String SQLState, Throwable cause) {
158+ super(reason,SQLState,cause);
159+ }
160+
161+ /**
162+ * Constructs a <code>SQLFeatureNotSupportedException</code> object
163+ * with a given
164+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
165+ * and <code>cause</code>.
166+ * <p>
167+ * @param reason a description of the exception
168+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
169+ * @param vendorCode a database vendor-specific exception code
170+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
171+ * the cause is non-existent or unknown.
172+ * @since 1.6
173+ */
174+ public SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode, Throwable cause) {
175+ super(reason,SQLState,vendorCode,cause);
176+ }
177+
178+ private static final long serialVersionUID = -1026510870282316051L;
179+}
java/pkg/java/sql/SQLInput.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLInput.java+424−0
@@ -0,0 +1,424 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * An input stream that contains a stream of values representing an
30+ * instance of an SQL structured type or an SQL distinct type.
31+ * This interface, used only for custom mapping, is used by the driver
32+ * behind the scenes, and a programmer never directly invokes
33+ * <code>SQLInput</code> methods. The <i>reader</i> methods
34+ * (<code>readLong</code>, <code>readBytes</code>, and so on)
35+ * provide a way for an implementation of the <code>SQLData</code>
36+ * interface to read the values in an <code>SQLInput</code> object.
37+ * And as described in <code>SQLData</code>, calls to reader methods must
38+ * be made in the order that their corresponding attributes appear in the
39+ * SQL definition of the type.
40+ * The method <code>wasNull</code> is used to determine whether
41+ * the last value read was SQL <code>NULL</code>.
42+ * <P>When the method <code>getObject</code> is called with an
43+ * object of a class implementing the interface <code>SQLData</code>,
44+ * the JDBC driver calls the method <code>SQLData.getSQLType</code>
45+ * to determine the SQL type of the user-defined type (UDT)
46+ * being custom mapped. The driver
47+ * creates an instance of <code>SQLInput</code>, populating it with the
48+ * attributes of the UDT. The driver then passes the input
49+ * stream to the method <code>SQLData.readSQL</code>, which in turn
50+ * calls the <code>SQLInput</code> reader methods
51+ * in its implementation for reading the
52+ * attributes from the input stream.
53+ * @since 1.2
54+ */
55+
56+public interface SQLInput {
57+
58+
59+ //================================================================
60+ // Methods for reading attributes from the stream of SQL data.
61+ // These methods correspond to the column-accessor methods of
62+ // java.sql.ResultSet.
63+ //================================================================
64+
65+ /**
66+ * Reads the next attribute in the stream and returns it as a <code>String</code>
67+ * in the Java programming language.
68+ *
69+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
70+ * @exception SQLException if a database access error occurs
71+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
72+ * this method
73+ * @since 1.2
74+ */
75+ String readString() throws SQLException;
76+
77+ /**
78+ * Reads the next attribute in the stream and returns it as a <code>boolean</code>
79+ * in the Java programming language.
80+ *
81+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>false</code>
82+ * @exception SQLException if a database access error occurs
83+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
84+ * this method
85+ * @since 1.2
86+ */
87+ boolean readBoolean() throws SQLException;
88+
89+ /**
90+ * Reads the next attribute in the stream and returns it as a <code>byte</code>
91+ * in the Java programming language.
92+ *
93+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
94+ * @exception SQLException if a database access error occurs
95+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
96+ * this method
97+ * @since 1.2
98+ */
99+ byte readByte() throws SQLException;
100+
101+ /**
102+ * Reads the next attribute in the stream and returns it as a <code>short</code>
103+ * in the Java programming language.
104+ *
105+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
106+ * @exception SQLException if a database access error occurs
107+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
108+ * this method
109+ * @since 1.2
110+ */
111+ short readShort() throws SQLException;
112+
113+ /**
114+ * Reads the next attribute in the stream and returns it as an <code>int</code>
115+ * in the Java programming language.
116+ *
117+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
118+ * @exception SQLException if a database access error occurs
119+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
120+ * this method
121+ * @since 1.2
122+ */
123+ int readInt() throws SQLException;
124+
125+ /**
126+ * Reads the next attribute in the stream and returns it as a <code>long</code>
127+ * in the Java programming language.
128+ *
129+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
130+ * @exception SQLException if a database access error occurs
131+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
132+ * this method
133+ * @since 1.2
134+ */
135+ long readLong() throws SQLException;
136+
137+ /**
138+ * Reads the next attribute in the stream and returns it as a <code>float</code>
139+ * in the Java programming language.
140+ *
141+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
142+ * @exception SQLException if a database access error occurs
143+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
144+ * this method
145+ * @since 1.2
146+ */
147+ float readFloat() throws SQLException;
148+
149+ /**
150+ * Reads the next attribute in the stream and returns it as a <code>double</code>
151+ * in the Java programming language.
152+ *
153+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
154+ * @exception SQLException if a database access error occurs
155+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
156+ * this method
157+ * @since 1.2
158+ */
159+ double readDouble() throws SQLException;
160+
161+ /**
162+ * Reads the next attribute in the stream and returns it as a <code>java.math.BigDecimal</code>
163+ * object in the Java programming language.
164+ *
165+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
166+ * @exception SQLException if a database access error occurs
167+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
168+ * this method
169+ * @since 1.2
170+ */
171+ java.math.BigDecimal readBigDecimal() throws SQLException;
172+
173+ /**
174+ * Reads the next attribute in the stream and returns it as an array of bytes
175+ * in the Java programming language.
176+ *
177+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
178+ * @exception SQLException if a database access error occurs
179+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
180+ * this method
181+ * @since 1.2
182+ */
183+ byte[] readBytes() throws SQLException;
184+
185+ /**
186+ * Reads the next attribute in the stream and returns it as a <code>java.sql.Date</code> object.
187+ *
188+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
189+ * @exception SQLException if a database access error occurs
190+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
191+ * this method
192+ * @since 1.2
193+ */
194+ java.sql.Date readDate() throws SQLException;
195+
196+ /**
197+ * Reads the next attribute in the stream and returns it as a <code>java.sql.Time</code> object.
198+ *
199+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
200+ * @exception SQLException if a database access error occurs
201+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
202+ * this method
203+ * @since 1.2
204+ */
205+ java.sql.Time readTime() throws SQLException;
206+
207+ /**
208+ * Reads the next attribute in the stream and returns it as a <code>java.sql.Timestamp</code> object.
209+ *
210+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
211+ * @exception SQLException if a database access error occurs
212+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
213+ * this method
214+ * @since 1.2
215+ */
216+ java.sql.Timestamp readTimestamp() throws SQLException;
217+
218+ /**
219+ * Reads the next attribute in the stream and returns it as a stream of Unicode characters.
220+ *
221+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
222+ * @exception SQLException if a database access error occurs
223+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
224+ * this method
225+ * @since 1.2
226+ */
227+ java.io.Reader readCharacterStream() throws SQLException;
228+
229+ /**
230+ * Reads the next attribute in the stream and returns it as a stream of ASCII characters.
231+ *
232+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
233+ * @exception SQLException if a database access error occurs
234+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
235+ * this method
236+ * @since 1.2
237+ */
238+ java.io.InputStream readAsciiStream() throws SQLException;
239+
240+ /**
241+ * Reads the next attribute in the stream and returns it as a stream of uninterpreted
242+ * bytes.
243+ *
244+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
245+ * @exception SQLException if a database access error occurs
246+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
247+ * this method
248+ * @since 1.2
249+ */
250+ java.io.InputStream readBinaryStream() throws SQLException;
251+
252+ //================================================================
253+ // Methods for reading items of SQL user-defined types from the stream.
254+ //================================================================
255+
256+ /**
257+ * Reads the datum at the head of the stream and returns it as an
258+ * <code>Object</code> in the Java programming language. The
259+ * actual type of the object returned is determined by the default type
260+ * mapping, and any customizations present in this stream's type map.
261+ *
262+ * <P>A type map is registered with the stream by the JDBC driver before the
263+ * stream is passed to the application.
264+ *
265+ * <P>When the datum at the head of the stream is an SQL <code>NULL</code>,
266+ * the method returns <code>null</code>. If the datum is an SQL structured or distinct
267+ * type, it determines the SQL type of the datum at the head of the stream.
268+ * If the stream's type map has an entry for that SQL type, the driver
269+ * constructs an object of the appropriate class and calls the method
270+ * <code>SQLData.readSQL</code> on that object, which reads additional data from the
271+ * stream, using the protocol described for that method.
272+ *
273+ * @return the datum at the head of the stream as an <code>Object</code> in the
274+ * Java programming language;<code>null</code> if the datum is SQL <code>NULL</code>
275+ * @exception SQLException if a database access error occurs
276+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
277+ * this method
278+ * @since 1.2
279+ */
280+ Object readObject() throws SQLException;
281+
282+ /**
283+ * Reads an SQL <code>REF</code> value from the stream and returns it as a
284+ * <code>Ref</code> object in the Java programming language.
285+ *
286+ * @return a <code>Ref</code> object representing the SQL <code>REF</code> value
287+ * at the head of the stream; <code>null</code> if the value read is
288+ * SQL <code>NULL</code>
289+ * @exception SQLException if a database access error occurs
290+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
291+ * this method
292+ * @since 1.2
293+ */
294+ Ref readRef() throws SQLException;
295+
296+ /**
297+ * Reads an SQL <code>BLOB</code> value from the stream and returns it as a
298+ * <code>Blob</code> object in the Java programming language.
299+ *
300+ * @return a <code>Blob</code> object representing data of the SQL <code>BLOB</code> value
301+ * at the head of the stream; <code>null</code> if the value read is
302+ * SQL <code>NULL</code>
303+ * @exception SQLException if a database access error occurs
304+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
305+ * this method
306+ * @since 1.2
307+ */
308+ Blob readBlob() throws SQLException;
309+
310+ /**
311+ * Reads an SQL <code>CLOB</code> value from the stream and returns it as a
312+ * <code>Clob</code> object in the Java programming language.
313+ *
314+ * @return a <code>Clob</code> object representing data of the SQL <code>CLOB</code> value
315+ * at the head of the stream; <code>null</code> if the value read is
316+ * SQL <code>NULL</code>
317+ * @exception SQLException if a database access error occurs
318+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
319+ * this method
320+ * @since 1.2
321+ */
322+ Clob readClob() throws SQLException;
323+
324+ /**
325+ * Reads an SQL <code>ARRAY</code> value from the stream and returns it as an
326+ * <code>Array</code> object in the Java programming language.
327+ *
328+ * @return an <code>Array</code> object representing data of the SQL
329+ * <code>ARRAY</code> value at the head of the stream; <code>null</code>
330+ * if the value read is SQL <code>NULL</code>
331+ * @exception SQLException if a database access error occurs
332+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
333+ * this method
334+ * @since 1.2
335+ */
336+ Array readArray() throws SQLException;
337+
338+ /**
339+ * Retrieves whether the last value read was SQL <code>NULL</code>.
340+ *
341+ * @return <code>true</code> if the most recently read SQL value was SQL
342+ * <code>NULL</code>; <code>false</code> otherwise
343+ * @exception SQLException if a database access error occurs
344+ *
345+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
346+ * this method
347+ * @since 1.2
348+ */
349+ boolean wasNull() throws SQLException;
350+
351+ //---------------------------- JDBC 3.0 -------------------------
352+
353+ /**
354+ * Reads an SQL <code>DATALINK</code> value from the stream and returns it as a
355+ * <code>java.net.URL</code> object in the Java programming language.
356+ *
357+ * @return a <code>java.net.URL</code> object.
358+ * @exception SQLException if a database access error occurs,
359+ * or if a URL is malformed
360+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
361+ * this method
362+ * @since 1.4
363+ */
364+ java.net.URL readURL() throws SQLException;
365+
366+ //---------------------------- JDBC 4.0 -------------------------
367+
368+ /**
369+ * Reads an SQL <code>NCLOB</code> value from the stream and returns it as a
370+ * <code>NClob</code> object in the Java programming language.
371+ *
372+ * @return a <code>NClob</code> object representing data of the SQL <code>NCLOB</code> value
373+ * at the head of the stream; <code>null</code> if the value read is
374+ * SQL <code>NULL</code>
375+ * @exception SQLException if a database access error occurs
376+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
377+ * this method
378+ * @since 1.6
379+ */
380+ NClob readNClob() throws SQLException;
381+
382+ /**
383+ * Reads the next attribute in the stream and returns it as a <code>String</code>
384+ * in the Java programming language. It is intended for use when
385+ * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
386+ * and <code>LONGNVARCHAR</code> columns.
387+ *
388+ * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
389+ * @exception SQLException if a database access error occurs
390+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
391+ * this method
392+ * @since 1.6
393+ */
394+ String readNString() throws SQLException;
395+
396+ /**
397+ * Reads an SQL <code>XML</code> value from the stream and returns it as a
398+ * <code>SQLXML</code> object in the Java programming language.
399+ *
400+ * @return a <code>SQLXML</code> object representing data of the SQL <code>XML</code> value
401+ * at the head of the stream; <code>null</code> if the value read is
402+ * SQL <code>NULL</code>
403+ * @exception SQLException if a database access error occurs
404+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
405+ * this method
406+ * @since 1.6
407+ */
408+ SQLXML readSQLXML() throws SQLException;
409+
410+ /**
411+ * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
412+ * <code>RowId</code> object in the Java programming language.
413+ *
414+ * @return a <code>RowId</code> object representing data of the SQL <code>ROWID</code> value
415+ * at the head of the stream; <code>null</code> if the value read is
416+ * SQL <code>NULL</code>
417+ * @exception SQLException if a database access error occurs
418+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
419+ * this method
420+ * @since 1.6
421+ */
422+ RowId readRowId() throws SQLException;
423+
424+}
java/pkg/java/sql/SQLIntegrityConstraintViolationException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLIntegrityConstraintViolationException.java+174−0
@@ -0,0 +1,174 @@
1+/*
2+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when the SQLState class value
30+ * is '<i>23</i>', or under vendor-specified conditions.
31+ * This indicates that an integrity
32+ * constraint (foreign key, primary key or unique key) has been violated.
33+ * <p>
34+ * Please consult your driver vendor documentation for the vendor-specified
35+ * conditions for which this <code>Exception</code> may be thrown.
36+ * @since 1.6
37+ */
38+public class SQLIntegrityConstraintViolationException extends SQLNonTransientException {
39+
40+ /**
41+ * Constructs a <code>SQLIntegrityConstraintViolationException</code> object.
42+ * The <code>reason</code>, <code>SQLState</code> are initialized
43+ * to <code>null</code> and the vendor code is initialized to 0.
44+ *
45+ * The <code>cause</code> is not initialized, and may subsequently be
46+ * initialized by a call to the
47+ * {@link Throwable#initCause(java.lang.Throwable)} method.
48+ * <p>
49+ * @since 1.6
50+ */
51+ public SQLIntegrityConstraintViolationException() {
52+ super();
53+ }
54+
55+ /**
56+ * Constructs a <code>SQLIntegrityConstraintViolationException</code>
57+ * with a given <code>reason</code>. The <code>SQLState</code>
58+ * is initialized to <code>null</code> and the vender code is initialized
59+ * to 0.
60+ *
61+ * The <code>cause</code> is not initialized, and may subsequently be
62+ * initialized by a call to the
63+ * {@link Throwable#initCause(java.lang.Throwable)} method.
64+ * <p>
65+ * @param reason a description of the exception
66+ * @since 1.6
67+ */
68+ public SQLIntegrityConstraintViolationException(String reason) {
69+ super(reason);
70+ }
71+
72+ /**
73+ * Constructs a <code>SQLIntegrityConstraintViolationException</code>
74+ * object with a given <code>reason</code> and <code>SQLState</code>.
75+ *
76+ * The <code>cause</code> is not initialized, and may subsequently be
77+ * initialized by a call to the
78+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
79+ * is initialized to 0.
80+ * <p>
81+ * @param reason a description of the exception
82+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
83+ * @since 1.6
84+ */
85+ public SQLIntegrityConstraintViolationException(String reason, String SQLState) {
86+ super(reason,SQLState);
87+ }
88+
89+ /**
90+ * Constructs a <code>SQLIntegrityConstraintViolationException</code> object
91+ * with a given <code>reason</code>, <code>SQLState</code> and
92+ * <code>vendorCode</code>.
93+ *
94+ * The <code>cause</code> is not initialized, and may subsequently be
95+ * initialized by a call to the
96+ * {@link Throwable#initCause(java.lang.Throwable)} method.
97+ * <p>
98+ * @param reason a description of the exception
99+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
100+ * @param vendorCode a database vendor specific exception code
101+ * @since 1.6
102+ */
103+ public SQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode) {
104+ super(reason,SQLState,vendorCode);
105+ }
106+
107+ /**
108+ * Constructs an <code>SQLIntegrityConstraintViolationException</code> object with
109+ * a given <code>cause</code>.
110+ * The <code>SQLState</code> is initialized
111+ * to <code>null</code> and the vendor code is initialized to 0.
112+ * The <code>reason</code> is initialized to <code>null</code> if
113+ * <code>cause==null</code> or to <code>cause.toString()</code> if
114+ * <code>cause!=null</code>.
115+ * <p>
116+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
117+ * the cause is non-existent or unknown.
118+ * @since 1.6
119+ */
120+ public SQLIntegrityConstraintViolationException(Throwable cause) {
121+ super(cause);
122+ }
123+
124+ /**
125+ * Constructs a <code>SQLIntegrityConstraintViolationException</code> object
126+ * with a given
127+ * <code>reason</code> and <code>cause</code>.
128+ * The <code>SQLState</code> is initialized to <code>null</code>
129+ * and the vendor code is initialized to 0.
130+ * <p>
131+ * @param reason a description of the exception.
132+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
133+ * the cause is non-existent or unknown.
134+ * @since 1.6
135+ */
136+ public SQLIntegrityConstraintViolationException(String reason, Throwable cause) {
137+ super(reason,cause);
138+ }
139+
140+ /**
141+ * Constructs a <code>SQLIntegrityConstraintViolationException</code> object
142+ * with a given
143+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
144+ * The vendor code is initialized to 0.
145+ * <p>
146+ * @param reason a description of the exception.
147+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
148+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
149+ * the cause is non-existent or unknown.
150+ * @since 1.6
151+ */
152+ public SQLIntegrityConstraintViolationException(String reason, String SQLState, Throwable cause) {
153+ super(reason,SQLState, cause);
154+ }
155+
156+ /**
157+ * Constructs a <code>SQLIntegrityConstraintViolationException</code> object
158+ * with a given
159+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
160+ * and <code>cause</code>.
161+ * <p>
162+ * @param reason a description of the exception
163+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
164+ * @param vendorCode a database vendor-specific exception code
165+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
166+ * the cause is non-existent or unknown.
167+ * @since 1.6
168+ */
169+ public SQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode, Throwable cause) {
170+ super(reason,SQLState,vendorCode,cause);
171+ }
172+
173+ private static final long serialVersionUID = 8033405298774849169L;
174+}
java/pkg/java/sql/SQLInvalidAuthorizationSpecException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLInvalidAuthorizationSpecException.java+174−0
@@ -0,0 +1,174 @@
1+/*
2+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when the SQLState class value
30+ * is '<i>28</i>', or under vendor-specified conditions. This indicates that
31+ * the authorization credentials presented during connection establishment
32+ * are not valid.
33+ * <p>
34+ * Please consult your driver vendor documentation for the vendor-specified
35+ * conditions for which this <code>Exception</code> may be thrown.
36+ * @since 1.6
37+ */
38+public class SQLInvalidAuthorizationSpecException extends SQLNonTransientException {
39+
40+ /**
41+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object.
42+ * The <code>reason</code>, <code>SQLState</code> are initialized
43+ * to <code>null</code> and the vendor code is initialized to 0.
44+ *
45+ * The <code>cause</code> is not initialized, and may subsequently be
46+ * initialized by a call to the
47+ * {@link Throwable#initCause(java.lang.Throwable)} method.
48+ * <p>
49+ * @since 1.6
50+ */
51+ public SQLInvalidAuthorizationSpecException() {
52+ super();
53+ }
54+
55+ /**
56+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
57+ * with a given <code>reason</code>. The <code>SQLState</code>
58+ * is initialized to <code>null</code> and the vender code is initialized
59+ * to 0.
60+ *
61+ * The <code>cause</code> is not initialized, and may subsequently be
62+ * initialized by a call to the
63+ * {@link Throwable#initCause(java.lang.Throwable)} method.
64+ * <p>
65+ * @param reason a description of the exception
66+ * @since 1.6
67+ */
68+ public SQLInvalidAuthorizationSpecException(String reason) {
69+ super(reason);
70+ }
71+
72+ /**
73+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
74+ * with a given <code>reason</code> and <code>SQLState</code>.
75+ *
76+ * The <code>cause</code> is not initialized, and may subsequently be
77+ * initialized by a call to the
78+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
79+ * is initialized to 0.
80+ * <p>
81+ * @param reason a description of the exception
82+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
83+ * @since 1.6
84+ */
85+ public SQLInvalidAuthorizationSpecException(String reason, String SQLState) {
86+ super(reason,SQLState);
87+ }
88+
89+ /**
90+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
91+ * with a given <code>reason</code>, <code>SQLState</code> and
92+ * <code>vendorCode</code>.
93+ *
94+ * The <code>cause</code> is not initialized, and may subsequently be
95+ * initialized by a call to the
96+ * {@link Throwable#initCause(java.lang.Throwable)} method.
97+ * <p>
98+ * @param reason a description of the exception
99+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
100+ * @param vendorCode a database vendor specific exception code
101+ * @since 1.6
102+ */
103+ public SQLInvalidAuthorizationSpecException(String reason, String SQLState, int vendorCode) {
104+ super(reason,SQLState,vendorCode);
105+ }
106+
107+ /**
108+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
109+ * with a given <code>cause</code>.
110+ * The <code>SQLState</code> is initialized
111+ * to <code>null</code> and the vendor code is initialized to 0.
112+ * The <code>reason</code> is initialized to <code>null</code> if
113+ * <code>cause==null</code> or to <code>cause.toString()</code> if
114+ * <code>cause!=null</code>.
115+ * <p>
116+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
117+ * the cause is non-existent or unknown.
118+ * @since 1.6
119+ */
120+ public SQLInvalidAuthorizationSpecException(Throwable cause) {
121+ super(cause);
122+ }
123+
124+ /**
125+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
126+ * with a given
127+ * <code>reason</code> and <code>cause</code>.
128+ * The <code>SQLState</code> is initialized to <code>null</code>
129+ * and the vendor code is initialized to 0.
130+ * <p>
131+ * @param reason a description of the exception.
132+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
133+ * the cause is non-existent or unknown.
134+ * @since 1.6
135+ */
136+ public SQLInvalidAuthorizationSpecException(String reason, Throwable cause) {
137+ super(reason,cause);
138+ }
139+
140+ /**
141+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
142+ * with a given
143+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
144+ * The vendor code is initialized to 0.
145+ * <p>
146+ * @param reason a description of the exception.
147+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
148+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
149+ * the cause is non-existent or unknown.
150+ * @since 1.6
151+ */
152+ public SQLInvalidAuthorizationSpecException(String reason, String SQLState, Throwable cause) {
153+ super(reason,SQLState,cause);
154+ }
155+
156+ /**
157+ * Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
158+ * with a given
159+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
160+ * and <code>cause</code>.
161+ * <p>
162+ * @param reason a description of the exception
163+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
164+ * @param vendorCode a database vendor-specific exception code
165+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
166+ * the cause is non-existent or unknown.
167+ * @since 1.6
168+ */
169+ public SQLInvalidAuthorizationSpecException(String reason, String SQLState, int vendorCode, Throwable cause) {
170+ super(reason,SQLState,vendorCode,cause);
171+ }
172+
173+ private static final long serialVersionUID = -64105250450891498L;
174+}
java/pkg/java/sql/SQLNonTransientConnectionException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLNonTransientConnectionException.java+176−0
@@ -0,0 +1,176 @@
1+/*
2+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown for the SQLState
30+ * class value '<i>08</i>', or under vendor-specified conditions. This
31+ * indicates that the connection operation that failed will not succeed if
32+ * the operation is retried without the cause of the failure being corrected.
33+ * <p>
34+ * Please consult your driver vendor documentation for the vendor-specified
35+ * conditions for which this <code>Exception</code> may be thrown.
36+ * @since 1.6
37+ */
38+public class SQLNonTransientConnectionException extends java.sql.SQLNonTransientException {
39+
40+ /**
41+ * Constructs a <code>SQLNonTransientConnectionException</code> object.
42+ * The <code>reason</code>, <code>SQLState</code> are initialized
43+ * to <code>null</code> and the vendor code is initialized to 0.
44+ *
45+ * The <code>cause</code> is not initialized, and may subsequently be
46+ * initialized by a call to the
47+ * {@link Throwable#initCause(java.lang.Throwable)} method.
48+ * <p>
49+ *
50+ * @since 1.6
51+ */
52+ public SQLNonTransientConnectionException() {
53+ super();
54+ }
55+
56+ /**
57+ * Constructs a <code>SQLNonTransientConnectionException</code> object
58+ * with a given <code>reason</code>. The <code>SQLState</code>
59+ * is initialized to <code>null</code> and the vender code is initialized
60+ * to 0.
61+ *
62+ * The <code>cause</code> is not initialized, and may subsequently be
63+ * initialized by a call to the
64+ * {@link Throwable#initCause(java.lang.Throwable)} method.
65+ * <p>
66+ * @param reason a description of the exception
67+ * @since 1.6
68+ */
69+ public SQLNonTransientConnectionException(String reason) {
70+ super(reason);
71+ }
72+
73+ /**
74+ * Constructs a <code>SQLNonTransientConnectionException</code> object
75+ * with a given <code>reason</code> and <code>SQLState</code>.
76+ *
77+ * The <code>cause</code> is not initialized, and may subsequently be
78+ * initialized by a call to the
79+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
80+ * is initialized to 0.
81+ * <p>
82+ * @param reason a description of the exception
83+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
84+ * @since 1.6
85+ */
86+ public SQLNonTransientConnectionException(String reason, String SQLState) {
87+ super(reason,SQLState);
88+ }
89+
90+ /**
91+ * Constructs a <code>SQLNonTransientConnectionException</code> object
92+ * with a given <code>reason</code>, <code>SQLState</code> and
93+ * <code>vendorCode</code>.
94+ *
95+ * The <code>cause</code> is not initialized, and may subsequently be
96+ * initialized by a call to the
97+ * {@link Throwable#initCause(java.lang.Throwable)} method.
98+ * <p>
99+ * @param reason a description of the exception
100+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
101+ * @param vendorCode a database vendor specific exception code
102+ * @since 1.6
103+ */
104+ public SQLNonTransientConnectionException(String reason, String SQLState, int vendorCode) {
105+ super(reason,SQLState,vendorCode);
106+ }
107+
108+ /**
109+ * Constructs a <code>SQLNonTransientConnectionException</code> object
110+ * with a given <code>cause</code>.
111+ * The <code>SQLState</code> is initialized
112+ * to <code>null</code> and the vendor code is initialized to 0.
113+ * The <code>reason</code> is initialized to <code>null</code> if
114+ * <code>cause==null</code> or to <code>cause.toString()</code> if
115+ * <code>cause!=null</code>.
116+ * <p>
117+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
118+ * the cause is non-existent or unknown.
119+ * @since 1.6
120+ */
121+ public SQLNonTransientConnectionException(Throwable cause) {
122+ super(cause);
123+ }
124+
125+ /**
126+ * Constructs a <code>SQLTransientException</code> object
127+ * with a given
128+ * <code>reason</code> and <code>cause</code>.
129+ * The <code>SQLState</code> is initialized to <code>null</code>
130+ * and the vendor code is initialized to 0.
131+ * <p>
132+ * @param reason a description of the exception.
133+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
134+ * the cause is non-existent or unknown.
135+ * @since 1.6
136+ */
137+ public SQLNonTransientConnectionException(String reason, Throwable cause) {
138+ super(reason,cause);
139+ }
140+
141+ /**
142+ * Constructs a <code>SQLNonTransientConnectionException</code> object
143+ * with a given
144+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
145+ * The vendor code is initialized to 0.
146+ * <p>
147+ * @param reason a description of the exception.
148+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
149+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
150+ * the cause is non-existent or unknown.
151+ * @since 1.6
152+ */
153+ public SQLNonTransientConnectionException(String reason, String SQLState, Throwable cause) {
154+ super(reason,SQLState,cause);
155+ }
156+
157+ /**
158+ * Constructs a <code>SQLNonTransientConnectionException</code> object
159+ * with a given
160+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
161+ * and <code>cause</code>.
162+ * <p>
163+ * @param reason a description of the exception
164+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
165+ * @param vendorCode a database vendor-specific exception code
166+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
167+ * the cause is non-existent or unknown.
168+ * @since 1.6
169+ */
170+ public SQLNonTransientConnectionException(String reason, String SQLState, int vendorCode, Throwable cause) {
171+ super(reason,SQLState,vendorCode,cause);
172+ }
173+
174+ private static final long serialVersionUID = -5852318857474782892L;
175+
176+}
java/pkg/java/sql/SQLNonTransientException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLNonTransientException.java+175−0
@@ -0,0 +1,175 @@
1+/*
2+ * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when an instance where a retry
30+ * of the same operation would fail unless the cause of the <code>SQLException</code>
31+ * is corrected.
32+ *<p>
33+ *
34+ * @since 1.6
35+ */
36+public class SQLNonTransientException extends java.sql.SQLException {
37+
38+ /**
39+ * Constructs a <code>SQLNonTransientException</code> object.
40+ * The <code>reason</code>, <code>SQLState</code> are initialized
41+ * to <code>null</code> and the vendor code is initialized to 0.
42+ *
43+ * The <code>cause</code> is not initialized, and may subsequently be
44+ * initialized by a call to the
45+ * {@link Throwable#initCause(java.lang.Throwable)} method.
46+ * <p>
47+ *
48+ * @since 1.6
49+ */
50+ public SQLNonTransientException() {
51+ super();
52+ }
53+
54+ /**
55+ * Constructs a <code>SQLNonTransientException</code> object
56+ * with a given <code>reason</code>. The <code>SQLState</code>
57+ * is initialized to <code>null</code> and the vender code is initialized
58+ * to 0.
59+ *
60+ * The <code>cause</code> is not initialized, and may subsequently be
61+ * initialized by a call to the
62+ * {@link Throwable#initCause(java.lang.Throwable)} method.
63+ * <p>
64+ *
65+ * @param reason a description of the exception
66+ * @since 1.6
67+ */
68+ public SQLNonTransientException(String reason) {
69+ super(reason);
70+ }
71+
72+ /**
73+ * Constructs a <code>SQLNonTransientException</code> object
74+ * with a given <code>reason</code> and <code>SQLState</code>.
75+ *
76+ * The <code>cause</code> is not initialized, and may subsequently be
77+ * initialized by a call to the
78+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
79+ * is initialized to 0.
80+ * <p>
81+ * @param reason a description of the exception
82+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
83+ * @since 1.6
84+ */
85+ public SQLNonTransientException(String reason, String SQLState) {
86+ super(reason,SQLState);
87+ }
88+
89+ /**
90+ * Constructs a <code>SQLNonTransientException</code> object
91+ * with a given <code>reason</code>, <code>SQLState</code> and
92+ * <code>vendorCode</code>.
93+ *
94+ * The <code>cause</code> is not initialized, and may subsequently be
95+ * initialized by a call to the
96+ * {@link Throwable#initCause(java.lang.Throwable)} method.
97+ * <p>
98+ * @param reason a description of the exception
99+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
100+ * @param vendorCode a database vendor specific exception code
101+ * @since 1.6
102+ */
103+ public SQLNonTransientException(String reason, String SQLState, int vendorCode) {
104+ super(reason,SQLState,vendorCode);
105+ }
106+
107+ /**
108+ * Constructs a <code>SQLNonTransientException</code> object
109+ * with a given <code>cause</code>.
110+ * The <code>SQLState</code> is initialized
111+ * to <code>null</code> and the vendor code is initialized to 0.
112+ * The <code>reason</code> is initialized to <code>null</code> if
113+ * <code>cause==null</code> or to <code>cause.toString()</code> if
114+ * <code>cause!=null</code>.
115+ * <p>
116+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
117+ * the cause is non-existent or unknown.
118+ * @since 1.6
119+ */
120+ public SQLNonTransientException(Throwable cause) {
121+ super(cause);
122+ }
123+
124+ /**
125+ * Constructs a <code>SQLTransientException</code> object
126+ * with a given
127+ * <code>reason</code> and <code>cause</code>.
128+ * The <code>SQLState</code> is initialized to <code>null</code>
129+ * and the vendor code is initialized to 0.
130+ * <p>
131+ * @param reason a description of the exception.
132+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
133+ * the cause is non-existent or unknown.
134+ * @since 1.6
135+ */
136+ public SQLNonTransientException(String reason, Throwable cause) {
137+ super(reason,cause);
138+
139+ }
140+
141+ /**
142+ * Constructs a <code>SQLNonTransientException</code> object
143+ * with a given
144+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
145+ * The vendor code is initialized to 0.
146+ * <p>
147+ * @param reason a description of the exception.
148+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
149+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
150+ * the cause is non-existent or unknown.
151+ * @since 1.6
152+ */
153+ public SQLNonTransientException(String reason, String SQLState, Throwable cause) {
154+ super(reason,SQLState,cause);
155+ }
156+
157+ /**
158+ * Constructs a <code>SQLNonTransientException</code> object
159+ * with a given
160+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
161+ * and <code>cause</code>.
162+ * <p>
163+ * @param reason a description of the exception
164+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
165+ * @param vendorCode a database vendor-specific exception code
166+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
167+ * the cause is non-existent or unknown.
168+ * @since 1.6
169+ */
170+ public SQLNonTransientException(String reason, String SQLState, int vendorCode, Throwable cause) {
171+ super(reason,SQLState,vendorCode,cause);
172+ }
173+
174+ private static final long serialVersionUID = -9104382843534716547L;
175+}
java/pkg/java/sql/SQLOutput.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLOutput.java+437−0
@@ -0,0 +1,437 @@
1+/*
2+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The output stream for writing the attributes of a user-defined
30+ * type back to the database. This interface, used
31+ * only for custom mapping, is used by the driver, and its
32+ * methods are never directly invoked by a programmer.
33+ * <p>When an object of a class implementing the interface
34+ * <code>SQLData</code> is passed as an argument to an SQL statement, the
35+ * JDBC driver calls the method <code>SQLData.getSQLType</code> to
36+ * determine the kind of SQL
37+ * datum being passed to the database.
38+ * The driver then creates an instance of <code>SQLOutput</code> and
39+ * passes it to the method <code>SQLData.writeSQL</code>.
40+ * The method <code>writeSQL</code> in turn calls the
41+ * appropriate <code>SQLOutput</code> <i>writer</i> methods
42+ * <code>writeBoolean</code>, <code>writeCharacterStream</code>, and so on)
43+ * to write data from the <code>SQLData</code> object to
44+ * the <code>SQLOutput</code> output stream as the
45+ * representation of an SQL user-defined type.
46+ * @since 1.2
47+ */
48+
49+ public interface SQLOutput {
50+
51+ //================================================================
52+ // Methods for writing attributes to the stream of SQL data.
53+ // These methods correspond to the column-accessor methods of
54+ // java.sql.ResultSet.
55+ //================================================================
56+
57+ /**
58+ * Writes the next attribute to the stream as a <code>String</code>
59+ * in the Java programming language.
60+ *
61+ * @param x the value to pass to the database
62+ * @exception SQLException if a database access error occurs
63+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
64+ * this method
65+ * @since 1.2
66+ */
67+ void writeString(String x) throws SQLException;
68+
69+ /**
70+ * Writes the next attribute to the stream as a Java boolean.
71+ * Writes the next attribute to the stream as a <code>String</code>
72+ * in the Java programming language.
73+ *
74+ * @param x the value to pass to the database
75+ * @exception SQLException if a database access error occurs
76+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
77+ * this method
78+ * @since 1.2
79+ */
80+ void writeBoolean(boolean x) throws SQLException;
81+
82+ /**
83+ * Writes the next attribute to the stream as a Java byte.
84+ * Writes the next attribute to the stream as a <code>String</code>
85+ * in the Java programming language.
86+ *
87+ * @param x the value to pass to the database
88+ * @exception SQLException if a database access error occurs
89+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90+ * this method
91+ * @since 1.2
92+ */
93+ void writeByte(byte x) throws SQLException;
94+
95+ /**
96+ * Writes the next attribute to the stream as a Java short.
97+ * Writes the next attribute to the stream as a <code>String</code>
98+ * in the Java programming language.
99+ *
100+ * @param x the value to pass to the database
101+ * @exception SQLException if a database access error occurs
102+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
103+ * this method
104+ * @since 1.2
105+ */
106+ void writeShort(short x) throws SQLException;
107+
108+ /**
109+ * Writes the next attribute to the stream as a Java int.
110+ * Writes the next attribute to the stream as a <code>String</code>
111+ * in the Java programming language.
112+ *
113+ * @param x the value to pass to the database
114+ * @exception SQLException if a database access error occurs
115+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
116+ * this method
117+ * @since 1.2
118+ */
119+ void writeInt(int x) throws SQLException;
120+
121+ /**
122+ * Writes the next attribute to the stream as a Java long.
123+ * Writes the next attribute to the stream as a <code>String</code>
124+ * in the Java programming language.
125+ *
126+ * @param x the value to pass to the database
127+ * @exception SQLException if a database access error occurs
128+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
129+ * this method
130+ * @since 1.2
131+ */
132+ void writeLong(long x) throws SQLException;
133+
134+ /**
135+ * Writes the next attribute to the stream as a Java float.
136+ * Writes the next attribute to the stream as a <code>String</code>
137+ * in the Java programming language.
138+ *
139+ * @param x the value to pass to the database
140+ * @exception SQLException if a database access error occurs
141+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
142+ * this method
143+ * @since 1.2
144+ */
145+ void writeFloat(float x) throws SQLException;
146+
147+ /**
148+ * Writes the next attribute to the stream as a Java double.
149+ * Writes the next attribute to the stream as a <code>String</code>
150+ * in the Java programming language.
151+ *
152+ * @param x the value to pass to the database
153+ * @exception SQLException if a database access error occurs
154+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
155+ * this method
156+ * @since 1.2
157+ */
158+ void writeDouble(double x) throws SQLException;
159+
160+ /**
161+ * Writes the next attribute to the stream as a java.math.BigDecimal object.
162+ * Writes the next attribute to the stream as a <code>String</code>
163+ * in the Java programming language.
164+ *
165+ * @param x the value to pass to the database
166+ * @exception SQLException if a database access error occurs
167+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
168+ * this method
169+ * @since 1.2
170+ */
171+ void writeBigDecimal(java.math.BigDecimal x) throws SQLException;
172+
173+ /**
174+ * Writes the next attribute to the stream as an array of bytes.
175+ * Writes the next attribute to the stream as a <code>String</code>
176+ * in the Java programming language.
177+ *
178+ * @param x the value to pass to the database
179+ * @exception SQLException if a database access error occurs
180+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
181+ * this method
182+ * @since 1.2
183+ */
184+ void writeBytes(byte[] x) throws SQLException;
185+
186+ /**
187+ * Writes the next attribute to the stream as a java.sql.Date object.
188+ * Writes the next attribute to the stream as a <code>java.sql.Date</code> object
189+ * in the Java programming language.
190+ *
191+ * @param x the value to pass to the database
192+ * @exception SQLException if a database access error occurs
193+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
194+ * this method
195+ * @since 1.2
196+ */
197+ void writeDate(java.sql.Date x) throws SQLException;
198+
199+ /**
200+ * Writes the next attribute to the stream as a java.sql.Time object.
201+ * Writes the next attribute to the stream as a <code>java.sql.Date</code> object
202+ * in the Java programming language.
203+ *
204+ * @param x the value to pass to the database
205+ * @exception SQLException if a database access error occurs
206+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
207+ * this method
208+ * @since 1.2
209+ */
210+ void writeTime(java.sql.Time x) throws SQLException;
211+
212+ /**
213+ * Writes the next attribute to the stream as a java.sql.Timestamp object.
214+ * Writes the next attribute to the stream as a <code>java.sql.Date</code> object
215+ * in the Java programming language.
216+ *
217+ * @param x the value to pass to the database
218+ * @exception SQLException if a database access error occurs
219+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
220+ * this method
221+ * @since 1.2
222+ */
223+ void writeTimestamp(java.sql.Timestamp x) throws SQLException;
224+
225+ /**
226+ * Writes the next attribute to the stream as a stream of Unicode characters.
227+ *
228+ * @param x the value to pass to the database
229+ * @exception SQLException if a database access error occurs
230+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
231+ * this method
232+ * @since 1.2
233+ */
234+ void writeCharacterStream(java.io.Reader x) throws SQLException;
235+
236+ /**
237+ * Writes the next attribute to the stream as a stream of ASCII characters.
238+ *
239+ * @param x the value to pass to the database
240+ * @exception SQLException if a database access error occurs
241+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
242+ * this method
243+ * @since 1.2
244+ */
245+ void writeAsciiStream(java.io.InputStream x) throws SQLException;
246+
247+ /**
248+ * Writes the next attribute to the stream as a stream of uninterpreted
249+ * bytes.
250+ *
251+ * @param x the value to pass to the database
252+ * @exception SQLException if a database access error occurs
253+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
254+ * this method
255+ * @since 1.2
256+ */
257+ void writeBinaryStream(java.io.InputStream x) throws SQLException;
258+
259+ //================================================================
260+ // Methods for writing items of SQL user-defined types to the stream.
261+ // These methods pass objects to the database as values of SQL
262+ // Structured Types, Distinct Types, Constructed Types, and Locator
263+ // Types. They decompose the Java object(s) and write leaf data
264+ // items using the methods above.
265+ //================================================================
266+
267+ /**
268+ * Writes to the stream the data contained in the given
269+ * <code>SQLData</code> object.
270+ * When the <code>SQLData</code> object is <code>null</code>, this
271+ * method writes an SQL <code>NULL</code> to the stream.
272+ * Otherwise, it calls the <code>SQLData.writeSQL</code>
273+ * method of the given object, which
274+ * writes the object's attributes to the stream.
275+ * The implementation of the method <code>SQLData.writeSQ</code>
276+ * calls the appropriate <code>SQLOutput</code> writer method(s)
277+ * for writing each of the object's attributes in order.
278+ * The attributes must be read from an <code>SQLInput</code>
279+ * input stream and written to an <code>SQLOutput</code>
280+ * output stream in the same order in which they were
281+ * listed in the SQL definition of the user-defined type.
282+ *
283+ * @param x the object representing data of an SQL structured or
284+ * distinct type
285+ * @exception SQLException if a database access error occurs
286+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
287+ * this method
288+ * @since 1.2
289+ */
290+ void writeObject(SQLData x) throws SQLException;
291+
292+ /**
293+ * Writes an SQL <code>REF</code> value to the stream.
294+ *
295+ * @param x a <code>Ref</code> object representing data of an SQL
296+ * <code>REF</code> value
297+ * @exception SQLException if a database access error occurs
298+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
299+ * this method
300+ * @since 1.2
301+ */
302+ void writeRef(Ref x) throws SQLException;
303+
304+ /**
305+ * Writes an SQL <code>BLOB</code> value to the stream.
306+ *
307+ * @param x a <code>Blob</code> object representing data of an SQL
308+ * <code>BLOB</code> value
309+ *
310+ * @exception SQLException if a database access error occurs
311+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
312+ * this method
313+ * @since 1.2
314+ */
315+ void writeBlob(Blob x) throws SQLException;
316+
317+ /**
318+ * Writes an SQL <code>CLOB</code> value to the stream.
319+ *
320+ * @param x a <code>Clob</code> object representing data of an SQL
321+ * <code>CLOB</code> value
322+ *
323+ * @exception SQLException if a database access error occurs
324+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
325+ * this method
326+ * @since 1.2
327+ */
328+ void writeClob(Clob x) throws SQLException;
329+
330+ /**
331+ * Writes an SQL structured type value to the stream.
332+ *
333+ * @param x a <code>Struct</code> object representing data of an SQL
334+ * structured type
335+ *
336+ * @exception SQLException if a database access error occurs
337+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
338+ * this method
339+ * @since 1.2
340+ */
341+ void writeStruct(Struct x) throws SQLException;
342+
343+ /**
344+ * Writes an SQL <code>ARRAY</code> value to the stream.
345+ *
346+ * @param x an <code>Array</code> object representing data of an SQL
347+ * <code>ARRAY</code> type
348+ *
349+ * @exception SQLException if a database access error occurs
350+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
351+ * this method
352+ * @since 1.2
353+ */
354+ void writeArray(Array x) throws SQLException;
355+
356+ //--------------------------- JDBC 3.0 ------------------------
357+
358+ /**
359+ * Writes a SQL <code>DATALINK</code> value to the stream.
360+ *
361+ * @param x a <code>java.net.URL</code> object representing the data
362+ * of SQL DATALINK type
363+ *
364+ * @exception SQLException if a database access error occurs
365+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
366+ * this method
367+ * @since 1.4
368+ */
369+ void writeURL(java.net.URL x) throws SQLException;
370+
371+ //--------------------------- JDBC 4.0 ------------------------
372+
373+ /**
374+ * Writes the next attribute to the stream as a <code>String</code>
375+ * in the Java programming language. The driver converts this to a
376+ * SQL <code>NCHAR</code> or
377+ * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
378+ * (depending on the argument's
379+ * size relative to the driver's limits on <code>NVARCHAR</code> values)
380+ * when it sends it to the stream.
381+ *
382+ * @param x the value to pass to the database
383+ * @exception SQLException if a database access error occurs
384+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
385+ * this method
386+ * @since 1.6
387+ */
388+ void writeNString(String x) throws SQLException;
389+
390+ /**
391+ * Writes an SQL <code>NCLOB</code> value to the stream.
392+ *
393+ * @param x a <code>NClob</code> object representing data of an SQL
394+ * <code>NCLOB</code> value
395+ *
396+ * @exception SQLException if a database access error occurs
397+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
398+ * this method
399+ * @since 1.6
400+ */
401+ void writeNClob(NClob x) throws SQLException;
402+
403+
404+ /**
405+ * Writes an SQL <code>ROWID</code> value to the stream.
406+ *
407+ * @param x a <code>RowId</code> object representing data of an SQL
408+ * <code>ROWID</code> value
409+ *
410+ * @exception SQLException if a database access error occurs
411+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
412+ * this method
413+ * @since 1.6
414+ */
415+ void writeRowId(RowId x) throws SQLException;
416+
417+
418+ /**
419+ * Writes an SQL <code>XML</code> value to the stream.
420+ *
421+ * @param x a <code>SQLXML</code> object representing data of an SQL
422+ * <code>XML</code> value
423+ *
424+ * @throws SQLException if a database access error occurs,
425+ * the <code>java.xml.transform.Result</code>,
426+ * <code>Writer</code> or <code>OutputStream</code> has not been closed for the <code>SQLXML</code> object or
427+ * if there is an error processing the XML value. The <code>getCause</code> method
428+ * of the exception may provide a more detailed exception, for example, if the
429+ * stream does not contain valid XML.
430+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
431+ * this method
432+ * @since 1.6
433+ */
434+ void writeSQLXML(SQLXML x) throws SQLException;
435+
436+
437+}
java/pkg/java/sql/SQLPermission.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLPermission.java+158−0
@@ -0,0 +1,158 @@
1+/*
2+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+
27+package java.sql;
28+
29+import java.security.*;
30+
31+/**
32+ * The permission for which the <code>SecurityManager</code> will check
33+ * when code that is running in an applet, or an application with a
34+ * <code>SecurityManager</code> enabled, calls the
35+ * <code>DriverManager.setLogWriter</code> method,
36+ * <code>DriverManager.setLogStream</code> (deprecated) method,
37+ * {@code SyncFactory.setJNDIContext} method,
38+ * {@code SyncFactory.setLogger} method,
39+ * {@code Connection.setNetworktimeout} method,
40+ * or the <code>Connection.abort</code> method.
41+ * If there is no <code>SQLPermission</code> object, these methods
42+ * throw a <code>java.lang.SecurityException</code> as a runtime exception.
43+ * <P>
44+ * A <code>SQLPermission</code> object contains
45+ * a name (also referred to as a "target name") but no actions
46+ * list; there is either a named permission or there is not.
47+ * The target name is the name of the permission (see below). The
48+ * naming convention follows the hierarchical property naming convention.
49+ * In addition, an asterisk
50+ * may appear at the end of the name, following a ".", or by itself, to
51+ * signify a wildcard match. For example: <code>loadLibrary.*</code>
52+ * or <code>*</code> is valid,
53+ * but <code>*loadLibrary</code> or <code>a*b</code> is not valid.
54+ * <P>
55+ * The following table lists all the possible <code>SQLPermission</code> target names.
56+ * The table gives a description of what the permission allows
57+ * and a discussion of the risks of granting code the permission.
58+ * <P>
59+ *
60+ * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
61+ * <tr>
62+ * <th>Permission Target Name</th>
63+ * <th>What the Permission Allows</th>
64+ * <th>Risks of Allowing this Permission</th>
65+ * </tr>
66+ *
67+ * <tr>
68+ * <td>setLog</td>
69+ * <td>Setting of the logging stream</td>
70+ * <td>This is a dangerous permission to grant.
71+ * The contents of the log may contain usernames and passwords,
72+ * SQL statements, and SQL data.</td>
73+ * </tr>
74+ * <tr>
75+ * <td>callAbort</td>
76+ * <td>Allows the invocation of the {@code Connection} method
77+ * {@code abort}</td>
78+ * <td>Permits an application to terminate a physical connection to a
79+ * database.</td>
80+ * </tr>
81+ * <tr>
82+ * <td>setSyncFactory</td>
83+ * <td>Allows the invocation of the {@code SyncFactory} methods
84+ * {@code setJNDIContext} and {@code setLogger}</td>
85+ * <td>Permits an application to specify the JNDI context from which the
86+ * {@code SyncProvider} implementations can be retrieved from and the logging
87+ * object to be used by the {@code SyncProvider} implementation.</td>
88+ * </tr>
89+ *
90+ * <tr>
91+ * <td>setNetworkTimeout</td>
92+ * <td>Allows the invocation of the {@code Connection} method
93+ * {@code setNetworkTimeout}</td>
94+ * <td>Permits an application to specify the maximum period a
95+ * <code>Connection</code> or
96+ * objects created from the <code>Connection</code>
97+ * will wait for the database to reply to any one request.</td>
98+ * </tr>
99+ * </table>
100+ *<p>
101+ * The person running an applet decides what permissions to allow
102+ * and will run the <code>Policy Tool</code> to create an
103+ * <code>SQLPermission</code> in a policy file. A programmer does
104+ * not use a constructor directly to create an instance of <code>SQLPermission</code>
105+ * but rather uses a tool.
106+ * @since 1.3
107+ * @see java.security.BasicPermission
108+ * @see java.security.Permission
109+ * @see java.security.Permissions
110+ * @see java.security.PermissionCollection
111+ * @see java.lang.SecurityManager
112+ *
113+ */
114+
115+public final class SQLPermission extends BasicPermission {
116+
117+ /**
118+ * Creates a new <code>SQLPermission</code> object with the specified name.
119+ * The name is the symbolic name of the <code>SQLPermission</code>.
120+ *
121+ * @param name the name of this <code>SQLPermission</code> object, which must
122+ * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory},
123+ * or {@code setNetworkTimeout}
124+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
125+ * @throws IllegalArgumentException if <code>name</code> is empty.
126+
127+ */
128+
129+ public SQLPermission(String name) {
130+ super(name);
131+ }
132+
133+ /**
134+ * Creates a new <code>SQLPermission</code> object with the specified name.
135+ * The name is the symbolic name of the <code>SQLPermission</code>; the
136+ * actions <code>String</code> is currently unused and should be
137+ * <code>null</code>.
138+ *
139+ * @param name the name of this <code>SQLPermission</code> object, which must
140+ * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory},
141+ * or {@code setNetworkTimeout}
142+ * @param actions should be <code>null</code>
143+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
144+ * @throws IllegalArgumentException if <code>name</code> is empty.
145+
146+ */
147+
148+ public SQLPermission(String name, String actions) {
149+ super(name, actions);
150+ }
151+
152+ /**
153+ * Private serial version unique ID to ensure serialization
154+ * compatibility.
155+ */
156+ static final long serialVersionUID = -1439323187199563495L;
157+
158+}
java/pkg/java/sql/SQLRecoverableException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLRecoverableException.java+175−0
@@ -0,0 +1,175 @@
1+/*
2+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown in situations where a
30+ * previously failed operation might be able to succeed if the application performs
31+ * some recovery steps and retries the entire transaction or in the case of a
32+ * distributed transaction, the transaction branch. At a minimum,
33+ * the recovery operation must include closing the current connection and getting
34+ * a new connection.
35+ *<p>
36+ *
37+ * @since 1.6
38+ */
39+public class SQLRecoverableException extends java.sql.SQLException {
40+
41+ /**
42+ * Constructs a <code>SQLRecoverableException</code> object.
43+ * The <code>reason</code>, <code>SQLState</code> are initialized
44+ * to <code>null</code> and the vendor code is initialized to 0.
45+ *
46+ * The <code>cause</code> is not initialized, and may subsequently be
47+ * initialized by a call to the
48+ * {@link Throwable#initCause(java.lang.Throwable)} method.
49+ * <p>
50+ * @since 1.6
51+ */
52+ public SQLRecoverableException() {
53+ super();
54+ }
55+
56+ /**
57+ * Constructs a <code>SQLRecoverableException</code> object
58+ * with a given <code>reason</code>. The <code>SQLState</code>
59+ * is initialized to <code>null</code> and the vender code is initialized
60+ * to 0.
61+ *
62+ * The <code>cause</code> is not initialized, and may subsequently be
63+ * initialized by a call to the
64+ * {@link Throwable#initCause(java.lang.Throwable)} method.
65+ * <p>
66+ * @param reason a description of the exception
67+ * @since 1.6
68+ */
69+ public SQLRecoverableException(String reason) {
70+ super(reason);
71+ }
72+
73+ /**
74+ * Constructs a <code>SQLRecoverableException</code> object
75+ * with a given <code>reason</code> and <code>SQLState</code>.
76+ *
77+ * The <code>cause</code> is not initialized, and may subsequently be
78+ * initialized by a call to the
79+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
80+ * is initialized to 0.
81+ * <p>
82+ * @param reason a description of the exception
83+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
84+ * @since 1.6
85+ */
86+ public SQLRecoverableException(String reason, String SQLState) {
87+ super(reason, SQLState);
88+ }
89+
90+ /**
91+ * Constructs a <code>SQLRecoverableException</code> object
92+ * with a given <code>reason</code>, <code>SQLState</code> and
93+ * <code>vendorCode</code>.
94+ *
95+ * The <code>cause</code> is not initialized, and may subsequently be
96+ * initialized by a call to the
97+ * {@link Throwable#initCause(java.lang.Throwable)} method.
98+ * <p>
99+ * @param reason a description of the exception
100+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
101+ * @param vendorCode a database vendor specific exception code
102+ * @since 1.6
103+ */
104+ public SQLRecoverableException(String reason, String SQLState, int vendorCode) {
105+ super(reason, SQLState, vendorCode);
106+ }
107+
108+ /**
109+ * Constructs a <code>SQLRecoverableException</code> object
110+ * with a given <code>cause</code>.
111+ * The <code>SQLState</code> is initialized
112+ * to <code>null</code> and the vendor code is initialized to 0.
113+ * The <code>reason</code> is initialized to <code>null</code> if
114+ * <code>cause==null</code> or to <code>cause.toString()</code> if
115+ * <code>cause!=null</code>.
116+ * <p>
117+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
118+ * the cause is non-existent or unknown.
119+ * @since 1.6
120+ */
121+ public SQLRecoverableException(Throwable cause) {
122+ super(cause);
123+ }
124+
125+ /**
126+ * Constructs a <code>SQLRecoverableException</code> object
127+ * with a given
128+ * <code>reason</code> and <code>cause</code>.
129+ * The <code>SQLState</code> is initialized to <code>null</code>
130+ * and the vendor code is initialized to 0.
131+ * <p>
132+ * @param reason a description of the exception.
133+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
134+ * the cause is non-existent or unknown.
135+ * @since 1.6
136+ */
137+ public SQLRecoverableException(String reason, Throwable cause) {
138+ super(reason, cause);
139+ }
140+
141+ /**
142+ * Constructs a <code>SQLRecoverableException</code> object
143+ * with a given
144+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
145+ * The vendor code is initialized to 0.
146+ * <p>
147+ * @param reason a description of the exception.
148+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
149+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
150+ * the cause is non-existent or unknown.
151+ * @since 1.6
152+ */
153+ public SQLRecoverableException(String reason, String SQLState, Throwable cause) {
154+ super(reason, SQLState, cause);
155+ }
156+
157+ /**
158+ * Constructs a <code>SQLRecoverableException</code> object
159+ * with a given
160+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
161+ * and <code>cause</code>.
162+ * <p>
163+ * @param reason a description of the exception
164+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
165+ * @param vendorCode a database vendor-specific exception code
166+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
167+ * the cause is non-existent or unknown.
168+ * @since 1.6
169+ */
170+ public SQLRecoverableException(String reason, String SQLState, int vendorCode, Throwable cause) {
171+ super(reason, SQLState, vendorCode, cause);
172+ }
173+
174+ private static final long serialVersionUID = -4144386502923131579L;
175+}
java/pkg/java/sql/SQLSyntaxErrorException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLSyntaxErrorException.java+173−0
@@ -0,0 +1,173 @@
1+/*
2+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * The subclass of {@link SQLException} thrown when the SQLState class value
30+ * is '<i>42</i>', or under vendor-specified conditions. This indicates that the
31+ * in-progress query has violated SQL syntax rules.
32+ * <p>
33+ * Please consult your driver vendor documentation for the vendor-specified
34+ * conditions for which this <code>Exception</code> may be thrown.
35+ * @since 1.6
36+ */
37+public class SQLSyntaxErrorException extends SQLNonTransientException {
38+
39+ /**
40+ * Constructs a <code>SQLSyntaxErrorException</code> object.
41+ * The <code>reason</code>, <code>SQLState</code> are initialized
42+ * to <code>null</code> and the vendor code is initialized to 0.
43+ *
44+ * The <code>cause</code> is not initialized, and may subsequently be
45+ * initialized by a call to the
46+ * {@link Throwable#initCause(java.lang.Throwable)} method.
47+ * <p>
48+ * @since 1.6
49+ */
50+ public SQLSyntaxErrorException() {
51+ super();
52+ }
53+
54+ /**
55+ * Constructs a <code>SQLSyntaxErrorException</code> object
56+ * with a given <code>reason</code>. The <code>SQLState</code>
57+ * is initialized to <code>null</code> and the vender code is initialized
58+ * to 0.
59+ *
60+ * The <code>cause</code> is not initialized, and may subsequently be
61+ * initialized by a call to the
62+ * {@link Throwable#initCause(java.lang.Throwable)} method.
63+ * <p>
64+ * @param reason a description of the exception
65+ * @since 1.6
66+ */
67+ public SQLSyntaxErrorException(String reason) {
68+ super(reason);
69+ }
70+
71+ /**
72+ * Constructs a <code>SQLSyntaxErrorException</code> object
73+ * with a given <code>reason</code> and <code>SQLState</code>.
74+ *
75+ * The <code>cause</code> is not initialized, and may subsequently be
76+ * initialized by a call to the
77+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
78+ * is initialized to 0.
79+ * <p>
80+ * @param reason a description of the exception
81+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
82+ * @since 1.6
83+ */
84+ public SQLSyntaxErrorException(String reason, String SQLState) {
85+ super(reason, SQLState);
86+ }
87+
88+ /**
89+ * Constructs a <code>SQLSyntaxErrorException</code> object
90+ * with a given <code>reason</code>, <code>SQLState</code> and
91+ * <code>vendorCode</code>.
92+ *
93+ * The <code>cause</code> is not initialized, and may subsequently be
94+ * initialized by a call to the
95+ * {@link Throwable#initCause(java.lang.Throwable)} method.
96+ * <p>
97+ * @param reason a description of the exception
98+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
99+ * @param vendorCode a database vendor specific exception code
100+ * @since 1.6
101+ */
102+ public SQLSyntaxErrorException(String reason, String SQLState, int vendorCode) {
103+ super(reason, SQLState, vendorCode);
104+ }
105+
106+ /**
107+ * Constructs a <code>SQLSyntaxErrorException</code> object
108+ * with a given <code>cause</code>.
109+ * The <code>SQLState</code> is initialized
110+ * to <code>null</code> and the vendor code is initialized to 0.
111+ * The <code>reason</code> is initialized to <code>null</code> if
112+ * <code>cause==null</code> or to <code>cause.toString()</code> if
113+ * <code>cause!=null</code>.
114+ * <p>
115+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval bythe <code>getCause()</code> method); may be null indicating
116+ * the cause is non-existent or unknown.
117+ * @since 1.6
118+ */
119+ public SQLSyntaxErrorException(Throwable cause) {
120+ super(cause);
121+ }
122+
123+ /**
124+ * Constructs a <code>SQLSyntaxErrorException</code> object
125+ * with a given
126+ * <code>reason</code> and <code>cause</code>.
127+ * The <code>SQLState</code> is initialized to <code>null</code>
128+ * and the vendor code is initialized to 0.
129+ * <p>
130+ * @param reason a description of the exception.
131+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
132+ * the cause is non-existent or unknown.
133+ * @since 1.6
134+ */
135+ public SQLSyntaxErrorException(String reason, Throwable cause) {
136+ super(reason, cause);
137+ }
138+
139+ /**
140+ * Constructs a <code>SQLSyntaxErrorException</code> object
141+ * with a given
142+ * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
143+ * The vendor code is initialized to 0.
144+ * <p>
145+ * @param reason a description of the exception.
146+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
147+ * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
148+ * the cause is non-existent or unknown.
149+ * @since 1.6
150+ */
151+ public SQLSyntaxErrorException(String reason, String SQLState, Throwable cause) {
152+ super(reason, SQLState, cause);
153+ }
154+
155+ /**
156+ * Constructs a <code>SQLSyntaxErrorException</code> object
157+ * with a given
158+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
159+ * and <code>cause</code>.
160+ * <p>
161+ * @param reason a description of the exception
162+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
163+ * @param vendorCode a database vendor-specific exception code
164+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
165+ * the cause is non-existent or unknown.
166+ * @since 1.6
167+ */
168+ public SQLSyntaxErrorException(String reason, String SQLState, int vendorCode, Throwable cause) {
169+ super(reason, SQLState, vendorCode, cause);
170+ }
171+
172+ private static final long serialVersionUID = -1843832610477496053L;
173+}
java/pkg/java/sql/SQLTimeoutException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLTimeoutException.java+171−0
@@ -0,0 +1,171 @@
1+/*
2+ * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+ *
5+ * This code is free software; you can redistribute it and/or modify it
6+ * under the terms of the GNU General Public License version 2 only, as
7+ * published by the Free Software Foundation. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle in the LICENSE file that accompanied this code.
10+ *
11+ * This code is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+ * version 2 for more details (a copy is included in the LICENSE file that
15+ * accompanied this code).
16+ *
17+ * You should have received a copy of the GNU General Public License version
18+ * 2 along with this work; if not, write to the Free Software Foundation,
19+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+ *
21+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package java.sql;
27+
28+/**
29+ * <P>The subclass of {@link SQLException} thrown when the timeout specified by <code>Statement</code>
30+ * has expired.
31+ * <P> This exception does not correspond to a standard SQLState.
32+ *
33+ * @since 1.6
34+ */
35+
36+public class SQLTimeoutException extends SQLTransientException {
37+ /**
38+ * Constructs a <code>SQLTimeoutException</code> object.
39+ * The <code>reason</code>, <code>SQLState</code> are initialized
40+ * to <code>null</code> and the vendor code is initialized to 0.
41+ *
42+ * The <code>cause</code> is not initialized, and may subsequently be
43+ * initialized by a call to the
44+ * {@link Throwable#initCause(java.lang.Throwable)} method.
45+ * <p>
46+ * @since 1.6
47+ */
48+ public SQLTimeoutException() {
49+ super();
50+ }
51+
52+ /**
53+ * Constructs a <code>SQLTimeoutException</code> object
54+ * with a given <code>reason</code>. The <code>SQLState</code>
55+ * is initialized to <code>null</code> and the vender code is initialized
56+ * to 0.
57+ *
58+ * The <code>cause</code> is not initialized, and may subsequently be
59+ * initialized by a call to the
60+ * {@link Throwable#initCause(java.lang.Throwable)} method.
61+ * <p>
62+ * @param reason a description of the exception
63+ * @since 1.6

108 more lines aren’t shown here.

java/pkg/java/sql/SQLTransactionRollbackException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLTransactionRollbackException.java+173−0

This diff is large: its 174 lines aren’t shown here.

java/pkg/java/sql/SQLTransientConnectionException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLTransientConnectionException.java+174−0

This diff is large: its 175 lines aren’t shown here.

java/pkg/java/sql/SQLTransientException.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLTransientException.java+172−0

This diff is large: its 173 lines aren’t shown here.

java/pkg/java/sql/SQLWarning.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLWarning.java+217−0

This diff is large: its 218 lines aren’t shown here.

java/pkg/java/sql/SQLXML.class+0−0

Binary file not shown.

java/pkg/java/sql/SQLXML.java+425−0

This diff is large: its 426 lines aren’t shown here.

java/pkg/java/sql/Savepoint.class+0−0

Binary file not shown.

java/pkg/java/sql/Savepoint.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/java/sql/Statement.class+0−0

Binary file not shown.

java/pkg/java/sql/Statement.java+1063−0

This diff is large: its 1064 lines aren’t shown here.

java/pkg/java/sql/Struct.class+0−0

Binary file not shown.

java/pkg/java/sql/Struct.java+106−0

This diff is large: its 107 lines aren’t shown here.

java/pkg/java/sql/Time.class+0−0

Binary file not shown.

java/pkg/java/sql/Time.java+248−0

This diff is large: its 249 lines aren’t shown here.

java/pkg/java/sql/Timestamp.class+0−0

Binary file not shown.

java/pkg/java/sql/Timestamp.java+532−0

This diff is large: its 533 lines aren’t shown here.

java/pkg/java/sql/Types.class+0−0

Binary file not shown.

java/pkg/java/sql/Types.java+314−0

This diff is large: its 315 lines aren’t shown here.

java/pkg/java/sql/Wrapper.class+0−0

Binary file not shown.

java/pkg/java/sql/Wrapper.java+80−0

This diff is large: its 81 lines aren’t shown here.

java/pkg/java/sql/mkfile+56−0

This diff is large: its 57 lines aren’t shown here.

java/pkg/java/sql/package.html+326−0

This diff is large: its 327 lines aren’t shown here.