|
From: <ls...@us...> - 2007-06-17 07:38:32
|
Revision: 3269
http://jnode.svn.sourceforge.net/jnode/?rev=3269&view=rev
Author: lsantha
Date: 2007-06-17 00:38:28 -0700 (Sun, 17 Jun 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/sql/
trunk/core/src/openjdk/java/java/sql/Array.java
trunk/core/src/openjdk/java/java/sql/BatchUpdateException.java
trunk/core/src/openjdk/java/java/sql/Blob.java
trunk/core/src/openjdk/java/java/sql/CallableStatement.java
trunk/core/src/openjdk/java/java/sql/ClientInfoStatus.java
trunk/core/src/openjdk/java/java/sql/Clob.java
trunk/core/src/openjdk/java/java/sql/Connection.java
trunk/core/src/openjdk/java/java/sql/DataTruncation.java
trunk/core/src/openjdk/java/java/sql/DatabaseMetaData.java
trunk/core/src/openjdk/java/java/sql/Date.java
trunk/core/src/openjdk/java/java/sql/Driver.java
trunk/core/src/openjdk/java/java/sql/DriverManager.java
trunk/core/src/openjdk/java/java/sql/DriverPropertyInfo.java
trunk/core/src/openjdk/java/java/sql/NClob.java
trunk/core/src/openjdk/java/java/sql/ParameterMetaData.java
trunk/core/src/openjdk/java/java/sql/PreparedStatement.java
trunk/core/src/openjdk/java/java/sql/Ref.java
trunk/core/src/openjdk/java/java/sql/ResultSet.java
trunk/core/src/openjdk/java/java/sql/ResultSetMetaData.java
trunk/core/src/openjdk/java/java/sql/RowId.java
trunk/core/src/openjdk/java/java/sql/RowIdLifetime.java
trunk/core/src/openjdk/java/java/sql/SQLClientInfoException.java
trunk/core/src/openjdk/java/java/sql/SQLData.java
trunk/core/src/openjdk/java/java/sql/SQLDataException.java
trunk/core/src/openjdk/java/java/sql/SQLException.java
trunk/core/src/openjdk/java/java/sql/SQLFeatureNotSupportedException.java
trunk/core/src/openjdk/java/java/sql/SQLInput.java
trunk/core/src/openjdk/java/java/sql/SQLIntegrityConstraintViolationException.java
trunk/core/src/openjdk/java/java/sql/SQLInvalidAuthorizationSpecException.java
trunk/core/src/openjdk/java/java/sql/SQLNonTransientConnectionException.java
trunk/core/src/openjdk/java/java/sql/SQLNonTransientException.java
trunk/core/src/openjdk/java/java/sql/SQLOutput.java
trunk/core/src/openjdk/java/java/sql/SQLPermission.java
trunk/core/src/openjdk/java/java/sql/SQLRecoverableException.java
trunk/core/src/openjdk/java/java/sql/SQLSyntaxErrorException.java
trunk/core/src/openjdk/java/java/sql/SQLTimeoutException.java
trunk/core/src/openjdk/java/java/sql/SQLTransactionRollbackException.java
trunk/core/src/openjdk/java/java/sql/SQLTransientConnectionException.java
trunk/core/src/openjdk/java/java/sql/SQLTransientException.java
trunk/core/src/openjdk/java/java/sql/SQLWarning.java
trunk/core/src/openjdk/java/java/sql/SQLXML.java
trunk/core/src/openjdk/java/java/sql/Savepoint.java
trunk/core/src/openjdk/java/java/sql/Statement.java
trunk/core/src/openjdk/java/java/sql/Struct.java
trunk/core/src/openjdk/java/java/sql/Time.java
trunk/core/src/openjdk/java/java/sql/Timestamp.java
trunk/core/src/openjdk/java/java/sql/Types.java
trunk/core/src/openjdk/java/java/sql/Wrapper.java
trunk/core/src/openjdk/java/java/sql/package.html
Added: trunk/core/src/openjdk/java/java/sql/Array.java
===================================================================
--- trunk/core/src/openjdk/java/java/sql/Array.java (rev 0)
+++ trunk/core/src/openjdk/java/java/sql/Array.java 2007-06-17 07:38:28 UTC (rev 3269)
@@ -0,0 +1,368 @@
+/*
+ * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.sql;
+
+/**
+ * The mapping in the Java programming language for the SQL type
+ * <code>ARRAY</code>.
+ * By default, an <code>Array</code> value is a transaction-duration
+ * reference to an SQL <code>ARRAY</code> value. By default, an <code>Array</code>
+ * object is implemented using an SQL LOCATOR(array) internally, which
+ * means that an <code>Array</code> object contains a logical pointer
+ * to the data in the SQL <code>ARRAY</code> value rather
+ * than containing the <code>ARRAY</code> value's data.
+ * <p>
+ * The <code>Array</code> interface provides methods for bringing an SQL
+ * <code>ARRAY</code> value's data to the client as either an array or a
+ * <code>ResultSet</code> object.
+ * If the elements of the SQL <code>ARRAY</code>
+ * are a UDT, they may be custom mapped. To create a custom mapping,
+ * a programmer must do two things:
+ * <ul>
+ * <li>create a class that implements the {@link SQLData}
+ * interface for the UDT to be custom mapped.
+ * <li>make an entry in a type map that contains
+ * <ul>
+ * <li>the fully-qualified SQL type name of the UDT
+ * <li>the <code>Class</code> object for the class implementing
+ * <code>SQLData</code>
+ * </ul>
+ * </ul>
+ * <p>
+ * When a type map with an entry for
+ * the base type is supplied to the methods <code>getArray</code>
+ * and <code>getResultSet</code>, the mapping
+ * it contains will be used to map the elements of the <code>ARRAY</code> value.
+ * If no type map is supplied, which would typically be the case,
+ * the connection's type map is used by default.
+ * If the connection's type map or a type map supplied to a method has no entry
+ * for the base type, the elements are mapped according to the standard mapping.
+ * <p>
+ * All methods on the <code>Array</code> interface must be fully implemented if the
+ * JDBC driver supports the data type.
+ *
+ * @since 1.2
+ */
+
+public interface Array {
+
+ /**
+ * Retrieves the SQL type name of the elements in
+ * the array designated by this <code>Array</code> object.
+ * If the elements are a built-in type, it returns
+ * the database-specific type name of the elements.
+ * If the elements are a user-defined type (UDT),
+ * this method returns the fully-qualified SQL type name.
+ *
+ * @return a <code>String</code> that is the database-specific
+ * name for a built-in base type; or the fully-qualified SQL type
+ * name for a base type that is a UDT
+ * @exception SQLException if an error occurs while attempting
+ * to access the type name
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ String getBaseTypeName() throws SQLException;
+
+ /**
+ * Retrieves the JDBC type of the elements in the array designated
+ * by this <code>Array</code> object.
+ *
+ * @return a constant from the class {@link java.sql.Types} that is
+ * the type code for the elements in the array designated by this
+ * <code>Array</code> object
+ * @exception SQLException if an error occurs while attempting
+ * to access the base type
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ int getBaseType() throws SQLException;
+
+ /**
+ * Retrieves the contents of the SQL <code>ARRAY</code> value designated
+ * by this
+ * <code>Array</code> object in the form of an array in the Java
+ * programming language. This version of the method <code>getArray</code>
+ * uses the type map associated with the connection for customizations of
+ * the type mappings.
+ * <p>
+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
+ * a base type that maps to a primitive data type, then it is
+ * implementation-defined whether the array returned is an array of
+ * that primitive data type or an array of <code>Object</code>.
+ *
+ * @return an array in the Java programming language that contains
+ * the ordered elements of the SQL <code>ARRAY</code> value
+ * designated by this <code>Array</code> object
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ Object getArray() throws SQLException;
+
+ /**
+ * Retrieves the contents of the SQL <code>ARRAY</code> value designated by this
+ * <code>Array</code> object.
+ * This method uses
+ * the specified <code>map</code> for type map customizations
+ * unless the base type of the array does not match a user-defined
+ * type in <code>map</code>, in which case it
+ * uses the standard mapping. This version of the method
+ * <code>getArray</code> uses either the given type map or the standard mapping;
+ * it never uses the type map associated with the connection.
+ * <p>
+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
+ * a base type that maps to a primitive data type, then it is
+ * implementation-defined whether the array returned is an array of
+ * that primitive data type or an array of <code>Object</code>.
+ *
+ * @param map a <code>java.util.Map</code> object that contains mappings
+ * of SQL type names to classes in the Java programming language
+ * @return an array in the Java programming language that contains the ordered
+ * elements of the SQL array designated by this object
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ Object getArray(java.util.Map<String,Class<?>> map) throws SQLException;
+
+ /**
+ * Retrieves a slice of the SQL <code>ARRAY</code>
+ * value designated by this <code>Array</code> object, beginning with the
+ * specified <code>index</code> and containing up to <code>count</code>
+ * successive elements of the SQL array. This method uses the type map
+ * associated with the connection for customizations of the type mappings.
+ * <p>
+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
+ * a base type that maps to a primitive data type, then it is
+ * implementation-defined whether the array returned is an array of
+ * that primitive data type or an array of <code>Object</code>.
+ *
+ * @param index the array index of the first element to retrieve;
+ * the first element is at index 1
+ * @param count the number of successive SQL array elements to retrieve
+ * @return an array containing up to <code>count</code> consecutive elements
+ * of the SQL array, beginning with element <code>index</code>
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ Object getArray(long index, int count) throws SQLException;
+
+ /**
+ * Retreives a slice of the SQL <code>ARRAY</code> value
+ * designated by this <code>Array</code> object, beginning with the specified
+ * <code>index</code> and containing up to <code>count</code>
+ * successive elements of the SQL array.
+ * <P>
+ * This method uses
+ * the specified <code>map</code> for type map customizations
+ * unless the base type of the array does not match a user-defined
+ * type in <code>map</code>, in which case it
+ * uses the standard mapping. This version of the method
+ * <code>getArray</code> uses either the given type map or the standard mapping;
+ * it never uses the type map associated with the connection.
+ * <p>
+ * <strong>Note:</strong> When <code>getArray</code> is used to materialize
+ * a base type that maps to a primitive data type, then it is
+ * implementation-defined whether the array returned is an array of
+ * that primitive data type or an array of <code>Object</code>.
+ *
+ * @param index the array index of the first element to retrieve;
+ * the first element is at index 1
+ * @param count the number of successive SQL array elements to
+ * retrieve
+ * @param map a <code>java.util.Map</code> object
+ * that contains SQL type names and the classes in
+ * the Java programming language to which they are mapped
+ * @return an array containing up to <code>count</code>
+ * consecutive elements of the SQL <code>ARRAY</code> value designated by this
+ * <code>Array</code> object, beginning with element
+ * <code>index</code>
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ Object getArray(long index, int count, java.util.Map<String,Class<?>> map)
+ throws SQLException;
+
+ /**
+ * Retrieves a result set that contains the elements of the SQL
+ * <code>ARRAY</code> value
+ * designated by this <code>Array</code> object. If appropriate,
+ * the elements of the array are mapped using the connection's type
+ * map; otherwise, the standard mapping is used.
+ * <p>
+ * The result set contains one row for each array element, with
+ * two columns in each row. The second column stores the element
+ * value; the first column stores the index into the array for
+ * that element (with the first array element being at index 1).
+ * The rows are in ascending order corresponding to
+ * the order of the indices.
+ *
+ * @return a {@link ResultSet} object containing one row for each
+ * of the elements in the array designated by this <code>Array</code>
+ * object, with the rows in ascending order based on the indices.
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ ResultSet getResultSet () throws SQLException;
+
+ /**
+ * Retrieves a result set that contains the elements of the SQL
+ * <code>ARRAY</code> value designated by this <code>Array</code> object.
+ * This method uses
+ * the specified <code>map</code> for type map customizations
+ * unless the base type of the array does not match a user-defined
+ * type in <code>map</code>, in which case it
+ * uses the standard mapping. This version of the method
+ * <code>getResultSet</code> uses either the given type map or the standard mapping;
+ * it never uses the type map associated with the connection.
+ * <p>
+ * The result set contains one row for each array element, with
+ * two columns in each row. The second column stores the element
+ * value; the first column stores the index into the array for
+ * that element (with the first array element being at index 1).
+ * The rows are in ascending order corresponding to
+ * the order of the indices.
+ *
+ * @param map contains the mapping of SQL user-defined types to
+ * classes in the Java programming language
+ * @return a <code>ResultSet</code> object containing one row for each
+ * of the elements in the array designated by this <code>Array</code>
+ * object, with the rows in ascending order based on the indices.
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ ResultSet getResultSet (java.util.Map<String,Class<?>> map) throws SQLException;
+
+ /**
+ * Retrieves a result set holding the elements of the subarray that
+ * starts at index <code>index</code> and contains up to
+ * <code>count</code> successive elements. This method uses
+ * the connection's type map to map the elements of the array if
+ * the map contains an entry for the base type. Otherwise, the
+ * standard mapping is used.
+ * <P>
+ * The result set has one row for each element of the SQL array
+ * designated by this object, with the first row containing the
+ * element at index <code>index</code>. The result set has
+ * up to <code>count</code> rows in ascending order based on the
+ * indices. Each row has two columns: The second column stores
+ * the element value; the first column stores the index into the
+ * array for that element.
+ *
+ * @param index the array index of the first element to retrieve;
+ * the first element is at index 1
+ * @param count the number of successive SQL array elements to retrieve
+ * @return a <code>ResultSet</code> object containing up to
+ * <code>count</code> consecutive elements of the SQL array
+ * designated by this <code>Array</code> object, starting at
+ * index <code>index</code>.
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ ResultSet getResultSet(long index, int count) throws SQLException;
+
+ /**
+ * Retrieves a result set holding the elements of the subarray that
+ * starts at index <code>index</code> and contains up to
+ * <code>count</code> successive elements.
+ * This method uses
+ * the specified <code>map</code> for type map customizations
+ * unless the base type of the array does not match a user-defined
+ * type in <code>map</code>, in which case it
+ * uses the standard mapping. This version of the method
+ * <code>getResultSet</code> uses either the given type map or the standard mapping;
+ * it never uses the type map associated with the connection.
+ * <P>
+ * The result set has one row for each element of the SQL array
+ * designated by this object, with the first row containing the
+ * element at index <code>index</code>. The result set has
+ * up to <code>count</code> rows in ascending order based on the
+ * indices. Each row has two columns: The second column stores
+ * the element value; the first column stroes the index into the
+ * array for that element.
+ *
+ * @param index the array index of the first element to retrieve;
+ * the first element is at index 1
+ * @param count the number of successive SQL array elements to retrieve
+ * @param map the <code>Map</code> object that contains the mapping
+ * of SQL type names to classes in the Java(tm) programming language
+ * @return a <code>ResultSet</code> object containing up to
+ * <code>count</code> consecutive elements of the SQL array
+ * designated by this <code>Array</code> object, starting at
+ * index <code>index</code>.
+ * @exception SQLException if an error occurs while attempting to
+ * access the array
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ ResultSet getResultSet (long index, int count,
+ java.util.Map<String,Class<?>> map)
+ throws SQLException;
+ /**
+ * This method frees the <code>Array</code> object and releases the resources that
+ * it holds. The object is invalid once the <code>free</code>
+ * method is called.
+ *<p>
+ * After <code>free</code> has been called, any attempt to invoke a
+ * method other than <code>free</code> will result in a <code>SQLException</code>
+ * being thrown. If <code>free</code> is called multiple times, the subsequent
+ * calls to <code>free</code> are treated as a no-op.
+ *<p>
+ *
+ * @throws SQLException if an error occurs releasing
+ * the Array's resources
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ void free() throws SQLException;
+
+}
+
+
Added: trunk/core/src/openjdk/java/java/sql/BatchUpdateException.java
===================================================================
--- trunk/core/src/openjdk/java/java/sql/BatchUpdateException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/sql/BatchUpdateException.java 2007-06-17 07:38:28 UTC (rev 3269)
@@ -0,0 +1,346 @@
+/*
+ * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.sql;
+
+/**
+ * The subclass of {@link SQLException} thrown when an error
+ * occurs during a batch update operation. In addition to the
+ * information provided by {@link SQLException}, a
+ * <code>BatchUpdateException</code> provides the update
+ * counts for all commands that were executed successfully during the
+ * batch update, that is, all commands that were executed before the error
+ * occurred. The order of elements in an array of update counts
+ * corresponds to the order in which commands were added to the batch.
+ * <P>
+ * After a command in a batch update fails to execute properly
+ * and a <code>BatchUpdateException</code> is thrown, the driver
+ * may or may not continue to process the remaining commands in
+ * the batch. If the driver continues processing after a failure,
+ * the array returned by the method
+ * <code>BatchUpdateException.getUpdateCounts</code> will have
+ * an element for every command in the batch rather than only
+ * elements for the commands that executed successfully before
+ * the error. In the case where the driver continues processing
+ * commands, the array element for any command
+ * that failed is <code>Statement.EXECUTE_FAILED</code>.
+ * <P>
+ * @since 1.2
+ */
+
+public class BatchUpdateException extends SQLException {
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
+ * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code> and
+ * <code>updateCounts</code>.
+ * The <code>cause</code> is not initialized, and may subsequently be
+ * initialized by a call to the
+ * {@link Throwable#initCause(java.lang.Throwable)} method.
+ * <p>
+ *
+ * @param reason a description of the error
+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
+ * @param vendorCode an exception code used by a particular
+ * database vendor
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @since 1.2
+ */
+ public BatchUpdateException( String reason, String SQLState, int vendorCode,
+ int[] updateCounts ) {
+ super(reason, SQLState, vendorCode);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
+ * <code>reason</code>, <code>SQLState</code> and
+ * <code>updateCounts</code>.
+ * The <code>cause</code> is not initialized, and may subsequently be
+ * initialized by a call to the
+ * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
+ * is intialized to 0.
+ * <p>
+ *
+ * @param reason a description of the exception
+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @since 1.2
+ */
+ public BatchUpdateException(String reason, String SQLState,
+ int[] updateCounts) {
+ super(reason, SQLState);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
+ * <code>reason</code> and <code>updateCounts</code>.
+ * The <code>cause</code> is not initialized, and may subsequently be
+ * initialized by a call to the
+ * {@link Throwable#initCause(java.lang.Throwable)} method. The
+ * <code>SQLState</code> is initialized to <code>null</code>
+ * and the vender code is initialized to 0.
+ * <p>
+ *
+ *
+ * @param reason a description of the exception
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @since 1.2
+ */
+ public BatchUpdateException(String reason, int[] updateCounts) {
+ super(reason);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with a given
+ * <code>updateCounts</code>.
+ * initialized by a call to the
+ * {@link Throwable#initCause(java.lang.Throwable)} method. The <code>reason</code>
+ * and <code>SQLState</code> are initialized to null and the vendor code
+ * is initialized to 0.
+ * <p>
+ *
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @since 1.2
+ */
+ public BatchUpdateException(int[] updateCounts) {
+ super();
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object.
+ * The <code>reason</code>, <code>SQLState</code> and <code>updateCounts</code>
+ * are initialized to <code>null</code> and the vendor code is initialized to 0.
+ * The <code>cause</code> is not initialized, and may subsequently be
+ * initialized by a call to the
+ * {@link Throwable#initCause(java.lang.Throwable)} method.
+ * <p>
+ *
+ * @since 1.2
+ */
+ public BatchUpdateException() {
+ super();
+ this.updateCounts = null;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with
+ * a given <code>cause</code>.
+ * The <code>SQLState</code> and <code>updateCounts</code>
+ * are initialized
+ * to <code>null</code> and the vendor code is initialized to 0.
+ * The <code>reason</code> is initialized to <code>null</code> if
+ * <code>cause==null</code> or to <code>cause.toString()</code> if
+ * <code>cause!=null</code>.
+ * @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 the cause is non-existent or unknown.
+ * @since 1.6
+ */
+ public BatchUpdateException(Throwable cause) {
+ super(cause);
+ this.updateCounts = null;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with a
+ * given <code>cause</code> and <code>updateCounts</code>.
+ * The <code>SQLState</code> is initialized
+ * to <code>null</code> and the vendor code is initialized to 0.
+ * The <code>reason</code> is initialized to <code>null</code> if
+ * <code>cause==null</code> or to <code>cause.toString()</code> if
+ * <code>cause!=null</code>.
+ *
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @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
+ * the cause is non-existent or unknown.
+ * @since 1.6
+ */
+ public BatchUpdateException(int []updateCounts , Throwable cause) {
+ super(cause);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with
+ * a given <code>reason</code>, <code>cause</code>
+ * and <code>updateCounts</code>. The <code>SQLState</code> is initialized
+ * to <code>null</code> and the vendor code is initialized to 0.
+ *
+ * @param reason a description of the exception
+ * @param updateCounts an array of <code>int</code>, with each element
+ *indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @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
+ * the cause is non-existent or unknown.
+ * @since 1.6
+ */
+ public BatchUpdateException(String reason, int []updateCounts, Throwable cause) {
+ super(reason,cause);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with
+ * a given <code>reason</code>, <code>SQLState</code>,<code>cause</code>, and
+ * <code>updateCounts</code>. The vendor code is initialized to 0.
+ *
+ * @param reason a description of the exception
+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
+ * @param updateCounts an array of <code>int</code>, with each element
+ * indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @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
+ * the cause is non-existent or unknown.
+ * @since 1.6
+ */
+ public BatchUpdateException(String reason, String SQLState,
+ int []updateCounts, Throwable cause) {
+ super(reason,SQLState,cause);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Constructs a <code>BatchUpdateException</code> object initialized with
+ * a given <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
+ * <code>cause</code> and <code>updateCounts</code>.
+ *
+ * @param reason a description of the error
+ * @param SQLState an XOPEN or SQL:2003 code identifying the exception
+ * @param vendorCode an exception code used by a particular
+ * database vendor
+ * @param updateCounts an array of <code>int</code>, with each element
+ *indicating the update count, <code>Statement.SUCCESS_NO_INFO</code> or
+ * <code>Statement.EXECUTE_FAILED</code> for each SQL command in
+ * the batch for JDBC drivers that continue processing
+ * after a command failure; an update count or
+ * <code>Statement.SUCCESS_NO_INFO</code> for each SQL command in the batch
+ * prior to the failure for JDBC drivers that stop processing after a command
+ * failure
+ * @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
+ * the cause is non-existent or unknown.
+ * @since 1.6
+ */
+ public BatchUpdateException(String reason, String SQLState, int vendorCode,
+ int []updateCounts,Throwable cause) {
+ super(reason,SQLState,vendorCode,cause);
+ this.updateCounts = updateCounts;
+ }
+
+ /**
+ * Retrieves the update count for each update statement in the batch
+ * update that executed successfully before this exception occurred.
+ * A driver that implements batch updates may or may not continue to
+ * process the remaining commands in a batch when one of the commands
+ * fails to execute properly. If the driver continues processing commands,
+ * the array returned by this method will have as many elements as
+ * there are commands in the batch; otherwise, it will contain an
+ * update count for each command that executed successfully before
+ * the <code>BatchUpdateException</code> was thrown.
+ *<P>
+ * The possible return values for this method were modified for
+ * the Java 2 SDK, Standard Edition, version 1.3. This was done to
+ * accommodate the new option of continuing to process commands
+ * in a batch update after a <code>BatchUpdateException</code> object
+ * has been thrown.
+ *
+ * @return an array of <code>int</code> containing the update counts
+ * for the updates that were executed successfully before this error
+ * occurred. Or, if the driver continues to process commands after an
+ * error, one of the following for every command in the batch:
+ * <OL>
+ * <LI>an update count
+ * <LI><code>Statement.SUCCESS_NO_INFO</code> to indicate that the command
+ * executed successfully but the number of rows affected is unknown
+ * <LI><code>Statement.EXECUTE_FAILED</code> to indicate that the command
+ * failed to execute successfully
+ * </OL>
+ * @since 1.3
+ */
+ public int[] getUpdateCounts() {
+ return updateCounts;
+ }
+
+ /**
+ * The array that describes the outcome of a batch execution.
+ * @serial
+ * @since 1.2
+ */
+ private int[] updateCounts;
+
+ private static final long serialVersionUID = 5977529877145521757L;
+}
Added: trunk/core/src/openjdk/java/java/sql/Blob.java
===================================================================
--- trunk/core/src/openjdk/java/java/sql/Blob.java (rev 0)
+++ trunk/core/src/openjdk/java/java/sql/Blob.java 2007-06-17 07:38:28 UTC (rev 3269)
@@ -0,0 +1,306 @@
+/*
+ * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.sql;
+
+import java.io.InputStream;
+
+/**
+ * The representation (mapping) in
+ * the Java<sup><font size=-2>TM</font></sup> programming
+ * language of an SQL
+ * <code>BLOB</code> value. An SQL <code>BLOB</code> is a built-in type
+ * that stores a Binary Large Object as a column value in a row of
+ * a database table. By default drivers implement <code>Blob</code> using
+ * an SQL <code>locator(BLOB)</code>, which means that a
+ * <code>Blob</code> object contains a logical pointer to the
+ * SQL <code>BLOB</code> data rather than the data itself.
+ * A <code>Blob</code> object is valid for the duration of the
+ * transaction in which is was created.
+ *
+ * <P>Methods in the interfaces {@link ResultSet},
+ * {@link CallableStatement}, and {@link PreparedStatement}, such as
+ * <code>getBlob</code> and <code>setBlob</code> allow a programmer to
+ * access an SQL <code>BLOB</code> value.
+ * The <code>Blob</code> interface provides methods for getting the
+ * length of an SQL <code>BLOB</code> (Binary Large Object) value,
+ * for materializing a <code>BLOB</code> value on the client, and for
+ * determining the position of a pattern of bytes within a
+ * <code>BLOB</code> value. In addition, this interface has methods for updating
+ * a <code>BLOB</code> value.
+ * <p>
+ * All methods on the <code>Blob</code> interface must be fully implemented if the
+ * JDBC driver supports the data type.
+ *
+ * @since 1.2
+ */
+
+public interface Blob {
+
+ /**
+ * Returns the number of bytes in the <code>BLOB</code> value
+ * designated by this <code>Blob</code> object.
+ * @return length of the <code>BLOB</code> in bytes
+ * @exception SQLException if there is an error accessing the
+ * length of the <code>BLOB</code>
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ long length() throws SQLException;
+
+ /**
+ * Retrieves all or part of the <code>BLOB</code>
+ * value that this <code>Blob</code> object represents, as an array of
+ * bytes. This <code>byte</code> array contains up to <code>length</code>
+ * consecutive bytes starting at position <code>pos</code>.
+ *
+ * @param pos the ordinal position of the first byte in the
+ * <code>BLOB</code> value to be extracted; the first byte is at
+ * position 1
+ * @param length the number of consecutive bytes to be copied; the value
+ * for length must be 0 or greater
+ * @return a byte array containing up to <code>length</code>
+ * consecutive bytes from the <code>BLOB</code> value designated
+ * by this <code>Blob</code> object, starting with the
+ * byte at position <code>pos</code>
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value; if pos is less than 1 or length is
+ * less than 0
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @see #setBytes
+ * @since 1.2
+ */
+ byte[] getBytes(long pos, int length) throws SQLException;
+
+ /**
+ * Retrieves the <code>BLOB</code> value designated by this
+ * <code>Blob</code> instance as a stream.
+ *
+ * @return a stream containing the <code>BLOB</code> data
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @see #setBinaryStream
+ * @since 1.2
+ */
+ java.io.InputStream getBinaryStream () throws SQLException;
+
+ /**
+ * Retrieves the byte position at which the specified byte array
+ * <code>pattern</code> begins within the <code>BLOB</code>
+ * value that this <code>Blob</code> object represents. The
+ * search for <code>pattern</code> begins at position
+ * <code>start</code>.
+ *
+ * @param pattern the byte array for which to search
+ * @param start the position at which to begin searching; the
+ * first position is 1
+ * @return the position at which the pattern appears, else -1
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> or if start is less than 1
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ long position(byte pattern[], long start) throws SQLException;
+
+ /**
+ * Retrieves the byte position in the <code>BLOB</code> value
+ * designated by this <code>Blob</code> object at which
+ * <code>pattern</code> begins. The search begins at position
+ * <code>start</code>.
+ *
+ * @param pattern the <code>Blob</code> object designating
+ * the <code>BLOB</code> value for which to search
+ * @param start the position in the <code>BLOB</code> value
+ * at which to begin searching; the first position is 1
+ * @return the position at which the pattern begins, else -1
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value or if start is less than 1
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.2
+ */
+ long position(Blob pattern, long start) throws SQLException;
+
+ // -------------------------- JDBC 3.0 -----------------------------------
+
+ /**
+ * Writes the given array of bytes to the <code>BLOB</code> value that
+ * this <code>Blob</code> object represents, starting at position
+ * <code>pos</code>, and returns the number of bytes written.
+ * The array of bytes will overwrite the existing bytes
+ * in the <code>Blob</code> object starting at the position
+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
+ * while writing the array of bytes, then the length of the <code>Blob</code>
+ * value will be increased to accomodate the extra bytes.
+ * <p>
+ * <b>Note:</b> If the value specified for <code>pos</code>
+ * is greater then the length+1 of the <code>BLOB</code> value then the
+ * behavior is undefined. Some JDBC drivers may throw a
+ * <code>SQLException</code> while other drivers may support this
+ * operation.
+ *
+ * @param pos the position in the <code>BLOB</code> object at which
+ * to start writing; the first position is 1
+ * @param bytes the array of bytes to be written to the <code>BLOB</code>
+ * value that this <code>Blob</code> object represents
+ * @return the number of bytes written
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value or if pos is less than 1
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @see #getBytes
+ * @since 1.4
+ */
+ int setBytes(long pos, byte[] bytes) throws SQLException;
+
+ /**
+ * Writes all or part of the given <code>byte</code> array to the
+ * <code>BLOB</code> value that this <code>Blob</code> object represents
+ * and returns the number of bytes written.
+ * Writing starts at position <code>pos</code> in the <code>BLOB</code>
+ * value; <code>len</code> bytes from the given byte array are written.
+ * The array of bytes will overwrite the existing bytes
+ * in the <code>Blob</code> object starting at the position
+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
+ * while writing the array of bytes, then the length of the <code>Blob</code>
+ * value will be increased to accomodate the extra bytes.
+ * <p>
+ * <b>Note:</b> If the value specified for <code>pos</code>
+ * is greater then the length+1 of the <code>BLOB</code> value then the
+ * behavior is undefined. Some JDBC drivers may throw a
+ * <code>SQLException</code> while other drivers may support this
+ * operation.
+ *
+ * @param pos the position in the <code>BLOB</code> object at which
+ * to start writing; the first position is 1
+ * @param bytes the array of bytes to be written to this <code>BLOB</code>
+ * object
+ * @param offset the offset into the array <code>bytes</code> at which
+ * to start reading the bytes to be set
+ * @param len the number of bytes to be written to the <code>BLOB</code>
+ * value from the array of bytes <code>bytes</code>
+ * @return the number of bytes written
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value or if pos is less than 1
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @see #getBytes
+ * @since 1.4
+ */
+ int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException;
+
+ /**
+ * Retrieves a stream that can be used to write to the <code>BLOB</code>
+ * value that this <code>Blob</code> object represents. The stream begins
+ * at position <code>pos</code>.
+ * The bytes written to the stream will overwrite the existing bytes
+ * in the <code>Blob</code> object starting at the position
+ * <code>pos</code>. If the end of the <code>Blob</code> value is reached
+ * while writing to the stream, then the length of the <code>Blob</code>
+ * value will be increased to accomodate the extra bytes.
+ * <p>
+ * <b>Note:</b> If the value specified for <code>pos</code>
+ * is greater then the length+1 of the <code>BLOB</code> value then the
+ * behavior is undefined. Some JDBC drivers may throw a
+ * <code>SQLException</code> while other drivers may support this
+ * operation.
+ *
+ * @param pos the position in the <code>BLOB</code> value at which
+ * to start writing; the first position is 1
+ * @return a <code>java.io.OutputStream</code> object to which data can
+ * be written
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value or if pos is less than 1
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @see #getBinaryStream
+ * @since 1.4
+ */
+ java.io.OutputStream setBinaryStream(long pos) throws SQLException;
+
+ /**
+ * Truncates the <code>BLOB</code> value that this <code>Blob</code>
+ * object represents to be <code>len</code> bytes in length.
+ * <p>
+ * <b>Note:</b> If the value specified for <code>pos</code>
+ * is greater then the length+1 of the <code>BLOB</code> value then the
+ * behavior is undefined. Some JDBC drivers may throw a
+ * <code>SQLException</code> while other drivers may support this
+ * operation.
+ *
+ * @param len the length, in bytes, to which the <code>BLOB</code> value
+ * that this <code>Blob</code> object represents should be truncated
+ * @exception SQLException if there is an error accessing the
+ * <code>BLOB</code> value or if len is less than 0
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.4
+ */
+ void truncate(long len) throws SQLException;
+
+ /**
+ * This method frees the <code>Blob</code> object and releases the resources that
+ * it holds. The object is invalid once the <code>free</code>
+ * method is called.
+ *<p>
+ * After <code>free</code> has been called, any attempt to invoke a
+ * method other than <code>free</code> will result in a <code>SQLException</code>
+ * being thrown. If <code>free</code> is called multiple times, the subsequent
+ * calls to <code>free</code> are treated as a no-op.
+ *<p>
+ *
+ * @throws SQLException if an error occurs releasing
+ * the Blob's resources
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ void free() throws SQLException;
+
+ /**
+ * Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
+ * starting with the byte specified by pos, which is length bytes in length.
+ *
+ * @param pos the offset to the first byte of the partial value to be retrieved.
+ * The first byte in the <code>Blob</code> is at position 1
+ * @param length the length in bytes of the partial value to be retrieved
+ * @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
+ * @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
+ * in the <code>Blob</code> or if pos + length is greater than the number of bytes
+ * in the <code>Blob</code>
+ *
+ * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+ * this method
+ * @since 1.6
+ */
+ InputStream getBinaryStream(long pos, long length) throws SQLException;
+}
+
+
Added: trunk/core/src/openjdk/java/java/sql/CallableStatement.java
===================================================================
--- trunk/core/src/openjdk/java/java/sql/CallableStatement.java (rev 0)
+++ trunk/core/src/openjdk/java/java/sql/CallableStatement.java 2007-06-17 07:38:28 UTC (rev 3269)
@@ -0,0 +1,2444 @@
+/*
+ * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.sql;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.io.Reader;
+import java.io.InputStream;
+
+/**
+ * The interface used to execute SQL stored procedures. The JDBC API
+ * provides a stored procedure SQL escape syntax that allows stored procedures
+ * to be called in a standard way for all RDBMSs. This escape syntax has one
+ * form that includes a result parameter and one that does not. If used, the result
+ * parameter must be registered as an OUT parameter. The other parameters
+ * can be used for input, output or both. Parameters are referred to
+ * sequentially, by number, with the first parameter being 1.
+ * <PRE>
+ * {?= call <procedure-name>[(<arg1>,<arg2>, ...)]}
+ * {call <procedure-name>[(<arg1>,<arg2>, ...)]}
+ * </PRE>
+ * <P>
+ * IN parameter values are set using the <code>set</code> methods inherited from
+ * {@link PreparedStatement}. The type of all OUT parameters must be
+ * registered prior to executing the stored procedure; their values
+ * are retrieved after execution via the <code>get</code> methods provided here.
+ * <P>
+ * A <code>CallableStatement</code> can return one {@link ResultSet} object or
+ * multiple <code>ResultSet</code> objects. Multiple
+ * <code>ResultSet</code> objects are handled using operations
+ * inherited from {@link Statement}.
+ * <P>
+ * For maximum portability, a call's <code>ResultSet</code> objects and
+ * update counts should be processed prior to getting the values of output
+ * parameters.
+ * <P>
+ *
+ * @see Connection#prepareCall
+ * @see ResultSet
+ */
+
+public interface CallableStatement extends PreparedStatement {
+
+ /**
+ * Registers the OUT parameter in ordinal position
+ * <code>parameterIndex</code> to the JDBC type
+ * <code>sqlType</code>. All OUT parameters must be registered
+ * before a stored procedure is executed.
+ * <p>
+ * The JDBC type specified by <code>sqlType</code> for an OUT
+ * parameter determines the Java type that must be used
+ * in the <code>get</code> method to read the value of that parameter.
+ * <p>
+ * If the JDBC type expected to be returned to this output parameter
+ * is specific to this particular database, <code>sqlType</code>
+ * should be <code>java.sql.Types.OTHER</code>. The method
+ * {@link #getObject} retrieves the value.
+ *
+ * @param parameterIndex the first parameter is 1, the second is 2,
+ * and so on
+ * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.
+ * If the parameter is of JDBC type <code>NUMERIC</code>
+ * or <code>DECIMAL</code>, the version of
+ * <code>registerOutParameter</code> that accepts a scale value
+ * should be used.
+ *
+ * @exception SQLException if the parameterIndex is not valid;
+ * if a database access error occurs or
+ * this method is called on a closed <code>CallableStatement</code>
+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
+ * or <code>STRUCT</code> data type and the JDBC driver does not support
+ * this data type
+ * @see Types
+ */
+ void registerOutParameter(int parameterIndex, int sqlType)
+ throws SQLException;
+
+ /**
+ * Registers the parameter in ordinal position
+ * <code>parameterIndex</code> to be of JDBC type
+ * <code>sqlType</code>. All OUT parameters must be registered
+ * before a stored procedure is executed.
+ * <p>
+ * The JDBC type specified by <code>sqlType</code> for an OUT
+ * parameter determines the Java type that must be used
+ * in the <code>get</code> method to read the value of that parameter.
+ * <p>
+ * This version of <code>registerOutParameter</code> should be
+ * used when the parameter is of JDBC type <code>NUMERIC</code>
+ * or <code>DECIMAL</code>.
+ *
+ * @param parameterIndex the first parameter is 1, the second is 2,
+ * and so on
+ * @param sqlType the SQL type code defined by <code>java.sql.Types</code>.
+ * @param scale the desired number of digits to the right of the
+ * decimal point. It must be greater than or equal to zero.
+ * @exception SQLException if the parameterIndex is not valid;
+ * if a database access error occurs or
+ * this method is called on a closed <code>CallableStatement</code>
+ * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
+ * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
+ * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
+ * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
+ * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
+ * or <code>STRUCT</code> data type and the JDBC driver does not support
+ * this data type
+ * @see Types
+ */
+ void registerOutParameter(int parameterIndex, int sqlType, int scale)
+ throws SQLException;
+
+ /**
+ * Retrieves whether the last OUT parameter read had the value of
+ * SQL <code>NULL</code>. Note that this method should be called only after
+ * calling a getter method; otherwise, there is no value to use in
+ * determining whether it is <code>null</code> or not.
+ *
+ * @return <code>true</code> if the last parameter read was SQL
+ * <code>NULL</code>; <code>false</code> otherwise
+ * @exception SQLException if a database access error occurs or
+ * this method is called on a closed <code>CallableStatement</code>
+ */
+ boolean wasNull() throws SQLException;
+
+ /**
+ * Retrieves the value of the designated JDBC <code>CHAR</code>,
+ * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> parameter as a
+ * <code>String</code> in the Java programming language.
+ * <p>
+ * For the fixed-length type JDBC <code>CHAR</code>,
+ * the <code>String</code> object
+ * returned has exactly the same value the SQL
+ * <code>CHAR</code> value had in the
+ * database, including any padding added by the database.
+ *
+ * @param parameterIndex the first parameter is 1, the second is 2,
+ * and so on
+ * @return the parameter value. If the value is SQL <code>NULL</code>,
+ * the result
+ * is <code>null</code>.
+ * @exception SQLException if the parameterIndex is not valid;
+ * if a database access error occurs or
+ * this method is called on a closed <code>CallableStatement</code>
+ * @see #setString
+ */
+ String getString(int parameterIndex) throws SQLException;
+
+ /**
+ * Retrieves the value of the designated JDBC <code>BIT</code>
+ * or ...
[truncated message content] |