From f9082d98bf6f981e66c0ba01ba9de3aa0177f361 Mon Sep 17 00:00:00 2001 From: bryce Date: Fri, 21 Jun 2002 05:39:33 +0000 Subject: [PATCH] Reformat JDBC classes and add new JDK 1.4 classes and methods. * java/sql/ParameterMetaData.java, java/sql/SQLPermission.java, java/sql/Savepoint.java: New files. * java/sql/Array.java, java/sql/BatchUpdateException.java, java/sql/Blob.java, java/sql/CallableStatement.java, java/sql/Clob.java, java/sql/Connection.java, java/sql/DataTruncation.java, java/sql/DatabaseMetaData.java, java/sql/Date.java, java/sql/Driver.java, java/sql/DriverManager.java, java/sql/DriverPropertyInfo.java, java/sql/PreparedStatement.java, java/sql/Ref.java, java/sql/ResultSet.java, java/sql/ResultSetMetaData.java, java/sql/SQLData.java java/sql/SQLException.java, java/sql/SQLInput.java, java/sql/SQLOutput.java, java/sql/SQLWarning.java java/sql/Statement.java, java/sql/Struct.java, java/sql/Time.java, java/sql/Timestamp.java, java/sql/Types.java: Updated to JDBC 3.0 (JDK 1.4) specification. * javax/sql/ConnectionEvent.java, javax/sql/ConnectionEventListener.java, javax/sql/ConnectionPoolDataSource.java, javax/sql/DataSource.java, javax/sql/PooledConnection.java, javax/sql/RowSetEvent.java, javax/sql/RowSetInternal.java, javax/sql/RowSet.java, javax/sql/RowSetListener.java, javax/sql/RowSetMetaData.java, javax/sql/RowSetReader.java, javax/sql/RowSetWriter.java, javax/sql/XAConnection.java, javax/sql/XADataSource.java: New files. * Makefile.am: Add new files. * Makefile.in: Rebuilt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54871 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/ChangeLog | 31 + libjava/Makefile.am | 17 + libjava/Makefile.in | 41 +- libjava/java/sql/Array.java | 338 +- libjava/java/sql/BatchUpdateException.java | 237 +- libjava/java/sql/Blob.java | 178 +- libjava/java/sql/CallableStatement.java | 1024 +++-- libjava/java/sql/Clob.java | 203 +- libjava/java/sql/Connection.java | 786 ++-- libjava/java/sql/DataTruncation.java | 272 +- libjava/java/sql/DatabaseMetaData.java | 4883 ++++++++++------------- libjava/java/sql/Date.java | 164 +- libjava/java/sql/Driver.java | 159 +- libjava/java/sql/DriverManager.java | 582 ++- libjava/java/sql/DriverPropertyInfo.java | 102 +- libjava/java/sql/ParameterMetaData.java | 103 + libjava/java/sql/PreparedStatement.java | 903 ++--- libjava/java/sql/Ref.java | 51 +- libjava/java/sql/ResultSet.java | 3453 +++++++--------- libjava/java/sql/ResultSetMetaData.java | 588 ++- libjava/java/sql/SQLData.java | 69 +- libjava/java/sql/SQLException.java | 300 +- libjava/java/sql/SQLInput.java | 510 +-- libjava/java/sql/SQLOutput.java | 509 +-- libjava/java/sql/SQLPermission.java | 57 + libjava/java/sql/SQLWarning.java | 192 +- libjava/java/sql/Savepoint.java | 55 + libjava/java/sql/Statement.java | 708 ++-- libjava/java/sql/Struct.java | 82 +- libjava/java/sql/Time.java | 180 +- libjava/java/sql/Timestamp.java | 460 +-- libjava/java/sql/Types.java | 78 +- libjava/javax/sql/ConnectionEvent.java | 75 + libjava/javax/sql/ConnectionEventListener.java | 57 + libjava/javax/sql/ConnectionPoolDataSource.java | 79 + libjava/javax/sql/DataSource.java | 80 + libjava/javax/sql/PooledConnection.java | 68 + libjava/javax/sql/RowSet.java | 361 ++ libjava/javax/sql/RowSetEvent.java | 52 + libjava/javax/sql/RowSetInternal.java | 74 + libjava/javax/sql/RowSetListener.java | 62 + libjava/javax/sql/RowSetMetaData.java | 147 + libjava/javax/sql/RowSetReader.java | 52 + libjava/javax/sql/RowSetWriter.java | 52 + libjava/javax/sql/XAConnection.java | 53 + libjava/javax/sql/XADataSource.java | 79 + 46 files changed, 9199 insertions(+), 9407 deletions(-) create mode 100644 libjava/java/sql/ParameterMetaData.java create mode 100644 libjava/java/sql/SQLPermission.java create mode 100644 libjava/java/sql/Savepoint.java create mode 100644 libjava/javax/sql/ConnectionEvent.java create mode 100644 libjava/javax/sql/ConnectionEventListener.java create mode 100644 libjava/javax/sql/ConnectionPoolDataSource.java create mode 100644 libjava/javax/sql/DataSource.java create mode 100644 libjava/javax/sql/PooledConnection.java create mode 100644 libjava/javax/sql/RowSet.java create mode 100644 libjava/javax/sql/RowSetEvent.java create mode 100644 libjava/javax/sql/RowSetInternal.java create mode 100644 libjava/javax/sql/RowSetListener.java create mode 100644 libjava/javax/sql/RowSetMetaData.java create mode 100644 libjava/javax/sql/RowSetReader.java create mode 100644 libjava/javax/sql/RowSetWriter.java create mode 100644 libjava/javax/sql/XAConnection.java create mode 100644 libjava/javax/sql/XADataSource.java diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7db99ce160f..d02000a2067 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,34 @@ +2002-06-21 Bryce McKinlay + + Reformat JDBC classes and add new JDK 1.4 classes and methods. + + * java/sql/ParameterMetaData.java, java/sql/SQLPermission.java, + java/sql/Savepoint.java: New files. + * java/sql/Array.java, java/sql/BatchUpdateException.java, + java/sql/Blob.java, java/sql/CallableStatement.java, + java/sql/Clob.java, java/sql/Connection.java, + java/sql/DataTruncation.java, java/sql/DatabaseMetaData.java, + java/sql/Date.java, java/sql/Driver.java, java/sql/DriverManager.java, + java/sql/DriverPropertyInfo.java, java/sql/PreparedStatement.java, + java/sql/Ref.java, java/sql/ResultSet.java, + java/sql/ResultSetMetaData.java, java/sql/SQLData.java + java/sql/SQLException.java, java/sql/SQLInput.java, + java/sql/SQLOutput.java, java/sql/SQLWarning.java + java/sql/Statement.java, java/sql/Struct.java, java/sql/Time.java, + java/sql/Timestamp.java, java/sql/Types.java: Updated to JDBC 3.0 + (JDK 1.4) specification. + * javax/sql/ConnectionEvent.java, + javax/sql/ConnectionEventListener.java, + javax/sql/ConnectionPoolDataSource.java, + javax/sql/DataSource.java, javax/sql/PooledConnection.java, + javax/sql/RowSetEvent.java, javax/sql/RowSetInternal.java, + javax/sql/RowSet.java, javax/sql/RowSetListener.java, + javax/sql/RowSetMetaData.java, javax/sql/RowSetReader.java, + javax/sql/RowSetWriter.java, javax/sql/XAConnection.java, + javax/sql/XADataSource.java: New files. + * Makefile.am: Add new files. + * Makefile.in: Rebuilt. + 2002-06-20 Tom Tromey For PR libgcj/7073: diff --git a/libjava/Makefile.am b/libjava/Makefile.am index 15b331f6c53..6064f9d7d49 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -997,6 +997,20 @@ javax/naming/ldap/UnsolicitedNotification.java \ javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/OperationNotSupportedException.java \ +javax/sql/ConnectionEvent.java \ +javax/sql/ConnectionEventListener.java \ +javax/sql/ConnectionPoolDataSource.java \ +javax/sql/DataSource.java \ +javax/sql/PooledConnection.java \ +javax/sql/RowSetEvent.java \ +javax/sql/RowSetInternal.java \ +javax/sql/RowSet.java \ +javax/sql/RowSetListener.java \ +javax/sql/RowSetMetaData.java \ +javax/sql/RowSetReader.java \ +javax/sql/RowSetWriter.java \ +javax/sql/XAConnection.java \ +javax/sql/XADataSource.java \ javax/transaction/xa/XAException.java \ javax/transaction/xa/XAResource.java \ javax/transaction/xa/Xid.java \ @@ -1604,14 +1618,17 @@ java/sql/Date.java \ java/sql/Driver.java \ java/sql/DriverManager.java \ java/sql/DriverPropertyInfo.java \ +java/sql/ParameterMetaData.java \ java/sql/PreparedStatement.java \ java/sql/Ref.java \ java/sql/ResultSet.java \ java/sql/ResultSetMetaData.java \ +java/sql/Savepoint.java \ java/sql/SQLData.java \ java/sql/SQLException.java \ java/sql/SQLInput.java \ java/sql/SQLOutput.java \ +java/sql/SQLPermission.java \ java/sql/SQLWarning.java \ java/sql/Statement.java \ java/sql/Struct.java \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 655d697225e..ab8c26f8cf1 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -768,6 +768,20 @@ javax/naming/ldap/UnsolicitedNotification.java \ javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/OperationNotSupportedException.java \ +javax/sql/ConnectionEvent.java \ +javax/sql/ConnectionEventListener.java \ +javax/sql/ConnectionPoolDataSource.java \ +javax/sql/DataSource.java \ +javax/sql/PooledConnection.java \ +javax/sql/RowSetEvent.java \ +javax/sql/RowSetInternal.java \ +javax/sql/RowSet.java \ +javax/sql/RowSetListener.java \ +javax/sql/RowSetMetaData.java \ +javax/sql/RowSetReader.java \ +javax/sql/RowSetWriter.java \ +javax/sql/XAConnection.java \ +javax/sql/XADataSource.java \ javax/transaction/xa/XAException.java \ javax/transaction/xa/XAResource.java \ javax/transaction/xa/Xid.java \ @@ -1366,14 +1380,17 @@ java/sql/Date.java \ java/sql/Driver.java \ java/sql/DriverManager.java \ java/sql/DriverPropertyInfo.java \ +java/sql/ParameterMetaData.java \ java/sql/PreparedStatement.java \ java/sql/Ref.java \ java/sql/ResultSet.java \ java/sql/ResultSetMetaData.java \ +java/sql/Savepoint.java \ java/sql/SQLData.java \ java/sql/SQLException.java \ java/sql/SQLInput.java \ java/sql/SQLOutput.java \ +java/sql/SQLPermission.java \ java/sql/SQLWarning.java \ java/sql/Statement.java \ java/sql/Struct.java \ @@ -2506,13 +2523,15 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/java/sql/Connection.P .deps/java/sql/DataTruncation.P \ .deps/java/sql/DatabaseMetaData.P .deps/java/sql/Date.P \ .deps/java/sql/Driver.P .deps/java/sql/DriverManager.P \ -.deps/java/sql/DriverPropertyInfo.P .deps/java/sql/PreparedStatement.P \ -.deps/java/sql/Ref.P .deps/java/sql/ResultSet.P \ -.deps/java/sql/ResultSetMetaData.P .deps/java/sql/SQLData.P \ -.deps/java/sql/SQLException.P .deps/java/sql/SQLInput.P \ -.deps/java/sql/SQLOutput.P .deps/java/sql/SQLWarning.P \ -.deps/java/sql/Statement.P .deps/java/sql/Struct.P \ -.deps/java/sql/Time.P .deps/java/sql/Timestamp.P .deps/java/sql/Types.P \ +.deps/java/sql/DriverPropertyInfo.P .deps/java/sql/ParameterMetaData.P \ +.deps/java/sql/PreparedStatement.P .deps/java/sql/Ref.P \ +.deps/java/sql/ResultSet.P .deps/java/sql/ResultSetMetaData.P \ +.deps/java/sql/SQLData.P .deps/java/sql/SQLException.P \ +.deps/java/sql/SQLInput.P .deps/java/sql/SQLOutput.P \ +.deps/java/sql/SQLPermission.P .deps/java/sql/SQLWarning.P \ +.deps/java/sql/Savepoint.P .deps/java/sql/Statement.P \ +.deps/java/sql/Struct.P .deps/java/sql/Time.P \ +.deps/java/sql/Timestamp.P .deps/java/sql/Types.P \ .deps/java/text/Annotation.P \ .deps/java/text/AttributedCharacterIterator.P \ .deps/java/text/AttributedString.P \ @@ -2659,6 +2678,14 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/javax/naming/spi/ObjectFactoryBuilder.P \ .deps/javax/naming/spi/ResolveResult.P \ .deps/javax/naming/spi/Resolver.P .deps/javax/naming/spi/StateFactory.P \ +.deps/javax/sql/ConnectionEvent.P \ +.deps/javax/sql/ConnectionEventListener.P \ +.deps/javax/sql/ConnectionPoolDataSource.P .deps/javax/sql/DataSource.P \ +.deps/javax/sql/PooledConnection.P .deps/javax/sql/RowSet.P \ +.deps/javax/sql/RowSetEvent.P .deps/javax/sql/RowSetInternal.P \ +.deps/javax/sql/RowSetListener.P .deps/javax/sql/RowSetMetaData.P \ +.deps/javax/sql/RowSetReader.P .deps/javax/sql/RowSetWriter.P \ +.deps/javax/sql/XAConnection.P .deps/javax/sql/XADataSource.P \ .deps/javax/transaction/HeuristicCommitException.P \ .deps/javax/transaction/HeuristicMixedException.P \ .deps/javax/transaction/HeuristicRollbackException.P \ diff --git a/libjava/java/sql/Array.java b/libjava/java/sql/Array.java index c713edbfdab..51c4ee8fa8e 100644 --- a/libjava/java/sql/Array.java +++ b/libjava/java/sql/Array.java @@ -1,5 +1,5 @@ /* Array.java -- Interface for accessing SQL array object - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,203 +35,151 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.util.Map; /** - * This interface provides methods for accessing SQL array types - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Array + * This interface provides methods for accessing SQL array types. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface Array { - -/** - * This method returns the name of the SQL type of the elements in this - * array. This name is database specific. - * - * @param The name of the SQL type of the elements in this array. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getBaseTypeName() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the JDBC type identifier of the elements in this - * array. This will be one of the values defined in the Types - * class. - * - * @return The JDBC type of the elements in this array. - * - * @exception SQLException If an error occurs. - * - * @see Types - */ -public abstract int -getBaseType() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the contents of this array. This object returned - * will be an array of Java objects of the appropriate types. - * - * @return The contents of the array as an array of Java objects. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getArray() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the contents of this array. The specified - * Map will be used to override selected mappings between - * SQL types and Java classes. - * - * @param map A mapping of SQL types to Java classes. - * - * @return The contents of the array as an array of Java objects. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getArray(Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a portion of this array starting at index - * offset into the array and continuing for length - * elements. Fewer than the requested number of elements will be - * returned if the array does not contain the requested number of elements. - * The object returned will be an array of Java objects of - * the appropriate types. - * - * @param offset The offset into this array to start returning elements from. - * @param count The requested number of elements to return. - * - * @return The requested portion of the array. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getArray(long offset, int count) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a portion of this array starting at index - * offset into the array and continuing for length - * elements. Fewer than the requested number of elements will be - * returned if the array does not contain the requested number of elements. - * The object returned will be an array of Java objects. The specified - * Map will be used for overriding selected SQL type to - * Java class mappings. - * - * @param offset The offset into this array to start returning elements from. - * @param count The requested number of elements to return. - * @param map A mapping of SQL types to Java classes. - * - * @return The requested portion of the array. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getArray(long index, int count, Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the elements in the array as a ResultSet. - * Each row of the result set will have two columns. The first will be - * the index into the array of that row's contents. The second will be - * the actual value of that array element. - * - * @return The elements of this array as a ResultSet. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract ResultSet -getResultSet() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the elements in the array as a ResultSet. - * Each row of the result set will have two columns. The first will be - * the index into the array of that row's contents. The second will be - * the actual value of that array element. The specified Map - * will be used to override selected default mappings of SQL types to - * Java classes. - * - * @param map A mapping of SQL types to Java classes. - * - * @return The elements of this array as a ResultSet. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract ResultSet -getResultSet(Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a portion of the array as a ResultSet. - * The returned portion will start at index offset into the - * array and up to length elements will be returned. - *

- * Each row of the result set will have two columns. The first will be - * the index into the array of that row's contents. The second will be - * the actual value of that array element. - * - * @param offset The index into the array to start returning elements from. - * @param length The requested number of elements to return. - * - * @return The requested elements of this array as a ResultSet. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract ResultSet -getResultSet(long index, int count) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a portion of the array as a ResultSet. - * The returned portion will start at index offset into the - * array and up to length elements will be returned. - *

- * Each row of the result set will have two columns. The first will be - * the index into the array of that row's contents. The second will be - * the actual value of that array element. The specified Map - * will be used to override selected default mappings of SQL types to - * Java classes. - * - * @param offset The index into the array to start returning elements from. - * @param length The requested number of elements to return. - * @param map A mapping of SQL types to Java classes. - * - * @return The requested elements of this array as a ResultSet. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract ResultSet -getResultSet(long index, int count, Map map) throws SQLException; - -} // interface Array - + /** + * Returns the name of the SQL type of the elements in this + * array. This name is database specific. + * + * @param The name of the SQL type of the elements in this array. + * @exception SQLException If an error occurs. + */ + public String getBaseTypeName() throws SQLException; + + /** + * Returns the JDBC type identifier of the elements in this + * array. This will be one of the values defined in the + * Types class. + * + * @return The JDBC type of the elements in this array. + * @exception SQLException If an error occurs. + * @see Types + */ + public int getBaseType() throws SQLException; + + /** + * Returns the contents of this array. This object returned + * will be an array of Java objects of the appropriate types. + * + * @return The contents of the array as an array of Java objects. + * @exception SQLException If an error occurs. + */ + public Object getArray() throws SQLException; + + /** + * Returns the contents of this array. The specified + * Map will be used to override selected mappings + * between SQL types and Java classes. + * + * @param map A mapping of SQL types to Java classes. + * @return The contents of the array as an array of Java objects. + * @exception SQLException If an error occurs. + */ + public Object getArray(Map map) throws SQLException; + + /** + * Returns a portion of this array starting at index + * into the array and continuing for count + * elements. Fewer than the requested number of elements will be + * returned if the array does not contain the requested number of elements. + * The object returned will be an array of Java objects of + * the appropriate types. + * + * @param offset The offset into this array to start returning elements from. + * @param count The requested number of elements to return. + * @return The requested portion of the array. + * @exception SQLException If an error occurs. + */ + public Object getArray(long index, int count) throws SQLException; + + /** + * This method returns a portion of this array starting at index + * into the array and continuing for count + * elements. Fewer than the requested number of elements will be + * returned if the array does not contain the requested number of elements. + * The object returned will be an array of Java objects. The specified + * Map will be used for overriding selected SQL type to + * Java class mappings. + * + * @param offset The offset into this array to start returning elements from. + * @param count The requested number of elements to return. + * @param map A mapping of SQL types to Java classes. + * @return The requested portion of the array. + * @exception SQLException If an error occurs. + */ + public Object getArray(long index, int count, Map map) throws SQLException; + + /** + * Returns the elements in the array as a ResultSet. + * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. + * + * @return The elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet() throws SQLException; + + /** + * This method returns the elements in the array as a ResultSet. + * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. The specified Map + * will be used to override selected default mappings of SQL types to + * Java classes. + * + * @param map A mapping of SQL types to Java classes. + * @return The elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet(Map map) throws SQLException; + + /** + * This method returns a portion of the array as a ResultSet. + * The returned portion will start at index into the + * array and up to count elements will be returned. + *

+ * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. + * + * @param offset The index into the array to start returning elements from. + * @param length The requested number of elements to return. + * @return The requested elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet(long index, int count) throws SQLException; + + /** + * This method returns a portion of the array as a ResultSet. + * The returned portion will start at index into the + * array and up to count elements will be returned. + *

+ * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. The specified Map + * will be used to override selected default mappings of SQL types to + * Java classes. + * + * @param offset The index into the array to start returning elements from. + * @param length The requested number of elements to return. + * @param map A mapping of SQL types to Java classes. + * @return The requested elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet(long index, int count, Map map) + throws SQLException; +} diff --git a/libjava/java/sql/BatchUpdateException.java b/libjava/java/sql/BatchUpdateException.java index 04478ee4b02..515f1d4662f 100644 --- a/libjava/java/sql/BatchUpdateException.java +++ b/libjava/java/sql/BatchUpdateException.java @@ -1,5 +1,5 @@ /* BatchUpdateException.java -- Exception for batch oriented SQL errors - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,146 +35,107 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; /** - * This class extends SQLException to count the successful - * updates in each statement in a batch that was successfully updated prior - * to the error. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class BatchUpdateException extends SQLException -{ - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * This is the array of update counts for the commands which completed - * successfully prior to the error. - * @serialized - */ -private int[] updateCounts; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of BatchUpdateException - * with no descriptive error message. The SQL state and update count will - * be initialized to null and the vendor specific error code will - * initialized to 0. - */ -public -BatchUpdateException() -{ - super(); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of BatchUpdateException - * with the specified update count information and no descriptive error - * message. This SQL state will be initialized to null and - * the vendor specific error code will be initialized to 0. - * - * @param updateCounts The update count array. - */ -public -BatchUpdateException(int[] updateCounts) -{ - super(); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of BatchUpdateException - * with the specified descriptive error message and update count information. - * The SQL state will be initialized to null and the vendor - * specific error code will be initialized to 0. - * - * @param message The descriptive error message. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, int[] updateCounts) -{ - super(message); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of BatchUpdateException - * with the specified descriptive error message, SQL state, and update count - * information. The vendor specific error code will be initialized to 0. - * - * @param message The descriptive error message. - * @param SQLState The SQL state information for this error. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, String SQLState, int[] updateCounts) -{ - super(message, SQLState); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of BatchUpdateException - * with the specified descriptive error message, SQL state, vendor - * specific error code and update count information. - * - * @param message The descriptive error message. - * @param SQLState The SQL state information for this error. - * @param vendorCode The vendor specific error code for this error. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, String SQLState, int vendorCode, - int[] updateCounts) -{ - super(message, SQLState, vendorCode); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/* - * Instance Methods + * This class extends SQLException to count the successful + * updates in each statement in a batch that was successfully updated prior + * to the error. + * + * @author Aaron M. Renn (arenn@urbanophile.com) */ - -/** - * This method returns the update count information for this error. If - * not null this is an array of int's that are - * the update accounts for each command that was successfully executed. - * The array elements are in the order that the commands were executed. - * - * @return The update count information, which may be null. - */ -public int[] -getUpdateCounts() +public class BatchUpdateException extends SQLException { - return(updateCounts); + static final long serialVersionUID = 5977529877145521757L; + + /** + * This is the array of update counts for the commands which completed + * successfully prior to the error. + */ + private int[] updateCounts; + + /** + * This method initializes a new instance of BatchUpdateException + * with the specified descriptive error message, SQL state, and update count + * information. The vendor specific error code will be initialized to 0. + * + * @param message The descriptive error message. + * @param SQLState The SQL state information for this error. + * @param vendorCode + * @param updateCounts The update count information for this error. + */ + public BatchUpdateException(String message, String SQLState, int vendorCode, + int[] updateCounts) + { + super(message, SQLState, vendorCode); + this.updateCounts = updateCounts; + } + + /** + * This method initializes a new instance of BatchUpdateException + * with the specified descriptive error message, SQL state, and update count + * information. The vendor specific error code will be initialized to 0. + * + * @param message The descriptive error message. + * @param SQLState The SQL state information for this error. + * @param updateCounts The update count information for this error. + */ + public BatchUpdateException(String message, String SQLState, + int[] updateCounts) + { + super(message, SQLState); + this.updateCounts = updateCounts; + } + + /** + * This method initializes a new instance of BatchUpdateException + * with the specified descriptive error message and update count information. + * The SQL state will be initialized to null and the vendor + * specific error code will be initialized to 0. + * + * @param message The descriptive error message. + * @param updateCounts The update count information for this error. + */ + public BatchUpdateException(String message, int[] updateCounts) + { + super(message); + this.updateCounts = updateCounts; + } + + /** + * Initializes a new instance of BatchUpdateException + * with the specified update count information and no descriptive error + * message. This SQL state will be initialized to null and + * the vendor specific error code will be initialized to 0. + * + * @param updateCounts The update count array. + */ + public BatchUpdateException(int[] updateCounts) + { + this.updateCounts = updateCounts; + } + + /** + * Initializes a new instance of BatchUpdateException + * with no descriptive error message. The SQL state and update count will + * be initialized to null and the vendor specific error code will + * initialized to 0. + */ + public BatchUpdateException() + { + super(); + } + + /** + * This method returns the update count information for this error. If + * not null this is an array of int's that are + * the update accounts for each command that was successfully executed. + * The array elements are in the order that the commands were executed. + * + * @return The update count information, which may be null. + */ + public int[] getUpdateCounts() + { + return updateCounts; + } } - -} // class BatchUpdateException - diff --git a/libjava/java/sql/Blob.java b/libjava/java/sql/Blob.java index 32d0ee5e9fa..495fec10d04 100644 --- a/libjava/java/sql/Blob.java +++ b/libjava/java/sql/Blob.java @@ -1,5 +1,5 @@ /* Blob.java -- Access a SQL Binary Large OBject. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,97 +35,97 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; +import java.io.OutputStream; /** - * This interface specified methods for accessing a SQL BLOB (Binary - * Large OBject) type. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Blob + * This interface specified methods for accessing a SQL BLOB (Binary + * Large OBject) type. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.2 + */ +public interface Blob { - -/*************************************************************************/ - -/** - * This method returns the number of bytes in the BLOB. - * - * @return The number of bytes in the BLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract long -length() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns up to the requested bytes of this BLOB as a - * byte array. - * - * @param offset The index into the BLOB to start returning bytes from. - * @param length The requested number of bytes to return. - * - * @return The requested bytes from the BLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract byte[] -getBytes(long offset, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a stream that will read the bytes of the BLOB. - * - * @return A stream that will read the bytes of the BLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getBinaryStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the index into the BLOB at which the first instance - * of the specified bytes occur. The searching starts at the specified - * index into the BLOB. - * - * @param pattern The byte pattern to search for. - * @param offset The index into the BLOB to starting searching for the pattern. - * - * @return The offset at which the pattern is first found, or -1 if the - * pattern is not found. - * - * @exception SQLException If an error occurs. - */ -public abstract long -position(byte[] pattern, long offset) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the index into the BLOB at which the first instance - * of the specified pattern occurs. The searching starts at the specified - * index into this BLOB. The bytes in the specified Blob are - * used as the search pattern. - * - * @param pattern The Blob containing the byte pattern to - * search for. - * @param offset The index into the BLOB to starting searching for the pattern. - * - * @return The offset at which the pattern is first found, or -1 if the - * pattern is not found. - * - * @exception SQLException If an error occurs. - */ -public abstract long -position(Blob pattern, long offset) throws SQLException; - -} // interface Blob - + /** + * This method returns the number of bytes in the BLOB. + * + * @return The number of bytes in the BLOB. + * @exception SQLException If an error occurs. + */ + public long length() throws SQLException; + + /** + * This method returns up to the requested bytes of this BLOB as a + * byte array. + * + * @param pos The index into the BLOB to start returning bytes from. + * @param length The requested number of bytes to return. + * @return The requested bytes from the BLOB. + * @exception SQLException If an error occurs. + */ + public byte[] getBytes(long pos, int length) throws SQLException; + + /** + * This method returns a stream that will read the bytes of the BLOB. + * + * @return A stream that will read the bytes of the BLOB. + * @exception SQLException If an error occurs. + */ + public InputStream getBinaryStream() throws SQLException; + + /** + * This method returns the index into the BLOB at which the first instance + * of the specified bytes occur. The searching starts at the specified + * index into the BLOB. + * + * @param pattern The byte pattern to search for. + * @param offset The index into the BLOB to starting searching for the pattern. + * @return The offset at which the pattern is first found, or -1 if the + * pattern is not found. + * @exception SQLException If an error occurs. + */ + public long position(byte[] pattern, long start) throws SQLException; + + /** + * This method returns the index into the BLOB at which the first instance + * of the specified pattern occurs. The searching starts at the specified + * index into this BLOB. The bytes in the specified Blob are + * used as the search pattern. + * + * @param pattern The Blob containing the byte pattern to + * search for. + * @param offset The index into the BLOB to starting searching for the pattern. + * @return The offset at which the pattern is first found, or -1 if the + * pattern is not found. + * @exception SQLException If an error occurs. + */ + public long position(Blob pattern, long start) throws SQLException; + + /** + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public int setBytes(long pos, byte[] bytes) throws SQLException; + + /** + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public int setBytes(long pos, byte[] bytes, int offset, int len) + throws SQLException; + + /** + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public OutputStream setBinaryStream(long pos) throws SQLException; + + /** + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public void truncate(long len) throws SQLException; +} diff --git a/libjava/java/sql/CallableStatement.java b/libjava/java/sql/CallableStatement.java index 666c45ad06f..e706ba401f3 100644 --- a/libjava/java/sql/CallableStatement.java +++ b/libjava/java/sql/CallableStatement.java @@ -1,5 +1,5 @@ /* CallableStatement.java -- A statement for calling stored procedures. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,431 +35,617 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.net.URL; import java.util.Calendar; import java.util.Map; /** - * This interface provides a mechanism for calling stored procedures. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface CallableStatement extends PreparedStatement + * This interface provides a mechanism for calling stored procedures. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface CallableStatement extends PreparedStatement { - -/*************************************************************************/ - -/** - * This method tests whether the value of the last parameter that was fetched - * was actually a SQL NULL value. - * - * @return true if the last parameter fetched was a NULL, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -wasNull() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * String. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a String. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getString(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Object. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Object. - * - * @param index The index of the parameter to return. - * @param map The mapping to use for conversion from SQL to Java types. - * - * @return The parameter value as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(int index, Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * boolean. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a boolean. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -getBoolean(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * byte. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a byte. - * - * @exception SQLException If an error occurs. - */ -public abstract byte -getByte(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * short. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a short. - * - * @exception SQLException If an error occurs. - */ -public abstract short -getShort(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * int. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a int. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getInt(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * long. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a long. - * - * @exception SQLException If an error occurs. - */ -public abstract long -getLong(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * float. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a float. - * - * @exception SQLException If an error occurs. - */ -public abstract float -getFloat(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * double. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a double. - * - * @exception SQLException If an error occurs. - */ -public abstract double -getDouble(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * BigDecimal. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * BigDecimal. - * - * @param index The index of the parameter to return. - * @param scale The number of digits to the right of the decimal to return. - * - * @return The parameter value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(int index, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * byte array. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a byte array - * - * @exception SQLException If an error occurs. - */ -public abstract byte[] -getBytes(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Date. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Date. - * - * @param index The index of the parameter to return. - * @param calendar The Calendar to use for timezone and locale. - * - * @return The parameter value as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(int index, Calendar calendar) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Time. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Time. - * - * @param index The index of the parameter to return. - * @param calendar The Calendar to use for timezone and locale. - * - * @return The parameter value as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(int index, Calendar calendar) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Timestamp. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * java.sql.Timestamp. - * - * @param index The index of the parameter to return. - * @param calendar The Calendar to use for timezone and locale. - * - * @return The parameter value as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(int index, Calendar calendar) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Ref. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a Ref. - * - * @exception SQLException If an error occurs. - */ -public abstract Ref -getRef(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Blob. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a Blob. - * - * @exception SQLException If an error occurs. - */ -public abstract Blob -getBlob(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Clob. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a Clob. - * - * @exception SQLException If an error occurs. - */ -public abstract Clob -getClob(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified parameter as a Java - * Array. - * - * @param index The index of the parameter to return. - * - * @return The parameter value as a Array. - * - * @exception SQLException If an error occurs. - */ -public abstract Array -getArray(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method registers the specified parameter as an output parameter - * of the specified SQL type. - * - * @param index The index of the parameter to register as output. - * @param type The SQL type value from Types. - * - * @exception SQLException If an error occurs. - */ -public abstract void -registerOutParameter(int index, int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method registers the specified parameter as an output parameter - * of the specified SQL type. - * - * @param index The index of the parameter to register as output. - * @param type The SQL type value from Types. - * @param name The user defined data type name. - * - * @exception SQLException If an error occurs. - */ -public abstract void -registerOutParameter(int index, int type, String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method registers the specified parameter as an output parameter - * of the specified SQL type and scale. - * - * @param index The index of the parameter to register as output. - * @param type The SQL type value from Types. - * @param scale The scale of the value that will be returned. - * - * @exception SQLException If an error occurs. - */ -public abstract void -registerOutParameter(int index, int type, int scale) throws SQLException; - -} // interface CallableStatement - - + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. + * + * @param index The index of the parameter to register as output. + * @param type The SQL type value from Types. + * @exception SQLException If an error occurs. + */ + public void registerOutParameter(int parameterIndex, int sqlType) + throws SQLException; + + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type and scale. + * + * @param index The index of the parameter to register as output. + * @param type The SQL type value from Types. + * @param scale The scale of the value that will be returned. + * @exception SQLException If an error occurs. + */ + public void registerOutParameter(int parameterIndex, int sqlType, int scale) + throws SQLException; + + /** + * This method tests whether the value of the last parameter that was fetched + * was actually a SQL NULL value. + * + * @return true if the last parameter fetched was a NULL, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean wasNull() throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * String. + * + * @param index The index of the parameter to return. + * @return The parameter value as a String. + * @exception SQLException If an error occurs. + */ + public String getString(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * boolean. + * + * @param index The index of the parameter to return. + * @return The parameter value as a boolean. + * @exception SQLException If an error occurs. + */ + public boolean getBoolean(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * byte. + * + * @param index The index of the parameter to return. + * @return The parameter value as a byte. + * @exception SQLException If an error occurs. + */ + public byte getByte(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * short. + * + * @param index The index of the parameter to return. + * @return The parameter value as a short. + * @exception SQLException If an error occurs. + */ + public short getShort(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * int. + * + * @param index The index of the parameter to return. + * @return The parameter value as a int. + * @exception SQLException If an error occurs. + */ + public int getInt(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * long. + * + * @param index The index of the parameter to return. + * @return The parameter value as a long. + * @exception SQLException If an error occurs. + */ + public long getLong(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * float. + * + * @param index The index of the parameter to return. + * @return The parameter value as a float. + * @exception SQLException If an error occurs. + */ + public float getFloat(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * double. + * + * @param index The index of the parameter to return. + * @return The parameter value as a double. + * @exception SQLException If an error occurs. + */ + public double getDouble(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * BigDecimal. + * + * @param parameterIndex The index of the parameter to return. + * @param scale The number of digits to the right of the decimal to return. + * @return The parameter value as a BigDecimal. + * @exception SQLException If an error occurs. + * @deprecated Use getBigDecimal(int parameterIndex) + * or getBigDecimal(String parameterName) instead. + */ + public BigDecimal getBigDecimal(int parameterIndex, int scale) + throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * byte array. + * + * @param parameterIndex The index of the parameter to return. + * @return The parameter value as a byte array + * @exception SQLException If an error occurs. + */ + public byte[] getBytes(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Date. + * + * @param index The index of the parameter to return. + * @return The parameter value as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date getDate(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Time. + * + * @param index The index of the parameter to return. + * @return The parameter value as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time getTime(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Timestamp. + * + * @param index The index of the parameter to return. + * @return The parameter value as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + */ + public Timestamp getTimestamp(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Object. + * + * @param parameterIndex The index of the parameter to return. + * @return The parameter value as an Object. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Object getObject(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * BigDecimal. + * + * @param parameterIndex The index of the parameter to return. + * @return The parameter value as a BigDecimal. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public BigDecimal getBigDecimal(int parameterIndex) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Object. + * + * @param index The index of the parameter to return. + * @param map The mapping to use for conversion from SQL to Java types. + * @return The parameter value as an Object. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Object getObject(int index, Map map) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Ref. + * + * @param index The index of the parameter to return. + * @return The parameter value as a Ref. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Ref getRef(int index) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Blob. + * + * @param index The index of the parameter to return. + * @return The parameter value as a Blob. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Blob getBlob(int index) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Clob. + * + * @param index The index of the parameter to return. + * @return The parameter value as a Clob. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Clob getClob(int index) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * Array. + * + * @param parameterIndex The index of the parameter to return. + * @return The parameter value as a Array. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Array getArray(int index) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Date. + * + * @param parameterIndex The index of the parameter to return. + * @param cal The Calendar to use for timezone and locale. + * @return The parameter value as a java.sql.Date. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Date getDate(int parameterIndex, Calendar cal) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Time. + * + * @param parameterIndex The index of the parameter to return. + * @param cal The Calendar to use for timezone and locale. + * @return The parameter value as a java.sql.Time. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Time getTime(int parameterIndex, Calendar cal) throws SQLException; + + /** + * This method returns the value of the specified parameter as a Java + * java.sql.Timestamp. + * + * @param index The index of the parameter to return. + * @return The parameter value as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Timestamp getTimestamp(int parameterIndex, Calendar cal) + throws SQLException; + + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. + * + * @param index The index of the parameter to register as output. + * @param type The SQL type value from Types. + * @param name The user defined data type name. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public void registerOutParameter(int paramIndex, int sqlType, + String typeName) + throws SQLException; + + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. + * + * @param parameterName The name of the parameter to register as output. + * @param sqlType The SQL type value from Types. + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public void registerOutParameter(String parameterName, int sqlType) + throws SQLException; + + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. This version of registerOutParameter is used + * for NUMERIC or DECIMAL types. + * + * @param parameterName The name of the parameter to register as output. + * @param sqlType The SQL type value from Types. + * @param scale Number of digits to the right of the decimal point. + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public void registerOutParameter(String parameterName, int sqlType, + int scale) + throws SQLException; + + + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. This version of registerOutParameter is used + * for user-named or REF types. If the type of the output parameter does + * not have such a type, the typeName argument is ignored. + * + * @param parameterName The name of the parameter to register as output. + * @param sqlType The SQL type value from Types. + * @param typeName The SQL structured type name. + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public void registerOutParameter(String parameterName, int sqlType, + String typeName) + throws SQLException; + + /** + * @since 1.4 + */ + public URL getURL(int parameterIndex) throws SQLException; + + /** + * @since 1.4 + */ + public void setURL(String parameterName, URL val) throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(String parameterName, int sqlType) throws SQLException; + + /** + * @since 1.4 + */ + public void setBoolean(String parameterName, boolean x) throws SQLException; + + /** + * @since 1.4 + */ + public void setByte(String parameterName, byte x) throws SQLException; + + /** + * @since 1.4 + */ + public void setShort(String parameterName, short x) throws SQLException; + + /** + * @since 1.4 + */ + public void setInt(String parameterName, int x) throws SQLException; + + /** + * @since 1.4 + */ + public void setLong(String parameterName, long x) throws SQLException; + + /** + * @since 1.4 + */ + public void setFloat(String parameterName, float x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDouble(String parameterName, double x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBigDecimal(String parameterName, BigDecimal x) + throws SQLException; + + /** + * @since 1.4 + */ + public void setString(String parameterName, String x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBytes(String parameterName, byte[] x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(String parameterName, Date x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTime(String parameterName, Time x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(String parameterName, Timestamp x) + throws SQLException; + + /** + * @since 1.4 + */ + public void setAsciiStream(String parameterName, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setBinaryStream(String parameterName, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(String parameterName, Object x, int targetSqlType, + int scale) + throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(String parameterName, Object x, int targetSqlType) + throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(String parameterName, Object x) throws SQLException; + + /** + * @since 1.4 + */ + public void setCharacterStream(String parameterName, Reader reader, + int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(String parameterName, Date x, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public void setTime(String parameterName, Time x, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(String parameterName, int sqlType, String typeName) + throws SQLException; + + /** + * @since 1.4 + */ + public String getString(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public boolean getBoolean(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public byte getByte(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public short getShort(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public int getInt(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public long getLong(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public float getFloat(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public double getDouble(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public byte[] getBytes(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Date getDate(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Time getTime(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Timestamp getTimestamp(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Object getObject(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public BigDecimal getBigDecimal(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Object getObject(String parameterName, Map map) throws SQLException; + + /** + * @since 1.4 + */ + public Ref getRef(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Blob getBlob(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Clob getClob(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Array getArray(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Date getDate(String parameterName, Calendar cal) throws SQLException; + + /** + * @since 1.4 + */ + public Time getTime(String parameterName, Calendar cal) throws SQLException; + + /** + * @since 1.4 + */ + public Timestamp getTimestamp(String parameterName, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public URL getURL(String parameterName) throws SQLException; +} diff --git a/libjava/java/sql/Clob.java b/libjava/java/sql/Clob.java index f733f31960a..a256512550b 100644 --- a/libjava/java/sql/Clob.java +++ b/libjava/java/sql/Clob.java @@ -1,5 +1,5 @@ /* Clob.java -- Access Character Large OBjects - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,113 +35,118 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; +import java.io.OutputStream; import java.io.Reader; +import java.io.Writer; /** - * This interface contains methods for accessing a SQL CLOB (Character - * Large OBject) type. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Clob + * This interface contains methods for accessing a SQL CLOB (Character + * Large OBject) type. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface Clob { - -/** + /** * This method returns the number of characters in the CLOB. * * @return The number of characters in the CLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract long -length() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified portion of the CLOB as a - * String. - * - * @param offset The index into the CLOB (index values start at 1) to - * start returning characters from. - * @param length The requested number of characters to return. - * - * @return The requested CLOB section, as a String. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSubString(long offset, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a byte stream that reads the contents of the - * CLOB as a series of ASCII bytes. - * - * @return A stream to read the CLOB's contents. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getAsciiStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a character stream that reads the contents of the - * CLOB. - * - * @return A character stream to read the CLOB's contents. - * * @exception SQLException If an error occurs. + * @since 1.2 */ -public abstract Reader -getCharacterStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the index into the CLOB of the first occurrence of - * the specified character pattern (supplied by the caller as a - * String). The search begins at the specified index. - * - * @param pattern The character pattern to search for, passed as a - * String. - * @param offset. The index into the CLOB to start search (indexes start - * at 1). - * - * @return The index at which the pattern was found (indexes start at 1), - * or -1 if the pattern was not found. - * - * @exception SQLException If an error occurs. - */ -public abstract long -position(String pattern, long offset) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the index into the CLOB of the first occurrence of - * the specified character pattern (supplied by the caller as a - * Clob). The search begins at the specified index. - * - * @param pattern The character pattern to search for, passed as a - * Clob. - * @param offset. The index into the CLOB to start search (indexes start - * at 1). - * - * @return The index at which the pattern was found (indexes start at 1), - * or -1 if the pattern was not found. - * - * @exception SQLException If an error occurs. - */ -public abstract long -position(Clob pattern, long offset) throws SQLException; - -} // interface Clob - + public long length() throws SQLException; + + /** + * This method returns the specified portion of the CLOB as a + * String. + * + * @param offset The index into the CLOB (index values start at 1) to + * start returning characters from. + * @param length The requested number of characters to return. + * @return The requested CLOB section, as a String. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public String getSubString(long pos, int length) throws SQLException; + + /** + * This method returns a character stream that reads the contents of the + * CLOB. + * + * @return A character stream to read the CLOB's contents. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public Reader getCharacterStream() throws SQLException; + + /** + * This method returns a byte stream that reads the contents of the + * CLOB as a series of ASCII bytes. + * + * @return A stream to read the CLOB's contents. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public InputStream getAsciiStream() throws SQLException; + + /** + * This method returns the index into the CLOB of the first occurrence of + * the specified character pattern (supplied by the caller as a + * String). The search begins at the specified index. + * + * @param searchstr The character pattern to search for, passed as a + * String. + * @param start. The index into the CLOB to start search (indexes start + * at 1). + * @return The index at which the pattern was found (indexes start at 1), + * or -1 if the pattern was not found. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public long position(String searchstr, long start) throws SQLException; + + /** + * This method returns the index into the CLOB of the first occurrence of + * the specified character pattern (supplied by the caller as a + * Clob). The search begins at the specified index. + * + * @param searchstr The character pattern to search for, passed as a + * Clob. + * @param start. The index into the CLOB to start search (indexes start + * at 1). + * @return The index at which the pattern was found (indexes start at 1), + * or -1 if the pattern was not found. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public long position(Clob searchstr, long start) throws SQLException; + + /** + * @since 1.4 + */ + public int setString(long pos, String str) throws SQLException; + + /** + * @since 1.4 + */ + public int setString(long pos, String str, int offset, int len) + throws SQLException; + + /** + * @since 1.4 + */ + public OutputStream setAsciiStream(long pos) throws SQLException; + + /** + * @since 1.4 + */ + public Writer setCharacterStream(long pos) throws SQLException; + + /** + * @since 1.4 + */ + public void truncate(long len) throws SQLException; +} diff --git a/libjava/java/sql/Connection.java b/libjava/java/sql/Connection.java index 8583fdb6a76..3f4d7deea19 100644 --- a/libjava/java/sql/Connection.java +++ b/libjava/java/sql/Connection.java @@ -1,5 +1,5 @@ /* Connection.java -- Manage a database connection. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,422 +41,380 @@ package java.sql; import java.util.Map; /** - * This interface provides methods for managing a connection to a database. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Connection + * This interface provides methods for managing a connection to a database. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface Connection { - -/** - * This transaction isolation level indicates that transactions are not - * supported. - */ -public static final int TRANSACTION_NONE = 0; - -/** - * This transaction isolation level indicates that one transaction can - * read modifications by other transactions before the other transactions - * have committed their changes. This could result in invalid reads. - */ -public static final int TRANSACTION_READ_UNCOMMITTED = 1; - -/** - * This transaction isolation leve indicates that only committed data from - * other transactions will be read. If a transaction reads a row, then - * another transaction commits a change to that row, the first transaction - * would retrieve the changed row on subsequent reads of the same row. - */ -public static final int TRANSACTION_READ_COMMITTED = 2; - -/** - * This transaction isolation level indicates that only committed data from - * other transactions will be read. It also ensures that data read from - * a row will not be different on a subsequent read even if another - * transaction commits a change. - */ -public static final int TRANSACTION_REPEATABLE_READ = 4; - -/** - * This transaction isolation level indicates that only committed data from - * other transactions will be read. It also ensures that data read from - * a row will not be different on a subsequent read even if another - * transaction commits a change. Additionally, rows modified by other - * transactions will not affect the result set returned during subsequent - * executions of the same WHERE clause in this transaction. - */ -public static final int TRANSACTION_SERIALIZABLE = 8; - -/*************************************************************************/ - -/** - * This method creates a new SQL statement. The default result set type - * and concurrency will be used. - * - * @return A new Statement object. - * - * @exception SQLException If an error occurs. - * - * @see Statement - */ -public abstract Statement -createStatement() throws SQLException; - -/*************************************************************************/ - -/** - * This method creates a new SQL statement with the specified type and - * concurrency. Valid values for these parameters are specified in the - * ResultSet class. - * - * @param resultSetType The type of result set to use for this statement. - * @param resultSetConcurrency. The type of concurrency to be used in - * the result set for this statement. - * - * @return A new Statement object. - * - * @exception SQLException If an error occurs. - * - * @see Statement - * @see ResultSet - */ -public abstract Statement -createStatement(int resultSetType, int resultSetConcurrency) - throws SQLException; - -/*************************************************************************/ - -/** - * This method creates a new PreparedStatement for the specified - * SQL string. This method is designed for use with parameterized - * statements. The default result set type and concurrency will be used. - * - * @param The SQL statement to use in creating this - * PreparedStatement. - * - * @return A new PreparedStatement. - * - * @exception SQLException If an error occurs. - * - * @see PreparedStatement - */ -public abstract PreparedStatement -prepareStatement(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method creates a new PreparedStatement for the specified - * SQL string. This method is designed for use with parameterized - * statements. The specified result set type and concurrency will be used. - * Valid values for these parameters are specified in the - * ResultSet class. - * - * @param The SQL statement to use in creating this - * PreparedStatement. - * @param resultSetType The type of result set to use for this statement. - * @param resultSetConcurrency. The type of concurrency to be used in - * the result set for this statement. - * - * @return A new PreparedStatement. - * - * @exception SQLException If an error occurs. - * - * @see PreparedStatement - * @see ResultSet - */ -public abstract PreparedStatement -prepareStatement(String sql, int resultSetType, int resultSetConcurrency) - throws SQLException; - -/*************************************************************************/ - -/** - * This method creates a new CallableStatement for the - * specified SQL string. Thie method is designed to be used with - * stored procedures. The default result set type and concurrency - * will be used. - * - * @param The SQL statement to use in creating this - * CallableStatement. - * - * @return A new CallableStatement. - * - * @exception SQLException If an error occurs. - * - * @see CallableStatement - */ -public abstract CallableStatement -prepareCall(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method creates a new CallableStatement for the - * specified SQL string. Thie method is designed to be used with - * stored procedures. The specified result set type and concurrency - * will be used. Valid values for these parameters are specified in the - * ResultSet class. - * - * @param The SQL statement to use in creating this - * PreparedStatement. - * @param resultSetType The type of result set to use for this statement. - * @param resultSetConcurrency. The type of concurrency to be used in - * the result set for this statement. - * - * @return A new CallableStatement. - * - * @exception SQLException If an error occurs. - * - * @see CallableStatement - * @see ResultSet - */ -public abstract CallableStatement -prepareCall(String sql, int resultSetType, int resultSetConcurrency) - throws SQLException; - -/*************************************************************************/ - -/** - * This method converts the specified generic SQL statement into the - * native grammer of the database this object is connected to. - * - * @param The JDBC generic SQL statement. - * - * @return The native SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract String -nativeSQL(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not auto commit mode is currently enabled. - * In auto commit mode, every SQL statement is committed its own transaction. - * Otherwise a transaction must be explicitly committed or rolled back. - * - * @return true if auto commit mode is enabled, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see commit - * @see rollback - */ -public abstract boolean -getAutoCommit() throws SQLException; - -/*************************************************************************/ - -/** - * This method turns auto commit mode on or off. In auto commit mode, - * every SQL statement is committed its own transaction. Otherwise a - * transaction must be explicitly committed or rolled back. - * - * @param autoCommit true to enable auto commit mode, - * false to disable it. - * - * @exception SQLException If an error occurs. - * - * @see commit - * @see rollback - */ -public abstract void -setAutoCommit(boolean autoCommit) throws SQLException; - -/*************************************************************************/ - -/** + /** + * This transaction isolation level indicates that transactions are not + * supported. + */ + public static final int TRANSACTION_NONE = 0; + + /** + * This transaction isolation level indicates that one transaction can + * read modifications by other transactions before the other transactions + * have committed their changes. This could result in invalid reads. + */ + public static final int TRANSACTION_READ_UNCOMMITTED = 1; + + /** + * This transaction isolation leve indicates that only committed data from + * other transactions will be read. If a transaction reads a row, then + * another transaction commits a change to that row, the first transaction + * would retrieve the changed row on subsequent reads of the same row. + */ + public static final int TRANSACTION_READ_COMMITTED = 2; + + /** + * This transaction isolation level indicates that only committed data from + * other transactions will be read. It also ensures that data read from + * a row will not be different on a subsequent read even if another + * transaction commits a change. + */ + public static final int TRANSACTION_REPEATABLE_READ = 4; + + /** + * This transaction isolation level indicates that only committed data from + * other transactions will be read. It also ensures that data read from + * a row will not be different on a subsequent read even if another + * transaction commits a change. Additionally, rows modified by other + * transactions will not affect the result set returned during subsequent + * executions of the same WHERE clause in this transaction. + */ + public static final int TRANSACTION_SERIALIZABLE = 8; + + /** + * This method creates a new SQL statement. The default result set type + * and concurrency will be used. + * + * @return A new Statement object. + * @exception SQLException If an error occurs. + * @see Statement + */ + public Statement createStatement() throws SQLException; + + /** + * This method creates a new PreparedStatement for the specified + * SQL string. This method is designed for use with parameterized + * statements. The default result set type and concurrency will be used. + * + * @param The SQL statement to use in creating this + * PreparedStatement. + * @return A new PreparedStatement. + * @exception SQLException If an error occurs. + * @see PreparedStatement + */ + public PreparedStatement prepareStatement(String sql) throws SQLException; + + /** + * This method creates a new CallableStatement for the + * specified SQL string. Thie method is designed to be used with + * stored procedures. The default result set type and concurrency + * will be used. + * + * @param The SQL statement to use in creating this + * CallableStatement. + * @return A new CallableStatement. + * @exception SQLException If an error occurs. + * @see CallableStatement + */ + public CallableStatement prepareCall(String sql) throws SQLException; + + /** + * This method converts the specified generic SQL statement into the + * native grammer of the database this object is connected to. + * + * @param The JDBC generic SQL statement. + * @return The native SQL statement. + * @exception SQLException If an error occurs. + */ + public String nativeSQL(String sql) throws SQLException; + + /** + * This method turns auto commit mode on or off. In auto commit mode, + * every SQL statement is committed its own transaction. Otherwise a + * transaction must be explicitly committed or rolled back. + * + * @param autoCommit true to enable auto commit mode, + * false to disable it. + * @exception SQLException If an error occurs. + * @see commit + * @see rollback + */ + public void setAutoCommit(boolean autoCommit) throws SQLException; + + /** + * This method tests whether or not auto commit mode is currently enabled. + * In auto commit mode, every SQL statement is committed its own transaction. + * Otherwise a transaction must be explicitly committed or rolled back. + * + * @return true if auto commit mode is enabled, + * false otherwise. + * + * @exception SQLException If an error occurs. + * + * @see commit + * @see rollback + */ + public boolean getAutoCommit() throws SQLException; + + /** * This method commits any SQL statements executed on this connection since * the last commit or rollback. * * @exception SQLException If an error occurs. */ -public abstract void -commit() throws SQLException; - -/*************************************************************************/ - -/** - * This method rolls back any SQL statements executed on this connection - * since the last commit or rollback. - * - * @exception SQLException If an error occurs. - */ -public abstract void -rollback() throws SQLException; - -/*************************************************************************/ - -/** - * This method immediately closes this database connection. - * - * @exception SQLException If an error occurs. - */ -public abstract void -close() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not this connection has been closed. - * - * @return true if the connection is closed, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isClosed() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the meta data for this database connection. - * - * @return The meta data for this database. - * - * @exception SQLException If an error occurs. - * - * @see DatabaseMetaData - */ -public abstract DatabaseMetaData -getMetaData() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not this connection is in read only mode. - * - * @return true if the connection is read only false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isReadOnly() throws SQLException; - -/*************************************************************************/ - -/** - * This method turns read only mode on or off. It may not be called while - * a transaction is in progress. - * - * @param readOnly true if this connection is read only, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setReadOnly(boolean readOnly) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the catalog in use by this connection, - * if any. - * - * @return The name of the catalog, or null if one does not - * exist or catalogs are not supported by this database. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getCatalog() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the name of the catalog in use by this connection. - * Note that this method does nothing if catalogs are not supported by - * this database. - * - * @param catalog The name of the catalog to use for this connection. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setCatalog(String catalog) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the current transaction isolation mode. This will - * be one of the constants defined in this interface. - * - * @return The transaction isolation level. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getTransactionIsolation() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the current transaction isolation mode. This must - * be one of the constants defined in this interface. - * - * @param level The transaction isolation level. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTransactionIsolation(int level) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the first warning that occurred on this connection, - * if any. If there were any subsequence warnings, they will be chained - * to the first one. - * - * @return The first SQLWarning that occurred, or - * null if there have been no warnings. - * - * @exception SQLException If an error occurs. - */ -public abstract SQLWarning -getWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method clears all warnings that have occurred on this connection. - * - * @exception SQLException If an error occurs. - */ -public abstract void -clearWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the mapping of SQL types to Java classes - * currently in use by this connection. This mapping will have no - * entries unless they have been manually added. - * - * @return The SQL type to Java class mapping. - * - * @exception SQLException If an error occurs. - */ -public abstract Map -getTypeMap() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the mapping table for SQL types to Java classes. - * Any entries in this map override the defaults. - * - * @param map The new SQL mapping table. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTypeMap(Map map) throws SQLException; - -} // interface Connection - + public void commit() throws SQLException; + + /** + * This method rolls back any SQL statements executed on this connection + * since the last commit or rollback. + * + * @exception SQLException If an error occurs. + */ + public void rollback() throws SQLException; + + /** + * This method immediately closes this database connection. + * + * @exception SQLException If an error occurs. + */ + public void close() throws SQLException; + + /** + * This method tests whether or not this connection has been closed. + * + * @return true if the connection is closed, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isClosed() throws SQLException; + + /** + * This method returns the meta data for this database connection. + * + * @return The meta data for this database. + * @exception SQLException If an error occurs. + * @see DatabaseMetaData + */ + public DatabaseMetaData getMetaData() throws SQLException; + + /** + * This method turns read only mode on or off. It may not be called while + * a transaction is in progress. + * + * @param readOnly true if this connection is read only, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public void setReadOnly(boolean readOnly) throws SQLException; + + /** + * This method tests whether or not this connection is in read only mode. + * + * @return true if the connection is read only false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isReadOnly() throws SQLException; + + /** + * This method sets the name of the catalog in use by this connection. + * Note that this method does nothing if catalogs are not supported by + * this database. + * + * @param catalog The name of the catalog to use for this connection. + * @exception SQLException If an error occurs. + */ + public void setCatalog(String catalog) throws SQLException; + + /** + * This method returns the name of the catalog in use by this connection, + * if any. + * + * @return The name of the catalog, or null if one does not + * exist or catalogs are not supported by this database. + * @exception SQLException If an error occurs. + */ + public String getCatalog() throws SQLException; + + /** + * This method sets the current transaction isolation mode. This must + * be one of the constants defined in this interface. + * + * @param level The transaction isolation level. + * @exception SQLException If an error occurs. + */ + public void setTransactionIsolation(int level) throws SQLException; + + /** + * This method returns the current transaction isolation mode. This will + * be one of the constants defined in this interface. + * + * @return The transaction isolation level. + * @exception SQLException If an error occurs. + */ + public int getTransactionIsolation() throws SQLException; + + /** + * This method returns the first warning that occurred on this connection, + * if any. If there were any subsequence warnings, they will be chained + * to the first one. + * + * @return The first SQLWarning that occurred, or + * null if there have been no warnings. + * @exception SQLException If an error occurs. + */ + public SQLWarning getWarnings() throws SQLException; + + /** + * This method clears all warnings that have occurred on this connection. + * + * @exception SQLException If an error occurs. + */ + public void clearWarnings() throws SQLException; + + /** + * This method creates a new SQL statement with the specified type and + * concurrency. Valid values for these parameters are specified in the + * ResultSet class. + * + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * @return A new Statement object. + * @exception SQLException If an error occurs. + * @see Statement + * @see ResultSet + */ + public Statement createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException; + + /** + * This method creates a new PreparedStatement for the specified + * SQL string. This method is designed for use with parameterized + * statements. The specified result set type and concurrency will be used. + * Valid values for these parameters are specified in the + * ResultSet class. + * + * @param The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * @return A new PreparedStatement. + * @exception SQLException If an error occurs. + * @see PreparedStatement + * @see ResultSet + */ + public PreparedStatement prepareStatement(String sql, int resultSetType, + int resultSetConcurrency) throws SQLException; + + /** + * This method creates a new CallableStatement for the + * specified SQL string. Thie method is designed to be used with + * stored procedures. The specified result set type and concurrency + * will be used. Valid values for these parameters are specified in the + * ResultSet class. + * + * @param The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * @return A new CallableStatement. + * @exception SQLException If an error occurs. + * @see CallableStatement + * @see ResultSet + */ + public CallableStatement prepareCall(String sql, int resultSetType, int + resultSetConcurrency) throws SQLException; + + /** + * This method returns the mapping of SQL types to Java classes + * currently in use by this connection. This mapping will have no + * entries unless they have been manually added. + * + * @return The SQL type to Java class mapping. + * @exception SQLException If an error occurs. + */ + public Map getTypeMap() throws SQLException; + + /** + * This method sets the mapping table for SQL types to Java classes. + * Any entries in this map override the defaults. + * + * @param map The new SQL mapping table. + * @exception SQLException If an error occurs. + */ + public void setTypeMap(Map map) throws SQLException; + + /** + * @since 1.4 + */ + public void setHoldability(int holdability) throws SQLException; + + /** + * @since 1.4 + */ + public int getHoldability() throws SQLException; + + /** + * @since 1.4 + */ + public Savepoint setSavepoint() throws SQLException; + + /** + * @since 1.4 + */ + public Savepoint setSavepoint(String name) throws SQLException; + + /** + * @since 1.4 + */ + public void rollback(Savepoint savepoint) throws SQLException; + + /** + * @since 1.4 + */ + public void releaseSavepoint(Savepoint savepoint) throws SQLException; + + /** + * @since 1.4 + */ + public Statement createStatement(int resultSetType, int + resultSetConcurrency, int resultSetHoldability) throws SQLException; + + /** + * @since 1.4 + */ + public PreparedStatement prepareStatement(String sql, int resultSetType, int + resultSetConcurrency, int resultSetHoldability) throws SQLException; + + /** + * @since 1.4 + */ + public CallableStatement prepareCall(String sql, int resultSetType, int + resultSetConcurrency, int resultSetHoldability) throws SQLException; + + /** + * @since 1.4 + */ + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) + throws SQLException; + + /** + * @since 1.4 + */ + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) + throws SQLException; + + /** + * @since 1.4 + */ + public PreparedStatement prepareStatement(String sql, String[] columnNames) + throws SQLException; +} diff --git a/libjava/java/sql/DataTruncation.java b/libjava/java/sql/DataTruncation.java index 0cb67ae24a5..9892cd03449 100644 --- a/libjava/java/sql/DataTruncation.java +++ b/libjava/java/sql/DataTruncation.java @@ -1,5 +1,5 @@ /* DataTruncation.java -- Warning when data has been truncated. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,7 +35,6 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; /** @@ -44,164 +43,115 @@ package java.sql; * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public class DataTruncation extends SQLWarning -{ - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * The original size of the data. - * @serialized - */ -private int dataSize; - -/** - * The index of the parameter or column whose value was truncated. - * @serialized - */ -private int index; - -/** - * Indicates whether or not a parameter value was truncated. - * @serialized - */ -private boolean parameter; - -/** - * Indicates whether or not a data column value was truncated. - * @serialized - */ -private boolean read; - -/** - * This is the size of the data after truncation. - * @serialized - */ -private int transferSize; - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 6464298989504059473L; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of DataTruncation - * with the specified values. The descriptive error message for this - * exception will be "Data truncation", the SQL state will be "01004" - * and the vendor specific error code will be set to 0. - * - * @param index The index of the parameter or column that was truncated. - * @param parameter true if a parameter was truncated, - * false otherwise. - * @param read true if a data column was truncated, - * false otherwise. - * @param dataSize The original size of the data. - * @param transferSize The size of the data after truncation. - */ -public -DataTruncation(int index, boolean parameter, boolean read, int dataSize, - int transferSize) +public class DataTruncation extends SQLWarning { - super("Data truncation", "01004"); - - this.index = index; - this.parameter = parameter; - this.read = read; - this.dataSize = dataSize; - this.transferSize = transferSize; + static final long serialVersionUID = 6464298989504059473L; + + /** + * The original size of the data. + */ + private int dataSize; + + /** + * The index of the parameter or column whose value was truncated. + */ + private int index; + + /** + * Indicates whether or not a parameter value was truncated. + */ + private boolean parameter; + + /** + * Indicates whether or not a data column value was truncated. + */ + private boolean read; + + /** + * This is the size of the data after truncation. + */ + private int transferSize; + + /** + * This method initializes a new instance of DataTruncation + * with the specified values. The descriptive error message for this + * exception will be "Data truncation", the SQL state will be "01004" + * and the vendor specific error code will be set to 0. + * + * @param index The index of the parameter or column that was truncated. + * @param parameter true if a parameter was truncated, + * false otherwise. + * @param read true if a data column was truncated, + * false otherwise. + * @param dataSize The original size of the data. + * @param transferSize The size of the data after truncation. + */ + public DataTruncation(int index, boolean parameter, boolean read, int + dataSize, int transferSize) + { + super("Data truncation", "01004"); + + this.index = index; + this.parameter = parameter; + this.read = read; + this.dataSize = dataSize; + this.transferSize = transferSize; + } + + /** + * This method returns the index of the column or parameter that was + * truncated. + * + * @return The index of the column or parameter that was truncated. + */ + public int getIndex() + { + return index; + } + + /** + * This method determines whether or not it was a parameter that was + * truncated. + * + * @return true if a parameter was truncated, false + * otherwise. + */ + public boolean getParameter() + { + return parameter; + } + + /** + * This method determines whether or not it was a column that was + * truncated. + * + * @return true if a column was truncated, false + * otherwise. + */ + public boolean getRead() + { + return read; + } + + /** + * This method returns the original size of the parameter or column that + * was truncated. + * + * @return The original size of the parameter or column that was truncated. + */ + public int getDataSize() + { + return dataSize; + } + + /** + * This method returns the size of the parameter or column after it was + * truncated. + * + * @return The size of the parameter or column after it was truncated. + */ + public int getTransferSize() + { + return transferSize; + } } - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the index of the column or parameter that was - * truncated. - * - * @return The index of the column or parameter that was truncated. - */ -public int -getIndex() -{ - return(index); -} - -/*************************************************************************/ - -/** - * This method determines whether or not it was a parameter that was - * truncated. - * - * @return true if a parameter was truncated, false - * otherwise. - */ -public boolean -getParameter() -{ - return(parameter); -} - -/*************************************************************************/ - -/** - * This method determines whether or not it was a column that was - * truncated. - * - * @return true if a column was truncated, false - * otherwise. - */ -public boolean -getRead() -{ - return(read); -} - -/*************************************************************************/ - -/** - * This method returns the original size of the parameter or column that - * was truncated. - * - * @return The original size of the parameter or column that was truncated. - */ -public int -getDataSize() -{ - return(dataSize); -} - -/*************************************************************************/ - -/** - * This method returns the size of the parameter or column after it was - * truncated. - * - * @return The size of the parameter or column after it was truncated. - */ -public int -getTransferSize() -{ - return(transferSize); -} - -} // class DataTruncation - diff --git a/libjava/java/sql/DatabaseMetaData.java b/libjava/java/sql/DatabaseMetaData.java index c2f389b8831..58d724163dc 100644 --- a/libjava/java/sql/DatabaseMetaData.java +++ b/libjava/java/sql/DatabaseMetaData.java @@ -1,5 +1,5 @@ /* DatabaseMetaData.java -- Information about the database itself. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,2713 +35,2180 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; -/** - * This interface provides a mechanism for obtaining information about - * the database itself, as opposed to data in it. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface DatabaseMetaData +public interface DatabaseMetaData { - -/** - * The best row may or may not be a pseudo-column. - */ -public static final int bestRowUnknown = 0; - -/** - * The best row identifier is not a pseudo-column. - */ -public static final int bestRowNotPseudo = 1; - -/** - * The best row identifier is a pseudo-column. - */ -public static final int bestRowPseudo = 2; - -/** - * The best row's scope is only guaranteed to be valid so long as the - * row is actually being used. - */ -public static final int bestRowTemporary = 0; - -/** - * The best row identifier is valid to the end of the transaction. - */ -public static final int bestRowTransaction = 1; - -/** - * The best row identifier is valid to the end of the session. - */ -public static final int bestRowSession = 2; - -/** - * It is unknown whether or not the procedure returns a result. - */ -public static final int procedureResultUnknown = 0; - -/** - * The procedure does not return a result. - */ -public static final int procedureNoResult = 1; - -/** - * The procedure returns a result. - */ -public static final int procedureReturnsResult = 2; - -/** - * The column type is unknown. - */ -public static final int procedureColumnUnknown = 0; - -/** - * The column type is input. - */ -public static final int procedureColumnIn = 1; - -/** - * The column type is input/output. - */ -public static final int procedureColumnInOut = 2; - -/** - * The column type is output - */ -public static final int procedureColumnOut = 4; - -/** - * The column is used for return values. - */ -public static final int procedureColumnReturn = 5; - -/** - * The column is used for storing results - */ -public static final int procedureColumnResult = 3; - -/** - * NULL values are not allowed. - */ -public static final int procedureNoNulls = 0; - -/** - * NULL values are allowed. - */ -public static final int procedureNullable = 1; - -/** - * It is unknown whether or not NULL values are allowed. - */ -public static final int procedureNullableUnknown = 2; - -/** - * The column does not allow NULL - */ -public static final int columnNoNulls = 0; - -/** - * The column does allow NULL - */ -public static final int columnNullable = 1; - -/** - * It is unknown whether or not the column allows NULL - */ -public static final int columnNullableUnknown = 2; - -/** - * It is unknown whether or not the version column is a pseudo-column. - */ -public static final int versionColumnUnknown = 0; - -/** - * The version column is not a pseudo-column - */ -public static final int versionColumnNotPseudo = 1; - -/** - * The version column is a pseudo-column - */ -public static final int versionColumnPseudo = 2; - -/** - * Foreign key changes are cascaded in updates or deletes. - */ -public static final int importedKeyCascade = 0; - -/** - * Column may not be updated or deleted in use as a foreign key. - */ -public static final int importedKeyRestrict = 1; - -/** - * When primary key is updated or deleted, the foreign key is set to NULL. - */ -public static final int importedKeySetNull = 2; - -/** - * If the primary key is a foreign key, it cannot be udpated or deleted. - */ -public static final int importedKeyNoAction = 3; - -/** - * If the primary key is updated or deleted, the foreign key is set to - * a default value. - */ -public static final int importedKeySetDefault = 4; - -/** - * Wish I knew what this meant. - */ -public static final int importedKeyInitiallyDeferred = 5; - -/** - * Wish I knew what this meant. - */ -public static final int importedKeyInitiallyImmediate = 6; - -/** - * Wish I knew what this meant. - */ -public static final int importedKeyNotDeferrable = 7; - -/** - * A NULL value is not allowed for this data type. - */ -public static final int typeNoNulls = 0; - -/** - * A NULL value is allowed for this data type. - */ -public static final int typeNullable = 1; - -/** - * It is unknown whether or not NULL values are allowed for this data type. - */ -public static final int typeNullableUnknown = 2; - -/** - * Where clauses are not supported for this type. - */ -public static final int typePredNone = 0; - -/** - * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type. - */ -public static final int typePredChar = 1; - -/** - * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type. - */ -public static final int typePredBasic = 2; - -/** - * Any type of WHERE clause is allowed for this data type. - */ -public static final int typeSearchable = 3; - -/** - * This column contains table statistics. - */ -public static final short tableIndexStatistic = 0; - -/** - * This table index is clustered. - */ -public static final short tableIndexClustered = 1; - -/** - * This table index is hashed. - */ -public static final short tableIndexHashed = 2; - -/** - * This table index is of another type. - */ -public static final short tableIndexOther = 3; - -/*************************************************************************/ - -/** - * This method tests whether or not all the procedures returned by - * the getProcedures method can be called by this user. - * - * @return true if all the procedures can be called, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -allProceduresAreCallable() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not all the table returned by the - * getTables method can be selected by this user. - * - * @return true if all the procedures can be called, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -allTablesAreSelectable() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the URL for this database. - * - * @return The URL string for this database, or null if it - * is not known. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getURL() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the database username for this connection. - * - * @return The database username. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getUserName() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database is in read only mode. - * - * @return true if the database is in read only mode, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isReadOnly() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not NULL's sort as high values. - * - * @return true if NULL's sort as high values, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -nullsAreSortedHigh() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not NULL's sort as low values. - * - * @return true if NULL's sort as low values, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -nullsAreSortedLow() throws SQLException; - -/*************************************************************************/ - -/** - * This method test whether or not NULL's are sorted to the beginning - * of the list regardless of ascending or descending sort order. - * - * @return true if NULL's always sort to the beginning, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -nullsAreSortedAtStart() throws SQLException; - -/*************************************************************************/ - -/** - * This method test whether or not NULL's are sorted to the end - * of the list regardless of ascending or descending sort order. - * - * @return true if NULL's always sort to the end, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -nullsAreSortedAtEnd() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the database product. - * - * @return The database product. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getDatabaseProductName() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the version of the database product. - * - * @return The version of the database product. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getDatabaseProductVersion() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the JDBC driver. - * - * @return The name of the JDBC driver. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getDriverName() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the version of the JDBC driver. - * - * @return The version of the JDBC driver. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getDriverVersion() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the major version number of the JDBC driver. - * - * @return The major version number of the JDBC driver. - */ -public abstract int -getDriverMajorVersion(); - -/*************************************************************************/ - -/** - * This method returns the minor version number of the JDBC driver. - * - * @return The minor version number of the JDBC driver. - */ -public abstract int -getDriverMinorVersion(); - -/*************************************************************************/ - -/** - * This method tests whether or not the database uses local files to - * store tables. - * - * @return true if the database uses local files, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -usesLocalFiles() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database uses a separate file for - * each table. - * - * @return true if the database uses a separate file for each - * table false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -usesLocalFilePerTable() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports identifiers - * with mixed case. - * - * @return true if the database supports mixed case identifiers, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsMixedCaseIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database treats mixed case - * identifiers as all upper case. - * - * @exception true if the database treats all identifiers as - * upper case, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesUpperCaseIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database treats mixed case - * identifiers as all lower case. - * - * @exception true if the database treats all identifiers as - * lower case, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesLowerCaseIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database stores mixed case - * identifers even if it treats them as case insensitive. - * - * @return true if the database stores mixed case identifiers, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesMixedCaseIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports quoted identifiers - * with mixed case. - * - * @return true if the database supports mixed case quoted - * identifiers, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsMixedCaseQuotedIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database treats mixed case - * quoted identifiers as all upper case. - * - * @exception true if the database treats all quoted identifiers - * as upper case, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesUpperCaseQuotedIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database treats mixed case - * quoted identifiers as all lower case. - * - * @exception true if the database treats all quoted identifiers - * as lower case, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesLowerCaseQuotedIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database stores mixed case - * quoted identifers even if it treats them as case insensitive. - * - * @return true if the database stores mixed case quoted - * identifiers, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -storesMixedCaseQuotedIdentifiers() throws SQLException; - -/*************************************************************************/ - -/** - * This metohd returns the quote string for SQL identifiers. - * - * @return The quote string for SQL identifers, or a space if quoting - * is not supported. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getIdentifierQuoteString() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a comma separated list of all the SQL keywords in - * the database that are not in SQL92. - * - * @return The list of SQL keywords not in SQL92. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSQLKeywords() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a comma separated list of math functions. - * - * @return The list of math functions. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getNumericFunctions() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a comma separated list of string functions. - * - * @return The list of string functions. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getStringFunctions() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a comma separated list of of system functions. - * - * @return A comma separated list of system functions. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSystemFunctions() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns comma separated list of time/date functions. - * - * @return The list of time/date functions. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getTimeDateFunctions() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the string used to escape wildcards in search strings. - * - * @return The string used to escape wildcards in search strings. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSearchStringEscape() throws SQLException; - -/*************************************************************************/ - -/** - * This methods returns non-standard characters that can appear in - * unquoted identifiers. - * - * @return Non-standard characters that can appear in unquoted identifiers. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getExtraNameCharacters() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports - * "ALTER TABLE ADD COLUMN" - * - * @return true if column add supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsAlterTableWithAddColumn() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports - * "ALTER TABLE DROP COLUMN" - * - * @return true if column drop supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsAlterTableWithDropColumn() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not column aliasing is supported. - * - * @return true if column aliasing is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsColumnAliasing() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether the concatenation of a NULL and non-NULL - * value results in a NULL. This will always be true in fully JDBC compliant - * drivers. - * - * @return true if concatenating NULL and a non-NULL value - * returns a NULL, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -nullPlusNonNullIsNull() throws SQLException; - -/*************************************************************************/ - -/** - * Tests whether or not CONVERT is supported. - * - * @return true if CONVERT is supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsConvert() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not CONVERT can be performed between the - * specified types. The types are contants from Types. - * - * @param fromType The SQL type to convert from. - * @param toType The SQL type to convert to. - * - * @return true if the conversion can be performed, - * false otherwise. - * - * @see Types - */ -public abstract boolean -supportsConvert(int fromType, int toType) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not table correlation names are - * supported. This will be always be true in a fully JDBC - * compliant driver. - * - * @return true if table correlation names are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsTableCorrelationNames() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether correlation names must be different from the - * name of the table. - * - * @return true if the correlation name must be different from - * the table name, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsDifferentTableCorrelationNames() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not expressions are allowed in an - * ORDER BY lists. - * - * @return true if expressions are allowed in ORDER BY - * lists, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsExpressionsInOrderBy() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or ORDER BY on a non-selected column is - * allowed. - * - * @return true if a non-selected column can be used in an - * ORDER BY, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOrderByUnrelated() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not GROUP BY is supported. - * - * @return true if GROUP BY is supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsGroupBy() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether GROUP BY on a non-selected column is - * allowed. - * - * @return true if a non-selected column can be used in a - * GROUP BY, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsGroupByUnrelated() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not a GROUP BY can add columns not in the - * select if it includes all the columns in the select. - * - * @return true if GROUP BY an add columns provided it includes - * all columns in the select, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsGroupByBeyondSelect() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the escape character is supported in - * LIKE expressions. A fully JDBC compliant driver will always return - * true. - * - * @return true if escapes are supported in LIKE expressions, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean supportsLikeEscapeClause() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether multiple result sets for a single statement are - * supported. - * - * @return true if multiple result sets are supported for a - * single statement, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsMultipleResultSets() throws SQLException; - -/*************************************************************************/ - -/** - * This method test whether or not multiple transactions may be open - * at once, as long as they are on different connections. - * - * @return true if multiple transactions on different - * connections are supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsMultipleTransactions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not columns can be defined as NOT NULL. A - * fully JDBC compliant driver always returns true. - * - * @return true if NOT NULL columns are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsNonNullableColumns() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the minimum grammer for ODBC is supported. - * A fully JDBC compliant driver will always return true. - * - * @return true if the ODBC minimum grammar is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsMinimumSQLGrammar() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the core grammer for ODBC is supported. - * - * @return true if the ODBC core grammar is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCoreSQLGrammar() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the extended grammer for ODBC is supported. - * - * @return true if the ODBC extended grammar is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsExtendedSQLGrammar() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the ANSI92 entry level SQL - * grammar is supported. A fully JDBC compliant drivers must return - * true. - * - * @return true if the ANSI92 entry level SQL grammar is - * supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsANSI92EntryLevelSQL() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the ANSI92 intermediate SQL - * grammar is supported. - * - * @return true if the ANSI92 intermediate SQL grammar is - * supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsANSI92IntermediateSQL() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the ANSI92 full SQL - * grammar is supported. - * - * @return true if the ANSI92 full SQL grammar is - * supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsANSI92FullSQL() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the SQL integrity enhancement - * facility is supported. - * - * @return true if the integrity enhancement facility is - * supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsIntegrityEnhancementFacility() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports outer joins. - * - * @return true if outer joins are supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOuterJoins() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports full outer joins. - * - * @return true if full outer joins are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsFullOuterJoins() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports limited outer joins. - * - * @return true if limited outer joins are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsLimitedOuterJoins() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the vendor's term for "schema". - * - * @return The vendor's term for schema. - * - * @exception SQLException if an error occurs. - */ -public abstract String -getSchemaTerm() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the vendor's term for "procedure". - * - * @return The vendor's term for procedure. - * - * @exception SQLException if an error occurs. - */ -public abstract String -getProcedureTerm() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the vendor's term for "catalog". - * - * @return The vendor's term for catalog. - * - * @exception SQLException if an error occurs. - */ -public abstract String -getCatalogTerm() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name appears at the beginning of - * a fully qualified table name. - * - * @return true if the catalog name appears at the beginning, - * false if it appears at the end. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isCatalogAtStart() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the separator between the catalog name and the - * table name. - * - * @return The separator between the catalog name and the table name. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getCatalogSeparator() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a data - * manipulation statement. - * - * @return true if a catalog name can appear in a data - * manipulation statement, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSchemasInDataManipulation() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a procedure - * call - * - * @return true if a catalog name can appear in a procedure - * call, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSchemasInProcedureCalls() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a table definition. - * - * @return true if a catalog name can appear in a table - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSchemasInTableDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in an index definition. - * - * @return true if a catalog name can appear in an index - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSchemasInIndexDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in privilege definitions. - * - * @return true if a catalog name can appear in privilege - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSchemasInPrivilegeDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a data - * manipulation statement. - * - * @return true if a catalog name can appear in a data - * manipulation statement, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCatalogsInDataManipulation() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a procedure - * call - * - * @return true if a catalog name can appear in a procedure - * call, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCatalogsInProcedureCalls() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in a table definition. - * - * @return true if a catalog name can appear in a table - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCatalogsInTableDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in an index definition. - * - * @return true if a catalog name can appear in an index - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCatalogsInIndexDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether a catalog name can appear in privilege definitions. - * - * @return true if a catalog name can appear in privilege - * definition, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCatalogsInPrivilegeDefinitions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not that database supports positioned - * deletes. - * - * @return true if positioned deletes are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsPositionedDelete() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not that database supports positioned - * updates. - * - * @return true if positioned updates are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsPositionedUpdate() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not SELECT FOR UPDATE is supported by the - * database. - * - * @return true if SELECT FOR UPDATE is supported - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSelectForUpdate() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not stored procedures are supported on - * this database. - * - * @return true if stored procedures are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsStoredProcedures() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not subqueries are allowed in comparisons. - * A fully JDBC compliant driver will always return true. - * - * @return true if subqueries are allowed in comparisons, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSubqueriesInComparisons() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not subqueries are allowed in exists - * expressions. A fully JDBC compliant driver will always return - * true. - * - * @return true if subqueries are allowed in exists - * expressions, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSubqueriesInExists() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether subqueries are allowed in IN statements. - * A fully JDBC compliant driver will always return true. - * - * @return true if the driver supports subqueries in IN - * statements, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSubqueriesInIns() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not subqueries are allowed in quantified - * expressions. A fully JDBC compliant driver will always return - * true. - * - * @return true if subqueries are allowed in quantified - * expressions, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsSubqueriesInQuantifieds() throws SQLException; - -/*************************************************************************/ - -/** - * This method test whether or not correlated subqueries are allowed. A - * fully JDBC compliant driver will always return true. - * - * @return true if correlated subqueries are allowed, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsCorrelatedSubqueries() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the UNION statement is supported. - * - * @return true if UNION is supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsUnion() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the UNION ALL statement is supported. - * - * @return true if UNION ALL is supported, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsUnionAll() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports cursors - * remaining open across commits. - * - * @return true if cursors can remain open across commits, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOpenCursorsAcrossCommit() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports cursors - * remaining open across rollbacks. - * - * @return true if cursors can remain open across rollbacks, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOpenCursorsAcrossRollback() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports statements - * remaining open across commits. - * - * @return true if statements can remain open across commits, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOpenStatementsAcrossCommit() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports statements - * remaining open across rollbacks. - * - * @return true if statements can remain open across rollbacks, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsOpenStatementsAcrossRollback() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the number of hex characters allowed in an inline - * binary literal. - * - * @return The number of hex characters allowed in a binary literal, 0 meaning - * either an unknown or unlimited number. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxBinaryLiteralLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a character literal. - * - * @return The maximum length of a character literal. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxCharLiteralLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a column name. - * - * @return The maximum length of a column name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of columns in a GROUP BY statement. - * - * @return The maximum number of columns in a GROUP BY statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnsInGroupBy() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of columns in an index. - * - * @return The maximum number of columns in an index. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnsInIndex() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of columns in an ORDER BY statement. - * - * @return The maximum number of columns in an ORDER BY statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnsInOrderBy() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of columns in a SELECT statement. - * - * @return The maximum number of columns in a SELECT statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnsInSelect() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of columns in a table. - * - * @return The maximum number of columns in a table. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxColumnsInTable() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of connections this client - * can have to the database. - * - * @return The maximum number of database connections. - * - * @SQLException If an error occurs. - */ -public abstract int -getMaxConnections() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a cursor name. - * - * @return The maximum length of a cursor name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxCursorNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of an index. - * - * @return The maximum length of an index. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxIndexLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a schema name. - * - * @return The maximum length of a schema name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxSchemaNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a procedure name. - * - * @return The maximum length of a procedure name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxProcedureNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a catalog name. - * - * @return The maximum length of a catalog name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxCatalogNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum size of a row in bytes. - * - * @return The maximum size of a row. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxRowSize() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the maximum row size includes BLOB's - * - * @return true if the maximum row size includes BLOB's, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -doesMaxRowSizeIncludeBlobs() throws SQLException; - -/*************************************************************************/ - -/** - * This method includes the maximum length of a SQL statement. - * - * @return The maximum length of a SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxStatementLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of statements that can be - * active at any time. - * - * @return The maximum number of statements that can be active at any time. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxStatements() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a table name. - * - * @return The maximum length of a table name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxTableNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of tables that may be referenced - * in a SELECT statement. - * - * @return The maximum number of tables allowed in a SELECT statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxTablesInSelect() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of a user name. - * - * @return The maximum length of a user name. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxUserNameLength() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the default transaction isolation level of the - * database. - * - * @return The default transaction isolation level of the database. - * - * @exception SQLException If an error occurs. - * - * @see Connection - */ -public abstract int -getDefaultTransactionIsolation() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports transactions. - * - * @return true if the database supports transactions, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsTransactions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports the specified - * transaction isolation level. - * - * @param level The transaction isolation level. - * - * @return true if the specified transaction isolation level - * is supported, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsTransactionIsolationLevel(int level) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not DDL and DML statements allowed within - * the same transaction. - * - * @return true if DDL and DML statements are allowed in the - * same transaction, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsDataDefinitionAndDataManipulationTransactions() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not only DML statement are allowed - * inside a transaction. - * - * @return true if only DML statements are allowed in - * transactions, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsDataManipulationTransactionsOnly() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not a DDL statement will cause the - * current transaction to be automatically committed. - * - * @return true if DDL causes an immediate transaction commit, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -dataDefinitionCausesTransactionCommit() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not DDL statements are ignored in - * transactions. - * - * @return true if DDL statements are ignored in transactions, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -dataDefinitionIgnoredInTransactions() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of all the stored procedures matching the - * specified pattern in the given schema and catalog. This is returned - * a ResultSet with the following columns: - *

- *

    - *
  1. PROCEDURE_CAT - The catalog the procedure is in, which may be - * null. - *
  2. PROCEDURE_SCHEM - The schema the procedures is in, which may be - * null. - *
  3. PROCEDURE_NAME - The name of the procedure. - *
  4. Unused - *
  5. Unused - *
  6. Unused - *
  7. REMARKS - A description of the procedure - *
  8. PROCEDURE_TYPE - Indicates the return type of the procedure, which - * is one of the contstants defined in this class - * (procedureResultUnknown, procedureNoResult, or - * procedureReturnsResult). - *
- * - * @param catalog The name of the catalog to return stored procedured from, - * or "" to return procedures from all catalogs. - * @param schemaPattern A schema pattern for the schemas to return stored - * procedures from, or "" to return procedures from all schemas. - * @param namePattern The pattern of procedures names to return. - * - * @returns A ResultSet with all the requested procedures. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getProcedures(String catalog, String schemaPattern, String namePattern) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the parameter and result columns for - * the requested stored procedures. This is returned in the form of a - * ResultSet with the following columns: - *

- *

    - *
  1. PROCEDURE_CAT - The catalog the procedure is in, which may be - * null. - *
  2. PROCEDURE_SCHEM - The schema the procedures is in, which may be - * null. - *
  3. PROCEDURE_NAME - The name of the procedure. - *
  4. COLUMN_NAME - The name of the column - *
  5. COLUMN_TYPE - The type of the column, which will be one of the - * contants defined in this class (procedureColumnUnknown, - * procedureColumnIn, procedureColumnInOut, - * procedureColumnOut, procedureColumnReturn, - * or procedureColumnResult). - *
  6. DATA_TYPE - The SQL type of the column. This is one of the constants - * defined in Types. - *
  7. TYPE_NAME - The string name of the data type for this column. - *
  8. PRECISION - The precision of the column. - *
  9. LENGTH - The length of the column in bytes - *
  10. SCALE - The scale of the column. - *
  11. RADIX - The radix of the column. - *
  12. NULLABLE - Whether or not the column is NULLABLE. This is one of - * the constants defined in this class (procedureNoNulls, - * procedureNullable, or procedureNullableUnknown) - *
  13. REMARKS - A description of the column. - *
- * - * @param catalog The name of the catalog to return stored procedured from, - * or "" to return procedures from all catalogs. - * @param schemaPattern A schema pattern for the schemas to return stored - * procedures from, or "" to return procedures from all schemas. - * @param namePattern The pattern of procedures names to return. - * @param columnPattern The pattern of column names to return. - * - * @returns A ResultSet with all the requested procedures. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getProcedureColumns(String catalog, String schemaPattern, String namePattern, - String columnPattern) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the requested table as a - * ResultSet with the following columns: - *

- *

    - *
  1. TABLE_CAT - The catalog the table is in, which may be null. - *
  2. TABLE_SCHEM - The schema the table is in, which may be null. - *
  3. TABLE_NAME - The name of the table. - *
  4. TABLE_TYPE - A string describing the table type. This will be one - * of the values returned by the getTableTypes() method. - *
  5. REMARKS - Comments about the table. - *
- * - * @param catalog The name of the catalog to return tables from, - * or "" to return tables from all catalogs. - * @param schemaPattern A schema pattern for the schemas to return tables - * from, or "" to return tables from all schemas. - * @param namePattern The pattern of table names to return. - * @param types The list of table types to include; null returns all types. - * - * @returns A ResultSet with all the requested tables. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getTables(String catalog, String schemaPattern, String namePattern, - String types[]) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the list of database schemas as a - * ResultSet, with one column - TABLE_SCHEM - that is the - * name of the schema. - * - * @return A ResultSet with all the requested schemas. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getSchemas() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the list of database catalogs as a - * ResultSet with one column - TABLE_CAT - that is the - * name of the catalog. - * - * @return A ResultSet with all the requested catalogs. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getCatalogs() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the list of database table types as a - * ResultSet with one column - TABLE_TYPE - that is the - * name of the table type. - * - * @return A ResultSet with all the requested table types. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getTableTypes() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the tables columns for - * the requested tables. This is returned in the form of a - * ResultSet with the following columns: - *

- *

    - *
  1. TABLE_CAT - The catalog the table is in, which may be - * null. - *
  2. TABLE_SCHEM - The schema the tables is in, which may be - * null. - *
  3. TABLE_NAME - The name of the table. - *
  4. COLUMN_NAME - The name of the column - *
  5. DATA_TYPE - The SQL type of the column. This is one of the constants - * defined in Types. - *
  6. TYPE_NAME - The string name of the data type for this column. - *
  7. COLUMN_SIZE - The size of the column. - *
  8. Unused - *
  9. NUM_PREC_RADIX - The radix of the column. - *
  10. NULLABLE - Whether or not the column is NULLABLE. This is one of - * the constants defined in this class (tableNoNulls, - * tableNullable, or tableNullableUnknown) - *
  11. REMARKS - A description of the column. - *
  12. COLUMN_DEF - The default value for the column, may be null. - *
  13. SQL_DATA_TYPE - Unused - *
  14. SQL_DATETIME_SUB - Unused - *
  15. CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes - * in the column. - *
  16. ORDINAL_POSITION - The index of the column in the table. - *
  17. IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string - * means unknown. - *
- * - * @param catalog The name of the catalog to return table from, - * or "" to return tables from all catalogs. - * @param schemaPattern A schema pattern for the schemas to return - * tables from, or "" to return tables from all schemas. - * @param namePattern The pattern of tables names to return. - * @param columnPattern The pattern of column names to return. - * - * @returns A ResultSet with all the requested tables. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getColumns(String catalog, String schemaPattern, String namePattern, - String columnPattern) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the access rights that have been granted to the - * requested columns. This information is returned as a ResultSet - * with the following columns: - *

- *

    - *
  1. TABLE_CAT - The catalog the table is in, which may be - * null. - *
  2. TABLE_SCHEM - The schema the tables is in, which may be - * null. - *
  3. TABLE_NAME - The name of the table. - *
  4. COLUMN_NAME - The name of the column. - *
  5. GRANTOR - The entity that granted the access. - *
  6. GRANTEE - The entity granted the access. - *
  7. PRIVILEGE - The name of the privilege granted. - *
  8. IS_GRANTABLE - "YES" if the grantee can grant the privilege to - * others, "NO" if not, and null if unknown. - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * @param columnPattern A pattern of column names to return information for. - * - * @return A ResultSet with all the requested privileges. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getColumnPrivileges(String catalog, String schema, String table, - String columnPattern) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the access rights that have been granted to the - * requested tables. This information is returned as a ResultSet - * with the following columns: - *

- *

    - *
  1. TABLE_CAT - The catalog the table is in, which may be - * null. - *
  2. TABLE_SCHEM - The schema the tables is in, which may be - * null. - *
  3. TABLE_NAME - The name of the table. - *
  4. GRANTOR - The entity that granted the access. - *
  5. GRANTEE - The entity granted the access. - *
  6. PRIVILEGE - The name of the privilege granted. - *
  7. IS_GRANTABLE - "YES" if the grantee can grant the privilege to - * others, "NO" if not, and null if unknown. - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param tablePattern The table name pattern of tables to return - * information for. - * - * @return A ResultSet with all the requested privileges. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getTablePrivileges(String catalog, String schema, String table) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the best set of columns for uniquely identifying - * a row. It returns this information as a ResultSet with - * the following columns: - *

- *

    - *
  1. SCOPE - The scope of the results returned. This is one of the - * constants defined in this class (bestRowTemporary, - * bestRowTransaction, or bestRowSession). - *
  2. COLUMN_NAME - The name of the column. - *
  3. DATA_TYPE - The SQL type of the column. This is one of the constants - * defined in Types. - *
  4. TYPE_NAME - The string name of the data type for this column. - *
  5. COLUMN_SIZE - The precision of the columns - *
  6. BUFFER_LENGTH - Unused - *
  7. DECIMAL_DIGITS - The scale of the column. - *
  8. PSEUDO_COLUMN - Whether or not the best row identifier is a - * pseudo_column. This is one of the constants defined in this class - * (bestRowUnknown, bestRowNotPseudo, or - * bestRowPseudo). - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * @param columnPattern A pattern of column names to return information for. - * @param scope One of the best row id scope constants from this class. - * @param nullable true to include columns that are nullable, - * false otherwise. - * - * @return A ResultSet with the best row identifier. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getBestRowIdentifier(String catalog, String schema, String table, - int scope, boolean nullable) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the set of columns that are automatically updated - * when the row is update. It returns this information as a - * ResultSet with the following columns: - *

- *

    - *
  1. SCOPE - Unused - *
  2. COLUMN_NAME - The name of the column. - *
  3. DATA_TYPE - The SQL type of the column. This is one of the constants - * defined in Types. - *
  4. TYPE_NAME - The string name of the data type for this column. - *
  5. COLUMN_SIZE - The precision of the columns - *
  6. BUFFER_LENGTH - Unused - *
  7. DECIMAL_DIGITS - The scale of the column. - *
  8. PSEUDO_COLUMN - Whether or not the best row identifier is a - * pseudo_column. This is one of the constants defined in this class - * (versionRowUnknown, versionRowNotPseudo, or - * versionRowPseudo). - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * @param columnPattern A pattern of column names to return information for. - * - * @return A ResultSet with the version columns. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getVersionColumns(String catalog, String schema, String table) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of a table's primary key columns. These - * are returned as a ResultSet with the following columns. - *

- *

    - *
  1. TABLE_CAT - The catalog of the table, which may be null. - *
  2. TABLE_SCHEM - The schema of the table, which may be null. - *
  3. TABLE_NAME - The name of the table. - *
  4. COLUMN_NAME - The name of the column. - *
  5. KEY_SEQ - The sequence number of the column within the primary key. - *
  6. PK_NAME - The name of the primary key, which may be null. - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * @param columnPattern A pattern of column names to return information for. - * - * @return A ResultSet with the primary key columns. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getPrimaryKeys(String catalog, String schema, String table) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the table's foreign keys. These are - * returned as a ResultSet with the following columns: - *

- *

    - *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. - *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. - *
  3. PKTABLE_NAME - The name of the table the key was imported from. - *
  4. PKCOLUMN_NAME - The name of the column that was imported. - *
  5. FKTABLE_CAT - The foreign key catalog name. - *
  6. FKTABLE_SCHEM - The foreign key schema name. - *
  7. FKTABLE_NAME - The foreign key table name. - *
  8. FKCOLUMN_NAME - The foreign key column name. - *
  9. KEY_SEQ - The sequence number of the column within the foreign key. - *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is - * updated. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, importedKeySetDefault, or - * importedKeyRestrict). - *
  11. DELETE_RULE - How the foreign key behaves when the primary key is - * deleted. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, or importedKeySetDefault) - *
  12. FK_NAME - The name of the foreign key. - *
  13. PK_NAME - The name of the primary key. - *
  14. DEFERRABILITY - The deferrability value. This is one of the - * constants defined in this table (importedKeyInitiallyDeferred, - * importedKeyInitiallyImmediate, or - * importedKeyNotDeferrable). - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * - * @return A ResultSet with the foreign key columns. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getImportedKeys(String catalog, String schema, String table) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the table's which use this table's - * primary key as a foreign key. The information is - * returned as a ResultSet with the following columns: - *

- *

    - *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. - *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. - *
  3. PKTABLE_NAME - The name of the table the key was imported from. - *
  4. PKCOLUMN_NAME - The name of the column that was imported. - *
  5. FKTABLE_CAT - The foreign key catalog name. - *
  6. FKTABLE_SCHEM - The foreign key schema name. - *
  7. FKTABLE_NAME - The foreign key table name. - *
  8. FKCOLUMN_NAME - The foreign key column name. - *
  9. KEY_SEQ - The sequence number of the column within the foreign key. - *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is - * updated. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, importedKeySetDefault, or - * importedKeyRestrict). - *
  11. DELETE_RULE - How the foreign key behaves when the primary key is - * deleted. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, or importedKeySetDefault) - *
  12. FK_NAME - The name of the foreign key. - *
  13. PK_NAME - The name of the primary key. - *
  14. DEFERRABILITY - The deferrability value. This is one of the - * constants defined in this table (importedKeyInitiallyDeferred, - * importedKeyInitiallyImmediate, or - * importedKeyNotDeferrable). - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * - * @return A ResultSet with the requested information - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getExportedKeys(String catalog, String schema, String table) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a description of how one table imports another - * table's primary key as a foreign key. The information is - * returned as a ResultSet with the following columns: - *

- *

    - *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. - *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. - *
  3. PKTABLE_NAME - The name of the table the key was imported from. - *
  4. PKCOLUMN_NAME - The name of the column that was imported. - *
  5. FKTABLE_CAT - The foreign key catalog name. - *
  6. FKTABLE_SCHEM - The foreign key schema name. - *
  7. FKTABLE_NAME - The foreign key table name. - *
  8. FKCOLUMN_NAME - The foreign key column name. - *
  9. KEY_SEQ - The sequence number of the column within the foreign key. - *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is - * updated. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, importedKeySetDefault, or - * importedKeyRestrict). - *
  11. DELETE_RULE - How the foreign key behaves when the primary key is - * deleted. This is one of the constants defined in this class - * (importedNoAction, importedKeyCascade, - * importedKeySetNull, or importedKeySetDefault) - *
  12. FK_NAME - The name of the foreign key. - *
  13. PK_NAME - The name of the primary key. - *
  14. DEFERRABILITY - The deferrability value. This is one of the - * constants defined in this table (importedKeyInitiallyDeferred, - * importedKeyInitiallyImmediate, or - * importedKeyNotDeferrable). - *
- * - * @param primCatalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs, on the exporting side. - * @param primSchema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema, on the exporting side. - * @param primTable The table name to return information for, on the exporting - * side. - * @param forCatalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs, on the importing side. - * @param forSchema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema on the importing side. - * @param forTable The table name to return information for on the importing - * side. - * - * @return A ResultSet with the requested information - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getCrossReference(String primCatalog, String primSchema, String primTable, - String forCatalog, String forSchema, String forTable) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a list of the SQL types supported by this - * database. The information is returned as a ResultSet - * with the following columns: - *

- *

    - *
  1. TYPE_NAME - The name of the data type. - *
  2. DATA_TYPE - A data type constant from Types for this - * type. - *
  3. PRECISION - The maximum precision of this type. - *
  4. LITERAL_PREFIX - Prefix value used to quote a literal, which may be - * null. - *
  5. LITERAL_SUFFIX - Suffix value used to quote a literal, which may be - * null. - *
  6. CREATE_PARAMS - The parameters used to create the type, which may be - * null. - *
  7. NULLABLE - Whether or not this type supports NULL values. This will - * be one of the constants defined in this interface - * (typeNoNulls, typeNullable, or - * typeNullableUnknown). - *
  8. CASE_SENSITIVE - Whether or not the value is case sensitive. - *
  9. SEARCHABLE - Whether or not "LIKE" expressions are supported in - * WHERE clauses for this type. This will be one of the constants defined - * in this interface (typePredNone, typePredChar, - * typePredBasic, or typeSearchable). - *
  10. UNSIGNED_ATTRIBUTE - Is the value of this type unsigned. - *
  11. FIXED_PREC_SCALE - Whether or not this type can be used for money. - *
  12. AUTO_INCREMENT - Whether or not this type supports auto-incrementing. - *
  13. LOCAL_TYPE_NAME - A localized name for this data type. - *
  14. MINIMUM_SCALE - The minimum scale supported by this type. - *
  15. MAXIMUM_SCALE - The maximum scale supported by this type. - *
  16. SQL_DATA_TYPE - Unused. - *
  17. SQL_DATETIME_SUB - Unused. - *
  18. NUM_PREC_RADIX - The radix of this data type. - *
- * - * @return A ResultSet with the list of available data types. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getTypeInfo() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns information about a tables indices and statistics. - * It is returned as a ResultSet with the following columns: - *

- *

    - *
  1. TABLE_CAT - The catalog of the table, which may be null. - *
  2. TABLE_SCHEM - The schema of the table, which may be null. - *
  3. TABLE_NAME - The name of the table. - *
  4. NON_UNIQUE - Are index values non-unique? - *
  5. INDEX_QUALIFIER The index catalog, which may be null - *
  6. INDEX_NAME - The name of the index. - *
  7. TYPE - The type of index, which will be one of the constants defined - * in this interface (tableIndexStatistic, - * tableIndexClustered, tableIndexHashed, or - * tableIndexOther). - *
  8. ORDINAL_POSITION - The sequence number of this column in the index. - * This will be 0 when the index type is tableIndexStatistic. - *
  9. COLUMN_NAME - The name of this column in the index. - *
  10. ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a - * descending sort sequence or null if a sort sequence is not - * supported. - *
  11. CARDINALITY - The number of unique rows in the index, or the number - * of rows in the table if the index type is tableIndexStatistic. - *
  12. PAGES - The number of pages used for the index, or the number of pages - * in the table if the index type is tableIndexStatistic. - *
  13. FILTER_CONDITION - The filter condition for this index, which may be - * null. - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param table The table name to return information for. - * @param unique true to return only unique indexes, - * false otherwise. - * @param approx true if data values can be approximations, - * false otherwise. - * - * @return A ResultSet with the requested index information - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getIndexInfo(String catalog, String schema, String table, boolean unique, - boolean approx) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the datbase supports the specified - * result type. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -supportsResultSetType(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether the specified result set type and result set - * concurrency type are supported by the database. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * @param concur The desired concurrency type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type is supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -supportsResultSetConcurrency(int type, int concur) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees its - * own updates. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees its own updates, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -ownUpdatesAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees its - * own deletes. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees its own deletes, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -ownDeletesAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees its - * own inserts. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees its own inserts, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -ownInsertsAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees - * updates committed by others. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees other updates, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -othersUpdatesAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees - * deletes committed by others. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees other deletes, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -othersDeletesAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type sees - * inserts committed by others. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type sees other inserts, - * false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -othersInsertsAreVisible(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type can detect - * a visible update by calling the rowUpdated method. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type can detect visible updates - * using rowUpdated, false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -updatesAreDetected(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type can detect - * a visible delete by calling the rowUpdated method. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type can detect visible deletes - * using rowUpdated, false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -deletesAreDetected(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified result set type can detect - * a visible insert by calling the rowUpdated method. - * - * @param type The desired result type, which is one of the constants - * defined in ResultSet. - * - * @return true if the result set type can detect visible inserts - * using rowUpdated, false otherwise. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract boolean -insertsAreDetected(int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the database supports batch updates. - * - * @return true if batch updates are supported, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -supportsBatchUpdates() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the list of user defined data types in use. These - * are returned as a ResultSet with the following columns: - *

- *

    - *
  1. TYPE_CAT - The catalog name, which may be null. - *
  2. TYPE_SCEHM - The schema name, which may be null. - *
  3. TYPE_NAME - The user defined data type name. - *
  4. CLASS_NAME - The Java class name this type maps to. - *
  5. DATA_TYPE - A type identifier from Types for this type. - * This will be one of JAVA_OBJECT, STRUCT, or - * DISTINCT. - *
  6. REMARKS - Comments about this data type. - *
- * - * @param catalog The catalog to retrieve information from, or the empty string - * to return entities not associated with a catalog, or null - * to return information from all catalogs. - * @param schema The schema to retrieve information from, or the empty string - * to return entities not associated with a schema. - * @param typePattern The type name pattern to match. - * @param types The type identifier patterns (from Types) to - * match. - * - * @return A ResultSet with the requested type information - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -getUDTs(String catalog, String schema, String typePattern, int[] types) - throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the Connection object that was used - * to generate the metadata in this object. - * - * @return The connection for this object. - * - * @exception SQLException If an error occurs. - */ -public abstract Connection -getConnection() throws SQLException; - -} // interface DatabaseMetaData - + /** + * It is unknown whether or not the procedure returns a result. + */ + public static final int procedureResultUnknown = 0; + + /** + * The procedure does not return a result. + */ + public static final int procedureNoResult = 1; + + /** + * The procedure returns a result. + */ + public static final int procedureReturnsResult = 2; + + /** + * The column type is unknown. + */ + public static final int procedureColumnUnknown = 0; + + /** + * The column type is input. + */ + public static final int procedureColumnIn = 1; + + /** + * The column type is input/output. + */ + public static final int procedureColumnInOut = 2; + + /** + * The column type is output + */ + public static final int procedureColumnOut = 4; + + /** + * The column is used for return values. + */ + public static final int procedureColumnReturn = 5; + + /** + * The column is used for storing results + */ + public static final int procedureColumnResult = 3; + + /** + * NULL values are not allowed. + */ + public static final int procedureNoNulls = 0; + + /** + * NULL values are allowed. + */ + public static final int procedureNullable = 1; + + /** + * It is unknown whether or not NULL values are allowed. + */ + public static final int procedureNullableUnknown = 2; + + /** + * The column does not allow NULL + */ + public static final int columnNoNulls = 0; + + /** + * The column does allow NULL + */ + public static final int columnNullable = 1; + + /** + * It is unknown whether or not the column allows NULL + */ + public static final int columnNullableUnknown = 2; + + /** + * The best row's scope is only guaranteed to be valid so long as the + * row is actually being used. + */ + public static final int bestRowTemporary = 0; + + /** + * The best row identifier is valid to the end of the transaction. + */ + public static final int bestRowTransaction = 1; + + /** + * The best row identifier is valid to the end of the session. + */ + public static final int bestRowSession = 2; + + /** + * The best row may or may not be a pseudo-column. + */ + public static final int bestRowUnknown = 0; + + /** + * The best row identifier is not a pseudo-column. + */ + public static final int bestRowNotPseudo = 1; + + /** + * The best row identifier is a pseudo-column. + */ + public static final int bestRowPseudo = 2; + + /** + * It is unknown whether or not the version column is a pseudo-column. + */ + public static final int versionColumnUnknown = 0; + + /** + * The version column is not a pseudo-column + */ + public static final int versionColumnNotPseudo = 1; + + /** + * The version column is a pseudo-column + */ + public static final int versionColumnPseudo = 2; + + /** + * Foreign key changes are cascaded in updates or deletes. + */ + public static final int importedKeyCascade = 0; + + /** + * Column may not be updated or deleted in use as a foreign key. + */ + public static final int importedKeyRestrict = 1; + + /** + * When primary key is updated or deleted, the foreign key is set to NULL. + */ + public static final int importedKeySetNull = 2; + + /** + * If the primary key is a foreign key, it cannot be udpated or deleted. + */ + public static final int importedKeyNoAction = 3; + + /** + * If the primary key is updated or deleted, the foreign key is set to + * a default value. + */ + public static final int importedKeySetDefault = 4; + + /** + * Wish I knew what this meant. + */ + public static final int importedKeyInitiallyDeferred = 5; + + /** + * Wish I knew what this meant. + */ + public static final int importedKeyInitiallyImmediate = 6; + + /** + * Wish I knew what this meant. + */ + public static final int importedKeyNotDeferrable = 7; + + /** + * A NULL value is not allowed for this data type. + */ + public static final int typeNoNulls = 0; + + /** + * A NULL value is allowed for this data type. + */ + public static final int typeNullable = 1; + + /** + * It is unknown whether or not NULL values are allowed for this data type. + */ + public static final int typeNullableUnknown = 2; + + /** + * Where clauses are not supported for this type. + */ + public static final int typePredNone = 0; + + /** + * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type. + */ + public static final int typePredChar = 1; + + /** + * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type. + */ + public static final int typePredBasic = 2; + + /** + * Any type of WHERE clause is allowed for this data type. + */ + public static final int typeSearchable = 3; + + /** + * This column contains table statistics. + */ + public static final short tableIndexStatistic = 0; + + /** + * This table index is clustered. + */ + public static final short tableIndexClustered = 1; + + /** + * This table index is hashed. + */ + public static final short tableIndexHashed = 2; + + /** + * This table index is of another type. + */ + public static final short tableIndexOther = 3; + + public static final short attributeNoNulls = 0; + + public static final short attributeNullable = 1; + + public static final short attributeNullableUnknown = 2; + + public static final int sqlStateXOpen = 1; + + public static final int sqlStateSQL99 = 2; + + /** + * This method tests whether or not all the procedures returned by + * the getProcedures method can be called by this user. + * + * @return true if all the procedures can be called, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean allProceduresAreCallable() throws SQLException; + + /** + * This method tests whether or not all the table returned by the + * getTables method can be selected by this user. + * + * @return true if all the procedures can be called, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ + public boolean allTablesAreSelectable() throws SQLException; + + /** + * This method returns the URL for this database. + * + * @return The URL string for this database, or null if it + * is not known. + * @exception SQLException If an error occurs. + */ + public String getURL() throws SQLException; + + /** + * This method returns the database username for this connection. + * + * @return The database username. + * @exception SQLException If an error occurs. + */ + public String getUserName() throws SQLException; + + /** + * This method tests whether or not the database is in read only mode. + * + * @return true if the database is in read only mode, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isReadOnly() throws SQLException; + + /** + * This method tests whether or not NULL's sort as high values. + * + * @return true if NULL's sort as high values, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean nullsAreSortedHigh() throws SQLException; + + /** + * This method tests whether or not NULL's sort as low values. + * + * @return true if NULL's sort as low values, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean nullsAreSortedLow() throws SQLException; + + /** + * This method tests whether or not NULL's sort as high values. + * + * @return true if NULL's sort as high values, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean nullsAreSortedAtStart() throws SQLException; + + /** + * This method test whether or not NULL's are sorted to the end + * of the list regardless of ascending or descending sort order. + * + * @return true if NULL's always sort to the end, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean nullsAreSortedAtEnd() throws SQLException; + + /** + * This method returns the name of the database product. + * + * @return The database product. + * @exception SQLException If an error occurs. + */ + public String getDatabaseProductName() throws SQLException; + + /** + * This method returns the version of the database product. + * + * @return The version of the database product. + * @exception SQLException If an error occurs. + */ + public String getDatabaseProductVersion() throws SQLException; + + /** + * This method returns the name of the JDBC driver. + * + * @return The name of the JDBC driver. + * @exception SQLException If an error occurs. + */ + public String getDriverName() throws SQLException; + + /** + * This method returns the version of the JDBC driver. + * + * @return The version of the JDBC driver. + * @exception SQLException If an error occurs. + */ + public String getDriverVersion() throws SQLException; + + /** + * This method returns the major version number of the JDBC driver. + * + * @return The major version number of the JDBC driver. + */ + public int getDriverMajorVersion(); + + /** + * This method returns the minor version number of the JDBC driver. + * + * @return The minor version number of the JDBC driver. + */ + public int getDriverMinorVersion(); + + /** + * This method tests whether or not the database uses local files to + * store tables. + * + * @return true if the database uses local files, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ + public boolean usesLocalFiles() throws SQLException; + + /** + * This method tests whether or not the database uses a separate file for + * each table. + * + * @return true if the database uses a separate file for each + * table false otherwise. + * + * @exception SQLException If an error occurs. + */ + public boolean usesLocalFilePerTable() throws SQLException; + + /** + * This method tests whether or not the database supports identifiers + * with mixed case. + * + * @return true if the database supports mixed case identifiers, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ + public boolean supportsMixedCaseIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database treats mixed case + * identifiers as all upper case. + * + * @exception true if the database treats all identifiers as + * upper case, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesUpperCaseIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database treats mixed case + * identifiers as all lower case. + * + * @exception true if the database treats all identifiers as + * lower case, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesLowerCaseIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database stores mixed case + * identifers even if it treats them as case insensitive. + * + * @return true if the database stores mixed case identifiers, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesMixedCaseIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database supports quoted identifiers + * with mixed case. + * + * @return true if the database supports mixed case quoted + * identifiers, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database treats mixed case + * quoted identifiers as all upper case. + * + * @exception true if the database treats all quoted identifiers + * as upper case, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesUpperCaseQuotedIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database treats mixed case + * quoted identifiers as all lower case. + * + * @exception true if the database treats all quoted identifiers + * as lower case, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesLowerCaseQuotedIdentifiers() throws SQLException; + + /** + * This method tests whether or not the database stores mixed case + * quoted identifers even if it treats them as case insensitive. + * + * @return true if the database stores mixed case quoted + * identifiers, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean storesMixedCaseQuotedIdentifiers() throws SQLException; + + /** + * This metohd returns the quote string for SQL identifiers. + * + * @return The quote string for SQL identifers, or a space if quoting + * is not supported. + * @exception SQLException If an error occurs. + */ + public String getIdentifierQuoteString() throws SQLException; + + /** + * This method returns a comma separated list of all the SQL keywords in + * the database that are not in SQL92. + * + * @return The list of SQL keywords not in SQL92. + * @exception SQLException If an error occurs. + */ + public String getSQLKeywords() throws SQLException; + + /** + * This method returns a comma separated list of math functions. + * + * @return The list of math functions. + * @exception SQLException If an error occurs. + */ + public String getNumericFunctions() throws SQLException; + + /** + * This method returns a comma separated list of string functions. + * + * @return The list of string functions. + * @exception SQLException If an error occurs. + */ + public String getStringFunctions() throws SQLException; + + /** + * This method returns a comma separated list of of system functions. + * + * @return A comma separated list of system functions. + * @exception SQLException If an error occurs. + */ + public String getSystemFunctions() throws SQLException; + + /** + * This method returns comma separated list of time/date functions. + * + * @return The list of time/date functions. + * @exception SQLException If an error occurs. + */ + public String getTimeDateFunctions() throws SQLException; + + /** + * This method returns the string used to escape wildcards in search strings. + * + * @return The string used to escape wildcards in search strings. + * @exception SQLException If an error occurs. + */ + public String getSearchStringEscape() throws SQLException; + + /** + * This methods returns non-standard characters that can appear in + * unquoted identifiers. + * + * @return Non-standard characters that can appear in unquoted identifiers. + * @exception SQLException If an error occurs. + */ + public String getExtraNameCharacters() throws SQLException; + + /** + * This method tests whether or not the database supports + * "ALTER TABLE ADD COLUMN" + * + * @return true if column add supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsAlterTableWithAddColumn() throws SQLException; + + /** + * This method tests whether or not the database supports + * "ALTER TABLE DROP COLUMN" + * + * @return true if column drop supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsAlterTableWithDropColumn() throws SQLException; + + /** + * This method tests whether or not column aliasing is supported. + * + * @return true if column aliasing is supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsColumnAliasing() throws SQLException; + + /** + * This method tests whether the concatenation of a NULL and non-NULL + * value results in a NULL. This will always be true in fully JDBC compliant + * drivers. + * + * @return true if concatenating NULL and a non-NULL value + * returns a NULL, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean nullPlusNonNullIsNull() throws SQLException; + + /** + * Tests whether or not CONVERT is supported. + * + * @return true if CONVERT is supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsConvert() throws SQLException; + + /** + * This method tests whether or not CONVERT can be performed between the + * specified types. The types are contants from Types. + * + * @param fromType The SQL type to convert from. + * @param toType The SQL type to convert to. + * @return true if the conversion can be performed, + * false otherwise. + * @see Types + */ + public boolean supportsConvert(int fromType, int toType) throws + SQLException; + + /** + * This method tests whether or not table correlation names are + * supported. This will be always be true in a fully JDBC + * compliant driver. + * + * @return true if table correlation names are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsTableCorrelationNames() throws SQLException; + + /** + * This method tests whether correlation names must be different from the + * name of the table. + * + * @return true if the correlation name must be different from + * the table name, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsDifferentTableCorrelationNames() throws SQLException; + + /** + * This method tests whether or not expressions are allowed in an + * ORDER BY lists. + * + * @return true if expressions are allowed in ORDER BY + * lists, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsExpressionsInOrderBy() throws SQLException; + + /** + * This method tests whether or ORDER BY on a non-selected column is + * allowed. + * + * @return true if a non-selected column can be used in an + * ORDER BY, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOrderByUnrelated() throws SQLException; + + /** + * This method tests whether or not GROUP BY is supported. + * + * @return true if GROUP BY is supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsGroupBy() throws SQLException; + + /** + * This method tests whether GROUP BY on a non-selected column is + * allowed. + * + * @return true if a non-selected column can be used in a + * GROUP BY, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsGroupByUnrelated() throws SQLException; + + /** + * This method tests whether or not a GROUP BY can add columns not in the + * select if it includes all the columns in the select. + * + * @return true if GROUP BY an add columns provided it includes + * all columns in the select, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsGroupByBeyondSelect() throws SQLException; + + /** + * This method tests whether or not the escape character is supported in + * LIKE expressions. A fully JDBC compliant driver will always return + * true. + * + * @return true if escapes are supported in LIKE expressions, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsLikeEscapeClause() throws SQLException; + + /** + * This method tests whether multiple result sets for a single statement are + * supported. + * + * @return true if multiple result sets are supported for a + * single statement, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsMultipleResultSets() throws SQLException; + + /** + * This method test whether or not multiple transactions may be open + * at once, as long as they are on different connections. + * + * @return true if multiple transactions on different + * connections are supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsMultipleTransactions() throws SQLException; + + /** + * This method tests whether or not columns can be defined as NOT NULL. A + * fully JDBC compliant driver always returns true. + * + * @return true if NOT NULL columns are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsNonNullableColumns() throws SQLException; + + /** + * This method tests whether or not the minimum grammer for ODBC is supported. + * A fully JDBC compliant driver will always return true. + * + * @return true if the ODBC minimum grammar is supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsMinimumSQLGrammar() throws SQLException; + + /** + * This method tests whether or not the core grammer for ODBC is supported. + * + * @return true if the ODBC core grammar is supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCoreSQLGrammar() throws SQLException; + + /** + * This method tests whether or not the extended grammer for ODBC is supported. + * + * @return true if the ODBC extended grammar is supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsExtendedSQLGrammar() throws SQLException; + + /** + * This method tests whether or not the ANSI92 entry level SQL + * grammar is supported. A fully JDBC compliant drivers must return + * true. + * + * @return true if the ANSI92 entry level SQL grammar is + * supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsANSI92EntryLevelSQL() throws SQLException; + + /** + * This method tests whether or not the ANSI92 intermediate SQL + * grammar is supported. + * + * @return true if the ANSI92 intermediate SQL grammar is + * supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsANSI92IntermediateSQL() throws SQLException; + + /** + * This method tests whether or not the ANSI92 full SQL + * grammar is supported. + * + * @return true if the ANSI92 full SQL grammar is + * supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsANSI92FullSQL() throws SQLException; + + /** + * This method tests whether or not the SQL integrity enhancement + * facility is supported. + * + * @return true if the integrity enhancement facility is + * supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsIntegrityEnhancementFacility() throws SQLException; + + /** + * This method tests whether or not the database supports outer joins. + * + * @return true if outer joins are supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOuterJoins() throws SQLException; + + /** + * This method tests whether or not the database supports full outer joins. + * + * @return true if full outer joins are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsFullOuterJoins() throws SQLException; + + /** + * This method tests whether or not the database supports limited outer joins. + * + * @return true if limited outer joins are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsLimitedOuterJoins() throws SQLException; + + /** + * This method returns the vendor's term for "schema". + * + * @return The vendor's term for schema. + * @exception SQLException if an error occurs. + */ + public String getSchemaTerm() throws SQLException; + + /** + * This method returns the vendor's term for "procedure". + * + * @return The vendor's term for procedure. + * @exception SQLException if an error occurs. + */ + public String getProcedureTerm() throws SQLException; + + /** + * This method returns the vendor's term for "catalog". + * + * @return The vendor's term for catalog. + * @exception SQLException if an error occurs. + */ + public String getCatalogTerm() throws SQLException; + + /** + * This method tests whether a catalog name appears at the beginning of + * a fully qualified table name. + * + * @return true if the catalog name appears at the beginning, + * false if it appears at the end. + * @exception SQLException If an error occurs. + */ + public boolean isCatalogAtStart() throws SQLException; + + /** + * This method returns the separator between the catalog name and the + * table name. + * + * @return The separator between the catalog name and the table name. + * @exception SQLException If an error occurs. + */ + public String getCatalogSeparator() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a data + * manipulation statement. + * + * @return true if a catalog name can appear in a data + * manipulation statement, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSchemasInDataManipulation() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a procedure + * call + * + * @return true if a catalog name can appear in a procedure + * call, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSchemasInProcedureCalls() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a table definition. + * + * @return true if a catalog name can appear in a table + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSchemasInTableDefinitions() throws SQLException; + + /** + * This method tests whether a catalog name can appear in an index definition. + * + * @return true if a catalog name can appear in an index + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSchemasInIndexDefinitions() throws SQLException; + + /** + * This method tests whether a catalog name can appear in privilege definitions. + * + * @return true if a catalog name can appear in privilege + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a data + * manipulation statement. + * + * @return true if a catalog name can appear in a data + * manipulation statement, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCatalogsInDataManipulation() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a procedure + * call + * + * @return true if a catalog name can appear in a procedure + * call, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCatalogsInProcedureCalls() throws SQLException; + + /** + * This method tests whether a catalog name can appear in a table definition. + * + * @return true if a catalog name can appear in a table + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCatalogsInTableDefinitions() throws SQLException; + + /** + * This method tests whether a catalog name can appear in an index definition. + * + * @return true if a catalog name can appear in an index + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCatalogsInIndexDefinitions() throws SQLException; + + /** + * This method tests whether a catalog name can appear in privilege definitions. + * + * @return true if a catalog name can appear in privilege + * definition, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException; + + /** + * This method tests whether or not that database supports positioned + * deletes. + * + * @return true if positioned deletes are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsPositionedDelete() throws SQLException; + + /** + * This method tests whether or not that database supports positioned + * updates. + * + * @return true if positioned updates are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsPositionedUpdate() throws SQLException; + + /** + * This method tests whether or not SELECT FOR UPDATE is supported by the + * database. + * + * @return true if SELECT FOR UPDATE is supported + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSelectForUpdate() throws SQLException; + + /** + * This method tests whether or not stored procedures are supported on + * this database. + * + * @return true if stored procedures are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsStoredProcedures() throws SQLException; + + /** + * This method tests whether or not subqueries are allowed in comparisons. + * A fully JDBC compliant driver will always return true. + * + * @return true if subqueries are allowed in comparisons, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSubqueriesInComparisons() throws SQLException; + + /** + * This method tests whether or not subqueries are allowed in exists + * expressions. A fully JDBC compliant driver will always return + * true. + * + * @return true if subqueries are allowed in exists + * expressions, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSubqueriesInExists() throws SQLException; + + /** + * This method tests whether subqueries are allowed in IN statements. + * A fully JDBC compliant driver will always return true. + * + * @return true if the driver supports subqueries in IN + * statements, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSubqueriesInIns() throws SQLException; + + /** + * This method tests whether or not subqueries are allowed in quantified + * expressions. A fully JDBC compliant driver will always return + * true. + * + * @return true if subqueries are allowed in quantified + * expressions, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsSubqueriesInQuantifieds() throws SQLException; + + /** + * This method test whether or not correlated subqueries are allowed. A + * fully JDBC compliant driver will always return true. + * + * @return true if correlated subqueries are allowed, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsCorrelatedSubqueries() throws SQLException; + + /** + * This method tests whether or not the UNION statement is supported. + * + * @return true if UNION is supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsUnion() throws SQLException; + + /** + * This method tests whether or not the UNION ALL statement is supported. + * + * @return true if UNION ALL is supported, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsUnionAll() throws SQLException; + + /** + * This method tests whether or not the database supports cursors + * remaining open across commits. + * + * @return true if cursors can remain open across commits, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOpenCursorsAcrossCommit() throws SQLException; + + /** + * This method tests whether or not the database supports cursors + * remaining open across rollbacks. + * + * @return true if cursors can remain open across rollbacks, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOpenCursorsAcrossRollback() throws SQLException; + + /** + * This method tests whether or not the database supports statements + * remaining open across commits. + * + * @return true if statements can remain open across commits, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOpenStatementsAcrossCommit() throws SQLException; + + /** + * This method tests whether or not the database supports statements + * remaining open across rollbacks. + * + * @return true if statements can remain open across rollbacks, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsOpenStatementsAcrossRollback() throws SQLException; + + /** + * This method returns the number of hex characters allowed in an inline + * binary literal. + * + * @return The number of hex characters allowed in a binary literal, 0 meaning + * either an unknown or unlimited number. + * @exception SQLException If an error occurs. + */ + public int getMaxBinaryLiteralLength() throws SQLException; + + /** + * This method returns the maximum length of a character literal. + * + * @return The maximum length of a character literal. + * @exception SQLException If an error occurs. + */ + public int getMaxCharLiteralLength() throws SQLException; + + /** + * This method returns the maximum length of a column name. + * + * @return The maximum length of a column name. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnNameLength() throws SQLException; + + /** + * This method returns the maximum number of columns in a GROUP BY statement. + * + * @return The maximum number of columns in a GROUP BY statement. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnsInGroupBy() throws SQLException; + + /** + * This method returns the maximum number of columns in an index. + * + * @return The maximum number of columns in an index. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnsInIndex() throws SQLException; + + /** + * This method returns the maximum number of columns in an ORDER BY statement. + * + * @return The maximum number of columns in an ORDER BY statement. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnsInOrderBy() throws SQLException; + + /** + * This method returns the maximum number of columns in a SELECT statement. + * + * @return The maximum number of columns in a SELECT statement. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnsInSelect() throws SQLException; + + /** + * This method returns the maximum number of columns in a table. + * + * @return The maximum number of columns in a table. + * @exception SQLException If an error occurs. + */ + public int getMaxColumnsInTable() throws SQLException; + + /** + * This method returns the maximum number of connections this client + * can have to the database. + * + * @return The maximum number of database connections. + * @SQLException If an error occurs. + */ + public int getMaxConnections() throws SQLException; + + /** + * This method returns the maximum length of a cursor name. + * + * @return The maximum length of a cursor name. + * @exception SQLException If an error occurs. + */ + public int getMaxCursorNameLength() throws SQLException; + + /** + * This method returns the maximum length of an index. + * + * @return The maximum length of an index. + * @exception SQLException If an error occurs. + */ + public int getMaxIndexLength() throws SQLException; + + /** + * This method returns the maximum length of a schema name. + * + * @return The maximum length of a schema name. + * @exception SQLException If an error occurs. + */ + public int getMaxSchemaNameLength() throws SQLException; + + /** + * This method returns the maximum length of a procedure name. + * + * @return The maximum length of a procedure name. + * @exception SQLException If an error occurs. + */ + public int getMaxProcedureNameLength() throws SQLException; + + /** + * This method returns the maximum length of a catalog name. + * + * @return The maximum length of a catalog name. + * @exception SQLException If an error occurs. + */ + public int getMaxCatalogNameLength() throws SQLException; + + /** + * This method returns the maximum size of a row in bytes. + * + * @return The maximum size of a row. + * @exception SQLException If an error occurs. + */ + public int getMaxRowSize() throws SQLException; + + /** + * This method tests whether or not the maximum row size includes BLOB's + * + * @return true if the maximum row size includes BLOB's, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean doesMaxRowSizeIncludeBlobs() throws SQLException; + + /** + * This method includes the maximum length of a SQL statement. + * + * @return The maximum length of a SQL statement. + * @exception SQLException If an error occurs. + */ + public int getMaxStatementLength() throws SQLException; + + /** + * This method returns the maximum number of statements that can be + * active at any time. + * + * @return The maximum number of statements that can be active at any time. + * @exception SQLException If an error occurs. + */ + public int getMaxStatements() throws SQLException; + + /** + * This method returns the maximum length of a table name. + * + * @return The maximum length of a table name. + * @exception SQLException If an error occurs. + */ + public int getMaxTableNameLength() throws SQLException; + + /** + * This method returns the maximum number of tables that may be referenced + * in a SELECT statement. + * + * @return The maximum number of tables allowed in a SELECT statement. + * @exception SQLException If an error occurs. + */ + public int getMaxTablesInSelect() throws SQLException; + + /** + * This method returns the maximum length of a user name. + * + * @return The maximum length of a user name. + * @exception SQLException If an error occurs. + */ + public int getMaxUserNameLength() throws SQLException; + + /** + * This method returns the default transaction isolation level of the + * database. + * + * @return The default transaction isolation level of the database. + * @exception SQLException If an error occurs. + * @see Connection + */ + public int getDefaultTransactionIsolation() throws SQLException; + + /** + * This method tests whether or not the database supports transactions. + * + * @return true if the database supports transactions, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsTransactions() throws SQLException; + + /** + * This method tests whether or not the database supports the specified + * transaction isolation level. + * + * @param level The transaction isolation level. + * + * @return true if the specified transaction isolation level + * is supported, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsTransactionIsolationLevel(int level) throws + SQLException; + + /** + * This method tests whether or not DDL and DML statements allowed within + * the same transaction. + * + * @return true if DDL and DML statements are allowed in the + * same transaction, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsDataDefinitionAndDataManipulationTransactions() + throws SQLException; + + /** + * This method tests whether or not only DML statement are allowed + * inside a transaction. + * + * @return true if only DML statements are allowed in + * transactions, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsDataManipulationTransactionsOnly() throws + SQLException; + + /** + * This method tests whether or not a DDL statement will cause the + * current transaction to be automatically committed. + * + * @return true if DDL causes an immediate transaction commit, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean dataDefinitionCausesTransactionCommit() throws SQLException; + + /** + * This method tests whether or not DDL statements are ignored in + * transactions. + * + * @return true if DDL statements are ignored in transactions, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean dataDefinitionIgnoredInTransactions() throws SQLException; + + /** + * This method returns a list of all the stored procedures matching the + * specified pattern in the given schema and catalog. This is returned + * a ResultSet with the following columns: + *

+ *

    + *
  1. PROCEDURE_CAT - The catalog the procedure is in, which may be + * null. + *
  2. PROCEDURE_SCHEM - The schema the procedures is in, which may be + * null. + *
  3. PROCEDURE_NAME - The name of the procedure. + *
  4. Unused + *
  5. Unused + *
  6. Unused + *
  7. REMARKS - A description of the procedure + *
  8. PROCEDURE_TYPE - Indicates the return type of the procedure, which + * is one of the contstants defined in this class + * (procedureResultUnknown, procedureNoResult, or + * procedureReturnsResult). + *
+ * + * @param catalog The name of the catalog to return stored procedured from, + * or "" to return procedures from all catalogs. + * @param schemaPattern A schema pattern for the schemas to return stored + * procedures from, or "" to return procedures from all schemas. + * @param namePattern The pattern of procedures names to return. + * @returns A ResultSet with all the requested procedures. + * @exception SQLException If an error occurs. + */ + public ResultSet getProcedures(String catalog, String schemaPattern, String + procedureNamePattern) throws SQLException; + + /** + * This method returns a list of the parameter and result columns for + * the requested stored procedures. This is returned in the form of a + * ResultSet with the following columns: + *

+ *

    + *
  1. PROCEDURE_CAT - The catalog the procedure is in, which may be + * null. + *
  2. PROCEDURE_SCHEM - The schema the procedures is in, which may be + * null. + *
  3. PROCEDURE_NAME - The name of the procedure. + *
  4. COLUMN_NAME - The name of the column + *
  5. COLUMN_TYPE - The type of the column, which will be one of the + * contants defined in this class (procedureColumnUnknown, + * procedureColumnIn, procedureColumnInOut, + * procedureColumnOut, procedureColumnReturn, + * or procedureColumnResult). + *
  6. DATA_TYPE - The SQL type of the column. This is one of the constants + * defined in Types. + *
  7. TYPE_NAME - The string name of the data type for this column. + *
  8. PRECISION - The precision of the column. + *
  9. LENGTH - The length of the column in bytes + *
  10. SCALE - The scale of the column. + *
  11. RADIX - The radix of the column. + *
  12. NULLABLE - Whether or not the column is NULLABLE. This is one of + * the constants defined in this class (procedureNoNulls, + * procedureNullable, or procedureNullableUnknown) + *
  13. REMARKS - A description of the column. + *
+ * + * @param catalog The name of the catalog to return stored procedured from, + * or "" to return procedures from all catalogs. + * @param schemaPattern A schema pattern for the schemas to return stored + * procedures from, or "" to return procedures from all schemas. + * @param namePattern The pattern of procedures names to return. + * @param columnPattern The pattern of column names to return. + * @returns A ResultSet with all the requested procedures. + * @exception SQLException If an error occurs. + */ + public ResultSet getProcedureColumns(String catalog, String schemaPattern, + String procedureNamePattern, String columnNamePattern) throws + SQLException; + + /** + * This method returns a list of the requested table as a + * ResultSet with the following columns: + *

+ *

    + *
  1. TABLE_CAT - The catalog the table is in, which may be null. + *
  2. TABLE_SCHEM - The schema the table is in, which may be null. + *
  3. TABLE_NAME - The name of the table. + *
  4. TABLE_TYPE - A string describing the table type. This will be one + * of the values returned by the getTableTypes() method. + *
  5. REMARKS - Comments about the table. + *
+ * + * @param catalog The name of the catalog to return tables from, + * or "" to return tables from all catalogs. + * @param schemaPattern A schema pattern for the schemas to return tables + * from, or "" to return tables from all schemas. + * @param namePattern The pattern of table names to return. + * @param types The list of table types to include; null returns all types. + * @returns A ResultSet with all the requested tables. + * @exception SQLException If an error occurs. + */ + public ResultSet getTables(String catalog, String schemaPattern, String + tableNamePattern, String[] types) throws SQLException; + + /** + * This method returns the list of database schemas as a + * ResultSet, with one column - TABLE_SCHEM - that is the + * name of the schema. + * + * @return A ResultSet with all the requested schemas. + * @exception SQLException If an error occurs. + */ + public ResultSet getSchemas() throws SQLException; + + /** + * This method returns the list of database catalogs as a + * ResultSet with one column - TABLE_CAT - that is the + * name of the catalog. + * + * @return A ResultSet with all the requested catalogs. + * @exception SQLException If an error occurs. + */ + public ResultSet getCatalogs() throws SQLException; + + /** + * This method returns the list of database table types as a + * ResultSet with one column - TABLE_TYPE - that is the + * name of the table type. + * + * @return A ResultSet with all the requested table types. + * @exception SQLException If an error occurs. + */ + public ResultSet getTableTypes() throws SQLException; + + /** + * This method returns a list of the tables columns for + * the requested tables. This is returned in the form of a + * ResultSet with the following columns: + *

+ *

    + *
  1. TABLE_CAT - The catalog the table is in, which may be + * null. + *
  2. TABLE_SCHEM - The schema the tables is in, which may be + * null. + *
  3. TABLE_NAME - The name of the table. + *
  4. COLUMN_NAME - The name of the column + *
  5. DATA_TYPE - The SQL type of the column. This is one of the constants + * defined in Types. + *
  6. TYPE_NAME - The string name of the data type for this column. + *
  7. COLUMN_SIZE - The size of the column. + *
  8. Unused + *
  9. NUM_PREC_RADIX - The radix of the column. + *
  10. NULLABLE - Whether or not the column is NULLABLE. This is one of + * the constants defined in this class (tableNoNulls, + * tableNullable, or tableNullableUnknown) + *
  11. REMARKS - A description of the column. + *
  12. COLUMN_DEF - The default value for the column, may be null. + *
  13. SQL_DATA_TYPE - Unused + *
  14. SQL_DATETIME_SUB - Unused + *
  15. CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes + * in the column. + *
  16. ORDINAL_POSITION - The index of the column in the table. + *
  17. IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string + * means unknown. + *
+ * + * @param catalog The name of the catalog to return table from, + * or "" to return tables from all catalogs. + * @param schemaPattern A schema pattern for the schemas to return + * tables from, or "" to return tables from all schemas. + * @param namePattern The pattern of tables names to return. + * @param columnPattern The pattern of column names to return. + * @returns A ResultSet with all the requested tables. + * @exception SQLException If an error occurs. + */ + public ResultSet getColumns(String catalog, String schemaPattern, String + tableNamePattern, String columnNamePattern) throws SQLException; + + /** + * This method returns the access rights that have been granted to the + * requested columns. This information is returned as a ResultSet + * with the following columns: + *

+ *

    + *
  1. TABLE_CAT - The catalog the table is in, which may be + * null. + *
  2. TABLE_SCHEM - The schema the tables is in, which may be + * null. + *
  3. TABLE_NAME - The name of the table. + *
  4. COLUMN_NAME - The name of the column. + *
  5. GRANTOR - The entity that granted the access. + *
  6. GRANTEE - The entity granted the access. + *
  7. PRIVILEGE - The name of the privilege granted. + *
  8. IS_GRANTABLE - "YES" if the grantee can grant the privilege to + * others, "NO" if not, and null if unknown. + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @param columnPattern A pattern of column names to return information for. + * @return A ResultSet with all the requested privileges. + * @exception SQLException If an error occurs. + */ + public ResultSet getColumnPrivileges(String catalog, String schema, String + table, String columnNamePattern) throws SQLException; + + /** + * This method returns the access rights that have been granted to the + * requested tables. This information is returned as a ResultSet + * with the following columns: + *

+ *

    + *
  1. TABLE_CAT - The catalog the table is in, which may be + * null. + *
  2. TABLE_SCHEM - The schema the tables is in, which may be + * null. + *
  3. TABLE_NAME - The name of the table. + *
  4. GRANTOR - The entity that granted the access. + *
  5. GRANTEE - The entity granted the access. + *
  6. PRIVILEGE - The name of the privilege granted. + *
  7. IS_GRANTABLE - "YES" if the grantee can grant the privilege to + * others, "NO" if not, and null if unknown. + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param tablePattern The table name pattern of tables to return + * information for. + * @return A ResultSet with all the requested privileges. + * @exception SQLException If an error occurs. + */ + public ResultSet getTablePrivileges(String catalog, String schemaPattern, + String tableNamePattern) throws SQLException; + + /** + * This method returns the best set of columns for uniquely identifying + * a row. It returns this information as a ResultSet with + * the following columns: + *

+ *

    + *
  1. SCOPE - The scope of the results returned. This is one of the + * constants defined in this class (bestRowTemporary, + * bestRowTransaction, or bestRowSession). + *
  2. COLUMN_NAME - The name of the column. + *
  3. DATA_TYPE - The SQL type of the column. This is one of the constants + * defined in Types. + *
  4. TYPE_NAME - The string name of the data type for this column. + *
  5. COLUMN_SIZE - The precision of the columns + *
  6. BUFFER_LENGTH - Unused + *
  7. DECIMAL_DIGITS - The scale of the column. + *
  8. PSEUDO_COLUMN - Whether or not the best row identifier is a + * pseudo_column. This is one of the constants defined in this class + * (bestRowUnknown, bestRowNotPseudo, or + * bestRowPseudo). + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @param columnPattern A pattern of column names to return information for. + * @param scope One of the best row id scope constants from this class. + * @param nullable true to include columns that are nullable, + * false otherwise. + * @return A ResultSet with the best row identifier. + * @exception SQLException If an error occurs. + */ + public ResultSet getBestRowIdentifier(String catalog, String schema, + String table, int scope, boolean nullable) throws SQLException; + + /** + * This method returns the set of columns that are automatically updated + * when the row is update. It returns this information as a + * ResultSet with the following columns: + *

+ *

    + *
  1. SCOPE - Unused + *
  2. COLUMN_NAME - The name of the column. + *
  3. DATA_TYPE - The SQL type of the column. This is one of the constants + * defined in Types. + *
  4. TYPE_NAME - The string name of the data type for this column. + *
  5. COLUMN_SIZE - The precision of the columns + *
  6. BUFFER_LENGTH - Unused + *
  7. DECIMAL_DIGITS - The scale of the column. + *
  8. PSEUDO_COLUMN - Whether or not the best row identifier is a + * pseudo_column. This is one of the constants defined in this class + * (versionRowUnknown, versionRowNotPseudo, or + * versionRowPseudo). + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @param columnPattern A pattern of column names to return information for. + * @return A ResultSet with the version columns. + * @exception SQLException If an error occurs. + */ + public ResultSet getVersionColumns(String catalog, String schema, + String table) throws SQLException; + + /** + * This method returns a list of a table's primary key columns. These + * are returned as a ResultSet with the following columns. + *

+ *

    + *
  1. TABLE_CAT - The catalog of the table, which may be null. + *
  2. TABLE_SCHEM - The schema of the table, which may be null. + *
  3. TABLE_NAME - The name of the table. + *
  4. COLUMN_NAME - The name of the column. + *
  5. KEY_SEQ - The sequence number of the column within the primary key. + *
  6. PK_NAME - The name of the primary key, which may be null. + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @param columnPattern A pattern of column names to return information for. + * @return A ResultSet with the primary key columns. + * @exception SQLException If an error occurs. + */ + public ResultSet getPrimaryKeys(String catalog, String schema, String table) + throws SQLException; + + /** + * This method returns a list of the table's foreign keys. These are + * returned as a ResultSet with the following columns: + *

+ *

    + *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. + *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. + *
  3. PKTABLE_NAME - The name of the table the key was imported from. + *
  4. PKCOLUMN_NAME - The name of the column that was imported. + *
  5. FKTABLE_CAT - The foreign key catalog name. + *
  6. FKTABLE_SCHEM - The foreign key schema name. + *
  7. FKTABLE_NAME - The foreign key table name. + *
  8. FKCOLUMN_NAME - The foreign key column name. + *
  9. KEY_SEQ - The sequence number of the column within the foreign key. + *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is + * updated. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, importedKeySetDefault, or + * importedKeyRestrict). + *
  11. DELETE_RULE - How the foreign key behaves when the primary key is + * deleted. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, or importedKeySetDefault) + *
  12. FK_NAME - The name of the foreign key. + *
  13. PK_NAME - The name of the primary key. + *
  14. DEFERRABILITY - The deferrability value. This is one of the + * constants defined in this table (importedKeyInitiallyDeferred, + * importedKeyInitiallyImmediate, or + * importedKeyNotDeferrable). + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * + * @return A ResultSet with the foreign key columns. + * + * @exception SQLException If an error occurs. + */ + public ResultSet getImportedKeys(String catalog, String schema, + String table) throws SQLException; + + /** + * This method returns a list of the table's which use this table's + * primary key as a foreign key. The information is + * returned as a ResultSet with the following columns: + *

+ *

    + *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. + *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. + *
  3. PKTABLE_NAME - The name of the table the key was imported from. + *
  4. PKCOLUMN_NAME - The name of the column that was imported. + *
  5. FKTABLE_CAT - The foreign key catalog name. + *
  6. FKTABLE_SCHEM - The foreign key schema name. + *
  7. FKTABLE_NAME - The foreign key table name. + *
  8. FKCOLUMN_NAME - The foreign key column name. + *
  9. KEY_SEQ - The sequence number of the column within the foreign key. + *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is + * updated. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, importedKeySetDefault, or + * importedKeyRestrict). + *
  11. DELETE_RULE - How the foreign key behaves when the primary key is + * deleted. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, or importedKeySetDefault) + *
  12. FK_NAME - The name of the foreign key. + *
  13. PK_NAME - The name of the primary key. + *
  14. DEFERRABILITY - The deferrability value. This is one of the + * constants defined in this table (importedKeyInitiallyDeferred, + * importedKeyInitiallyImmediate, or + * importedKeyNotDeferrable). + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @return A ResultSet with the requested information + * @exception SQLException If an error occurs. + */ + public ResultSet getExportedKeys(String catalog, String schema, + String table) throws SQLException; + + /** + * This method returns a description of how one table imports another + * table's primary key as a foreign key. The information is + * returned as a ResultSet with the following columns: + *

+ *

    + *
  1. PKTABLE_CAT - The catalog of the table the key was imported from. + *
  2. PKTABLE_SCHEM - The schema of the table the key was imported from. + *
  3. PKTABLE_NAME - The name of the table the key was imported from. + *
  4. PKCOLUMN_NAME - The name of the column that was imported. + *
  5. FKTABLE_CAT - The foreign key catalog name. + *
  6. FKTABLE_SCHEM - The foreign key schema name. + *
  7. FKTABLE_NAME - The foreign key table name. + *
  8. FKCOLUMN_NAME - The foreign key column name. + *
  9. KEY_SEQ - The sequence number of the column within the foreign key. + *
  10. UPDATE_RULE - How the foreign key behaves when the primary key is + * updated. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, importedKeySetDefault, or + * importedKeyRestrict). + *
  11. DELETE_RULE - How the foreign key behaves when the primary key is + * deleted. This is one of the constants defined in this class + * (importedNoAction, importedKeyCascade, + * importedKeySetNull, or importedKeySetDefault) + *
  12. FK_NAME - The name of the foreign key. + *
  13. PK_NAME - The name of the primary key. + *
  14. DEFERRABILITY - The deferrability value. This is one of the + * constants defined in this table (importedKeyInitiallyDeferred, + * importedKeyInitiallyImmediate, or + * importedKeyNotDeferrable). + *
+ * + * @param primCatalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs, on the exporting side. + * @param primSchema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema, on the exporting side. + * @param primTable The table name to return information for, on the exporting + * side. + * @param forCatalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs, on the importing side. + * @param forSchema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema on the importing side. + * @param forTable The table name to return information for on the importing + * side. + * @return A ResultSet with the requested information + * @exception SQLException If an error occurs. + */ + public ResultSet getCrossReference(String primaryCatalog, String + primarySchema, String primaryTable, String foreignCatalog, String + foreignSchema, String foreignTable) throws SQLException; + + /** + * This method returns a list of the SQL types supported by this + * database. The information is returned as a ResultSet + * with the following columns: + *

+ *

    + *
  1. TYPE_NAME - The name of the data type. + *
  2. DATA_TYPE - A data type constant from Types for this + * type. + *
  3. PRECISION - The maximum precision of this type. + *
  4. LITERAL_PREFIX - Prefix value used to quote a literal, which may be + * null. + *
  5. LITERAL_SUFFIX - Suffix value used to quote a literal, which may be + * null. + *
  6. CREATE_PARAMS - The parameters used to create the type, which may be + * null. + *
  7. NULLABLE - Whether or not this type supports NULL values. This will + * be one of the constants defined in this interface + * (typeNoNulls, typeNullable, or + * typeNullableUnknown). + *
  8. CASE_SENSITIVE - Whether or not the value is case sensitive. + *
  9. SEARCHABLE - Whether or not "LIKE" expressions are supported in + * WHERE clauses for this type. This will be one of the constants defined + * in this interface (typePredNone, typePredChar, + * typePredBasic, or typeSearchable). + *
  10. UNSIGNED_ATTRIBUTE - Is the value of this type unsigned. + *
  11. FIXED_PREC_SCALE - Whether or not this type can be used for money. + *
  12. AUTO_INCREMENT - Whether or not this type supports auto-incrementing. + *
  13. LOCAL_TYPE_NAME - A localized name for this data type. + *
  14. MINIMUM_SCALE - The minimum scale supported by this type. + *
  15. MAXIMUM_SCALE - The maximum scale supported by this type. + *
  16. SQL_DATA_TYPE - Unused. + *
  17. SQL_DATETIME_SUB - Unused. + *
  18. NUM_PREC_RADIX - The radix of this data type. + *
+ * + * @return A ResultSet with the list of available data types. + * @exception SQLException If an error occurs. + */ + public ResultSet getTypeInfo() throws SQLException; + + /** + * This method returns information about a tables indices and statistics. + * It is returned as a ResultSet with the following columns: + *

+ *

    + *
  1. TABLE_CAT - The catalog of the table, which may be null. + *
  2. TABLE_SCHEM - The schema of the table, which may be null. + *
  3. TABLE_NAME - The name of the table. + *
  4. NON_UNIQUE - Are index values non-unique? + *
  5. INDEX_QUALIFIER The index catalog, which may be null + *
  6. INDEX_NAME - The name of the index. + *
  7. TYPE - The type of index, which will be one of the constants defined + * in this interface (tableIndexStatistic, + * tableIndexClustered, tableIndexHashed, or + * tableIndexOther). + *
  8. ORDINAL_POSITION - The sequence number of this column in the index. + * This will be 0 when the index type is tableIndexStatistic. + *
  9. COLUMN_NAME - The name of this column in the index. + *
  10. ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a + * descending sort sequence or null if a sort sequence is not + * supported. + *
  11. CARDINALITY - The number of unique rows in the index, or the number + * of rows in the table if the index type is tableIndexStatistic. + *
  12. PAGES - The number of pages used for the index, or the number of pages + * in the table if the index type is tableIndexStatistic. + *
  13. FILTER_CONDITION - The filter condition for this index, which may be + * null. + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or + * null to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param table The table name to return information for. + * @param unique true to return only unique indexes, + * false otherwise. + * @param approx true if data values can be approximations, + * false otherwise. + * @return A ResultSet with the requested index information + * @exception SQLException If an error occurs. + */ + public ResultSet getIndexInfo(String catalog, String schema, String table, + boolean unique, boolean approximate) throws SQLException; + + /** + * This method tests whether or not the datbase supports the specified + * result type. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * + * @return true if the result set type is supported, + * false otherwise. + * + * @exception SQLException If an error occurs. + * + * @see ResultSet + */ + public boolean supportsResultSetType(int type) throws SQLException; + + /** + * This method tests whether the specified result set type and result set + * concurrency type are supported by the database. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @param concur The desired concurrency type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type is supported, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean supportsResultSetConcurrency(int type, int concurrency) + throws SQLException; + + /** + * This method tests whether or not the specified result set type sees its + * own updates. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees its own updates, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean ownUpdatesAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type sees its + * own deletes. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees its own deletes, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean ownDeletesAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type sees its + * own inserts. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees its own inserts, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean ownInsertsAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type sees + * updates committed by others. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees other updates, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean othersUpdatesAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type sees + * deletes committed by others. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees other deletes, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean othersDeletesAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type sees + * inserts committed by others. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type sees other inserts, + * false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean othersInsertsAreVisible(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type can detect + * a visible update by calling the rowUpdated method. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type can detect visible updates + * using rowUpdated, false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean updatesAreDetected(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type can detect + * a visible delete by calling the rowUpdated method. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type can detect visible deletes + * using rowUpdated, false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean deletesAreDetected(int type) throws SQLException; + + /** + * This method tests whether or not the specified result set type can detect + * a visible insert by calling the rowUpdated method. + * + * @param type The desired result type, which is one of the constants + * defined in ResultSet. + * @return true if the result set type can detect visible inserts + * using rowUpdated, false otherwise. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public boolean insertsAreDetected(int type) throws SQLException; + + /** + * This method tests whether or not the database supports batch updates. + * + * @return true if batch updates are supported, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean supportsBatchUpdates() throws SQLException; + + /** + * This method returns the list of user defined data types in use. These + * are returned as a ResultSet with the following columns: + *

+ *

    + *
  1. TYPE_CAT - The catalog name, which may be null. + *
  2. TYPE_SCEHM - The schema name, which may be null. + *
  3. TYPE_NAME - The user defined data type name. + *
  4. CLASS_NAME - The Java class name this type maps to. + *
  5. DATA_TYPE - A type identifier from Types for this type. + * This will be one of JAVA_OBJECT, STRUCT, or + * DISTINCT. + *
  6. REMARKS - Comments about this data type. + *
+ * + * @param catalog The catalog to retrieve information from, or the empty string + * to return entities not associated with a catalog, or null + * to return information from all catalogs. + * @param schema The schema to retrieve information from, or the empty string + * to return entities not associated with a schema. + * @param typePattern The type name pattern to match. + * @param types The type identifier patterns (from Types) to + * match. + * @return A ResultSet with the requested type information + * @exception SQLException If an error occurs. + */ + public ResultSet getUDTs(String catalog, String schemaPattern, String + typeNamePattern, int[] types) throws SQLException; + + /** + * This method returns the Connection object that was used + * to generate the metadata in this object. + * + * @return The connection for this object. + * @exception SQLException If an error occurs. + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsSavepoints() throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsNamedParameters() throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsMultipleOpenResults() throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsGetGeneratedKeys() throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getSuperTypes(String catalog, String schemaPattern, + String typeNamePattern) throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getSuperTables(String catalog, String schemaPattern, + String tableNamePattern) throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getAttributes(String catalog, String schemaPattern, String + typeNamePattern, String attributeNamePattern) throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsResultSetHoldability(int holdability) + throws SQLException; + + /** + * @since 1.4 + */ + public int getResultSetHoldability() throws SQLException; + + /** + * @since 1.4 + */ + public int getDatabaseMajorVersion() throws SQLException; + + /** + * @since 1.4 + */ + public int getDatabaseMinorVersion() throws SQLException; + + /** + * @since 1.4 + */ + public int getJDBCMajorVersion() throws SQLException; + + /** + * @since 1.4 + */ + public int getJDBCMinorVersion() throws SQLException; + + /** + * @since 1.4 + */ + public int getSQLStateType() throws SQLException; + + /** + * @since 1.4 + */ + public boolean locatorsUpdateCopy() throws SQLException; + + /** + * @since 1.4 + */ + public boolean supportsStatementPooling() throws SQLException; +} diff --git a/libjava/java/sql/Date.java b/libjava/java/sql/Date.java index 789ff0a727d..59c8f1a3fc3 100644 --- a/libjava/java/sql/Date.java +++ b/libjava/java/sql/Date.java @@ -35,7 +35,6 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.text.SimpleDateFormat; @@ -46,104 +45,69 @@ import java.text.SimpleDateFormat; * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public class Date extends java.util.Date -{ - -/* - * Class Variables - */ - -/** - * Used for parsing and formatting this date. - */ -private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - -/** - * This is the serialization UID for this class. - */ -private static final long serialVersionUID = 1511598038487230103L; - -/*************************************************************************/ - -/* - * Class Methods - */ - -/** - * This method returns a new instance of this class by parsing a - * date in JDBC format into a Java date. - * - * @param str The string to parse. - * - * @return The resulting java.sql.Date value. - */ -public static Date -valueOf(String str) -{ - try - { - java.util.Date d = (java.util.Date)sdf.parseObject(str); - return(new Date(d.getTime())); - } - catch(Exception e) - { - return(null); - } -} - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of this class with the - * specified year, month, and day. - * - * @param year The year of this date minue 1900. - * @param month The month of this date (0-11). - * @param day The day of this date (1-31). - * - * @deprecated - */ -public -Date(int year, int month, int day) -{ - super(year, month, day); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of this class with the - * specified time value representing the number of seconds since - * Jan 1, 1970 at 12:00 midnight GMT. - * - * @param time The time value to intialize this date to. - */ -public -Date(long date) +public class Date extends java.util.Date { - super(date); + static final long serialVersionUID = 1511598038487230103L; + + /** + * Used for parsing and formatting this date. + */ + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + /** + * This method initializes a new instance of this class with the + * specified year, month, and day. + * + * @param year The year of this date minue 1900. + * @param month The month of this date (0-11). + * @param day The day of this date (1-31). + * + * @deprecated + */ + public Date(int year, int month, int day) + { + super(year, month, day); + } + + /** + * This method initializes a new instance of this class with the + * specified time value representing the number of seconds since + * Jan 1, 1970 at 12:00 midnight GMT. + * + * @param time The time value to intialize this date to. + */ + public Date(long date) + { + super(date); + } + + /** + * This method returns a new instance of this class by parsing a + * date in JDBC format into a Java date. + * + * @param str The string to parse. + * @return The resulting java.sql.Date value. + */ + public static Date valueOf(String str) + { + try + { + java.util.Date d = (java.util.Date) sdf.parseObject(str); + return(new Date(d.getTime())); + } + catch(Exception e) + { + return(null); + } + } + + /** + * This method returns this date in JDBC format. + * + * @return This date as a string. + */ + public String toString() + { + return(sdf.format(this)); + } } - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns this date in JDBC format. - * - * @return This date as a string. - */ -public String -toString() -{ - return(sdf.format(this)); -} - -} // class Date - diff --git a/libjava/java/sql/Driver.java b/libjava/java/sql/Driver.java index 874222174c7..5e5731d1839 100644 --- a/libjava/java/sql/Driver.java +++ b/libjava/java/sql/Driver.java @@ -35,7 +35,6 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.util.Properties; @@ -54,95 +53,71 @@ import java.util.Properties; * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public interface Driver +public interface Driver { - -/** - * This method returns the major version number of the driver. - * - * @return The major version number of the driver. - */ -public abstract int -getMajorVersion(); - -/*************************************************************************/ - -/** - * This method returns the minor version number of the driver. - * - * @return The minor version number of the driver. - */ -public abstract int -getMinorVersion(); - -/*************************************************************************/ - -/** - * This method tests whether or not the driver is JDBC compliant. This - * method should only return true if the driver has been - * certified as JDBC compliant. - * - * @return true if the driver has been certified JDBC compliant, - * false otherwise. - */ -public abstract boolean -jdbcCompliant(); - -/*************************************************************************/ - -/** - * This method returns an array of possible properties that could be - * used to connect to the specified database. - * - * @param url The URL string of the database to connect to. - * @param properties The list of properties the caller is planning to use - * to connect to the database. - * - * @return A list of possible additional properties for a connection to this - * database. This list may be empty. - * - * @exception SQLException If an error occurs. - */ -public abstract DriverPropertyInfo[] -getPropertyInfo(String url, Properties properties) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the driver believes it can connect to - * the specified database. The driver should only test whether it - * understands and accepts the URL. It should not necessarily attempt to - * probe the database for a connection. - * - * @param The database URL string. - * - * @return true if the drivers can connect to the database, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -acceptsURL(String url) throws SQLException; - -/*************************************************************************/ - -/** - * This method connects to the specified database using the connection - * properties supplied. If the driver does not understand the database - * URL, it should return null instead of throwing an - * exception since the DriverManager will probe a driver - * in this manner. - * - * @param url The URL string for this connection. - * @param properties The list of database connection properties. - * - * @return A Connection object for the newly established - * connection, or null if the URL is not understood. - * - * @exception SQLException If an error occurs. - */ -public abstract Connection -connect(String url, Properties properties) throws SQLException; - -} // interface Driver - + /** + * This method connects to the specified database using the connection + * properties supplied. If the driver does not understand the database + * URL, it should return null instead of throwing an + * exception since the DriverManager will probe a driver + * in this manner. + * + * @param url The URL string for this connection. + * @param properties The list of database connection properties. + * @return A Connection object for the newly established + * connection, or null if the URL is not understood. + * @exception SQLException If an error occurs. + */ + public Connection connect(String url, Properties info) throws SQLException; + + /** + * This method tests whether or not the driver believes it can connect to + * the specified database. The driver should only test whether it + * understands and accepts the URL. It should not necessarily attempt to + * probe the database for a connection. + * + * @param The database URL string. + * @return true if the drivers can connect to the database, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean acceptsURL(String url) throws SQLException; + + /** + * This method returns an array of possible properties that could be + * used to connect to the specified database. + * + * @param url The URL string of the database to connect to. + * @param properties The list of properties the caller is planning to use + * to connect to the database. + * @return A list of possible additional properties for a connection to this + * database. This list may be empty. + * @exception SQLException If an error occurs. + */ + public DriverPropertyInfo[] getPropertyInfo(String url, Properties properties) + throws SQLException; + + /** + * This method returns the major version number of the driver. + * + * @return The major version number of the driver. + */ + public int getMajorVersion(); + + /** + * This method returns the minor version number of the driver. + * + * @return The minor version number of the driver. + */ + public int getMinorVersion(); + + /** + * This method tests whether or not the driver is JDBC compliant. This + * method should only return true if the driver has been + * certified as JDBC compliant. + * + * @return true if the driver has been certified JDBC compliant, + * false otherwise. + */ + public boolean jdbcCompliant(); +} diff --git a/libjava/java/sql/DriverManager.java b/libjava/java/sql/DriverManager.java index af6ef12324a..229450ad057 100644 --- a/libjava/java/sql/DriverManager.java +++ b/libjava/java/sql/DriverManager.java @@ -35,15 +35,14 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.PrintStream; import java.io.PrintWriter; import java.util.Enumeration; import java.util.Properties; -import java.util.StringTokenizer; import java.util.Vector; +import java.util.StringTokenizer; /** * This class manages the JDBC drivers in the system. It maintains a @@ -65,341 +64,280 @@ import java.util.Vector; */ public class DriverManager { - -/* - * Class Variables - */ - -/** - * This is the log stream for JDBC drivers. - */ -private static PrintStream log_stream; - -/** - * This is the log writer for JDBC drivers. - */ -private static PrintWriter log_writer; - -/** - * This is the login timeout used by JDBC drivers. - */ -private static int login_timeout; - -/** - * This is the list of JDBC drivers that are loaded. - */ -private static Vector drivers; - // Hmm, seems like we might want to do a Hashtable and lookup by something, - // but what would it be? - -// Load all drivers on startup -static -{ - drivers = new Vector(); - - String driver_string = System.getProperty("jdbc.drivers"); - if (driver_string != null) - { - StringTokenizer st = new StringTokenizer(driver_string); - while (st.hasMoreTokens()) - { - String driver_classname = st.nextToken(); - - try - { - Class.forName(driver_classname); // The driver registers itself - } - catch (Exception e) { ; } // Ignore not founds - } - } - -} + /** + * This is the log stream for JDBC drivers. + */ + private static PrintStream log_stream; + + /** + * This is the log writer for JDBC drivers. + */ + private static PrintWriter log_writer; + + /** + * This is the login timeout used by JDBC drivers. + */ + private static int login_timeout; + + /** + * This is the list of JDBC drivers that are loaded. + */ + private static Vector drivers; + // Hmm, seems like we might want to do a Hashtable and lookup by something, + // but what would it be? + + // Load all drivers on startup + static + { + drivers = new Vector(); + + String driver_string = System.getProperty("jdbc.drivers"); + if (driver_string != null) + { + StringTokenizer st = new StringTokenizer(driver_string); + while (st.hasMoreTokens()) + { + String driver_classname = st.nextToken(); + + try + { + Class.forName(driver_classname); // The driver registers itself + } + catch (Exception e) { ; } // Ignore not founds + } + } + + } + + /** Can't be instantiated. */ + private DriverManager() + { + } + + /** + * This method returns the log writer being used by all JDBC drivers. + * This method should be used in place of the deprecated + * getLogStream method. + * + * @return The log writer in use by JDBC drivers. + */ + public static PrintWriter getLogWriter() + { + return log_writer; + } -/*************************************************************************/ - -/* - * Class Methods - */ - -/** - * This method returns the login timeout in use by JDBC drivers systemwide. - * - * @return The login timeout. - */ -public static int -getLoginTimeout() -{ - return(login_timeout); -} - -/*************************************************************************/ - -/** - * This method set the login timeout used by JDBC drivers. This is a - * system-wide parameter that applies to all drivers. - * - * @param login_timeout The new login timeout value. - */ -public static void -setLoginTimeout(int login_timeout) -{ - DriverManager.login_timeout = login_timeout; -} - -/*************************************************************************/ - -/** - * This method returns the log writer being used by all JDBC drivers. - * This method should be used in place of the deprecated - * getLogStream method. - * - * @return The log writer in use by JDBC drivers. - */ -public static PrintWriter -getLogWriter() -{ - return(log_writer); -} - -/*************************************************************************/ - -/** - * This method sets the log writer being used by JDBC drivers. This is a - * system-wide parameter that affects all drivers. Note that since there - * is no way to retrieve a PrintStream from a - * PrintWriter, this method cannot set the log stream in - * use by JDBC. Thus any older drivers may not see this setting. - * - * @param log_writer The new log writer for JDBC. - */ -public static void -setLogWriter(PrintWriter log_writer) -{ - DriverManager.log_writer = log_writer; -} - -/*************************************************************************/ - -/** - * This method returns the log stream in use by JDBC. - * - * @return The log stream in use by JDBC. - * - * @deprecated Use getLogWriter() instead. - */ -public static PrintStream -getLogStream() -{ - return(log_stream); -} - -/*************************************************************************/ - -/** - * This method sets the log stream in use by JDBC. - * - * @param log_stream The log stream in use by JDBC. - * - * @deprecated Use setLogWriter instead. - */ -public static void -setLogStream(PrintStream log_stream) -{ - DriverManager.log_stream = log_stream; -} - -/*************************************************************************/ - -/** - * This method prints the specified line to the log stream. - * - * @param str The string to write to the log stream. - */ -public static void -println(String str) -{ - if (log_stream != null) // Watch for user not using logging - log_stream.println(str); -} - -/*************************************************************************/ - -/** - * This method registers a new driver with the manager. This is normally - * called by the driver itself in a static initializer. - * - * @param driver The new Driver to add. - * - * @exception SQLException If an error occurs. - */ -public static void -registerDriver(Driver driver) throws SQLException -{ - if (!drivers.contains(driver)) - drivers.addElement(driver); -} - -/*************************************************************************/ - -/** - * This method de-registers a driver from the manager. - * - * @param driver The Driver to unregister. - * - * @exception SQLException If an error occurs. - */ -public static void -deregisterDriver(Driver driver) throws SQLException -{ - if (drivers.contains(driver)) - drivers.removeElement(driver); -} - -/*************************************************************************/ - -/** - * This method returns a list of all the currently registered JDBC drivers - * that were loaded by the current ClassLoader. - * - * @return An Enumeration of all currently loaded JDBC drivers. - */ -public static Enumeration -getDrivers() -{ - Vector v = new Vector(); - Enumeration e = drivers.elements(); - - // Is this right? - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - - while(e.hasMoreElements()) - { - Object obj = e.nextElement(); - - ClassLoader loader = obj.getClass().getClassLoader(); - - if (loader == null) - loader = ClassLoader.getSystemClassLoader(); - if (!loader.equals(cl)) - continue; - - v.addElement(obj); - } - - return(v.elements()); -} - -/*************************************************************************/ - -/** - * This method returns a driver that can connect to the specified - * JDBC URL string. This will be selected from among drivers loaded - * at initialization time and those drivers manually loaded by the - * same class loader as the caller. - * - * @param url The JDBC URL string to find a driver for. - * - * @return A Driver that can connect to the specified - * URL, or null if a suitable driver cannot be found. - * - * @exception SQLException If an error occurs. - */ -public static Driver -getDriver(String url) throws SQLException -{ - // FIXME: Limit driver search to the appropriate subset of loaded drivers. - - Enumeration e = drivers.elements(); - while(e.hasMoreElements()) - { - Driver d = (Driver)e.nextElement(); - if (d.acceptsURL(url)) - return(d); - } - - return(null); -} - -/*************************************************************************/ + /** + * This method sets the log writer being used by JDBC drivers. This is a + * system-wide parameter that affects all drivers. Note that since there + * is no way to retrieve a PrintStream from a + * PrintWriter, this method cannot set the log stream in + * use by JDBC. Thus any older drivers may not see this setting. + * + * @param out The new log writer for JDBC. + */ + public static void setLogWriter(PrintWriter out) + { + DriverManager.log_writer = out; + } /** * This method attempts to return a connection to the specified - * JDBC URL string. - * - * @param url The JDBC URL string to connect to. - * - * @return A Connection to that URL. - * - * @exception SQLException If an error occurs. - */ -public static Connection -getConnection(String url) throws SQLException -{ - return(getConnection(url, new Properties())); -} - -/*************************************************************************/ - -/** - * This method attempts to return a connection to the specified - * JDBC URL string using the specified username and password. + * JDBC URL string using the specified connection properties. * * @param url The JDBC URL string to connect to. - * @param user The username to connect with. - * @param password The password to connect with. + * @param properties The connection properties. * * @return A Connection to that URL. * * @exception SQLException If an error occurs. */ -public static Connection -getConnection(String url, String user, String password) throws SQLException -{ - Properties p = new Properties(); - - if (user != null) - p.setProperty("user", user); - if (password != null) - p.setProperty("password", password); - - return(getConnection(url, p)); -} - -/*************************************************************************/ + public static Connection getConnection(String url, Properties properties) + throws SQLException + { + Driver d = getDriver(url); + if (d == null) + throw new SQLException("Driver not found for URL: " + url); + + return d.connect(url, properties); + } + + + /** + * This method attempts to return a connection to the specified + * JDBC URL string using the specified username and password. + * + * @param url The JDBC URL string to connect to. + * @param user The username to connect with. + * @param password The password to connect with. + * @return A Connection to that URL. + * @exception SQLException If an error occurs. + */ + public static Connection getConnection(String url, String user, + String password) throws SQLException + { + Properties p = new Properties(); + + if (user != null) + p.setProperty("user", user); + if (password != null) + p.setProperty("password", password); + + return getConnection(url, p); + } + + /** + * This method attempts to return a connection to the specified + * JDBC URL string. + * + * @param url The JDBC URL string to connect to. + * + * @return A Connection to that URL. + * + * @exception SQLException If an error occurs. + */ + public static Connection getConnection(String url) throws SQLException + { + return getConnection(url, new Properties()); + } + + /** + * This method returns a driver that can connect to the specified + * JDBC URL string. This will be selected from among drivers loaded + * at initialization time and those drivers manually loaded by the + * same class loader as the caller. + * + * @param url The JDBC URL string to find a driver for. + * + * @return A Driver that can connect to the specified + * URL, or null if a suitable driver cannot be found. + * + * @exception SQLException If an error occurs. + */ + public static Driver getDriver(String url) throws SQLException + { + // FIXME: Limit driver search to the appropriate subset of loaded drivers. + Enumeration e = drivers.elements(); + while(e.hasMoreElements()) + { + Driver d = (Driver)e.nextElement(); + if (d.acceptsURL(url)) + return d; + } + + return null; + } + + /** + * This method registers a new driver with the manager. This is normally + * called by the driver itself in a static initializer. + * + * @param driver The new Driver to add. + * + * @exception SQLException If an error occurs. + */ + public static void registerDriver(Driver driver) throws SQLException + { + if (! drivers.contains(driver)) + drivers.addElement(driver); + } /** - * This method attempts to return a connection to the specified - * JDBC URL string using the specified connection properties. - * - * @param url The JDBC URL string to connect to. - * @param properties The connection properties. + * This method de-registers a driver from the manager. * - * @return A Connection to that URL. + * @param driver The Driver to unregister. * * @exception SQLException If an error occurs. */ -public static Connection -getConnection(String url, Properties properties) throws SQLException -{ - Driver d = getDriver(url); - if (d == null) - throw new SQLException("Driver not found for URL: " + url); - - return(d.connect(url, properties)); + public static void deregisterDriver(Driver driver) throws SQLException + { + if (drivers.contains(driver)) + drivers.removeElement(driver); + } + + /** + * This method returns a list of all the currently registered JDBC drivers + * that were loaded by the current ClassLoader. + * + * @return An Enumeration of all currently loaded JDBC drivers. + */ + public static Enumeration getDrivers() + { + Vector v = new Vector(); + Enumeration e = drivers.elements(); + + // Is this right? + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + + while(e.hasMoreElements()) + { + Object obj = e.nextElement(); + + ClassLoader loader = obj.getClass().getClassLoader(); + + if (loader == null) + loader = ClassLoader.getSystemClassLoader(); + if (! loader.equals(cl)) + continue; + + v.addElement(obj); + } + + return v.elements(); + } + + /** + * This method set the login timeout used by JDBC drivers. This is a + * system-wide parameter that applies to all drivers. + * + * @param login_timeout The new login timeout value. + */ + public static void setLoginTimeout(int seconds) + { + DriverManager.login_timeout = login_timeout; + } + + /** + * This method returns the login timeout in use by JDBC drivers systemwide. + * + * @return The login timeout. + */ + public static int getLoginTimeout() + { + return login_timeout; + } + + /** + * This method sets the log stream in use by JDBC. + * + * @param log_stream The log stream in use by JDBC. + * + * @deprecated Use setLogWriter instead. + */ + public static void setLogStream(PrintStream out) + { + DriverManager.log_stream = log_stream; + } + + /** + * This method returns the log stream in use by JDBC. + * + * @return The log stream in use by JDBC. + * + * @deprecated Use getLogWriter() instead. + */ + public static PrintStream getLogStream() + { + return log_stream; + } + + /** + * This method prints the specified line to the log stream. + * + * @param str The string to write to the log stream. + */ + public static void println(String message) + { + if (log_stream != null) // Watch for user not using logging + log_stream.println(message); + } } - -/*************************************************************************/ - -/* - * Constructors - */ - -// Keep bozos from trying to instantiate us. -private -DriverManager() -{ - ; -} - -} // class DriverManager - diff --git a/libjava/java/sql/DriverPropertyInfo.java b/libjava/java/sql/DriverPropertyInfo.java index a60ccecc2ce..12382e33b7e 100644 --- a/libjava/java/sql/DriverPropertyInfo.java +++ b/libjava/java/sql/DriverPropertyInfo.java @@ -39,64 +39,50 @@ exception statement from your version. */ package java.sql; /** - * This class holds a driver property that can be used for querying or - * setting driver configuration parameters. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class DriverPropertyInfo -{ - -/* - * Instance Variables + * This class holds a driver property that can be used for querying or + * setting driver configuration parameters. + * + * @author Aaron M. Renn (arenn@urbanophile.com) */ - -/** - * The name of the property. - */ -public String name; - -/** - * This is the value of the property. - */ -public String value; - -/** - * A description of the property, possibly null. - */ -public String description; - -/** - * A flag indicating whether or not a value for this property is required - * in order to connect to the database. - */ -public boolean required; - -/** - * If values are restricted to certain choices, this is the list of valid - * ones. Otherwise it is null. - */ -public String[] choices; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of DriverPropertyInfo - * with the specified name and value. All other fields are defaulted. - * - * @param name The name of the property. - * @param value The value to assign to the property. - */ -public -DriverPropertyInfo(String name, String value) +public class DriverPropertyInfo { - this.name = name; - this.value = value; + /** + * The name of the property. + */ + public String name; + + /** + * A description of the property, possibly null. + */ + public String description; + + /** + * A flag indicating whether or not a value for this property is required + * in order to connect to the database. + */ + public boolean required; + + /** + * This is the value of the property. + */ + public String value; + + /** + * If values are restricted to certain choices, this is the list of valid + * ones. Otherwise it is null. + */ + public String[] choices; + + /** + * This method initializes a new instance of DriverPropertyInfo + * with the specified name and value. All other fields are defaulted. + * + * @param name The name of the property. + * @param value The value to assign to the property. + */ + public DriverPropertyInfo(String name, String value) + { + this.name = name; + this.value = value; + } } - -} // DriverPropertyInfo - diff --git a/libjava/java/sql/ParameterMetaData.java b/libjava/java/sql/ParameterMetaData.java new file mode 100644 index 00000000000..a84bbd4c93d --- /dev/null +++ b/libjava/java/sql/ParameterMetaData.java @@ -0,0 +1,103 @@ +/* ParameterMetaData.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.sql; + +/** + * @since 1.4 + */ +public interface ParameterMetaData +{ + public static final int parameterNoNulls = 0; + + public static final int parameterNullable = 1; + + public static final int parameterNullableUnknown = 2; + + public static final int parameterModeUnknown = 0; + + public static final int parameterModeIn = 1; + + public static final int parameterModeInOut = 2; + + public static final int parameterModeOut = 4; + + /** + * @since 1.4 + */ + public int getParameterCount() throws SQLException; + + /** + * @since 1.4 + */ + public int isNullable(int param) throws SQLException; + + /** + * @since 1.4 + */ + public boolean isSigned(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getPrecision(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getScale(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getParameterType(int param) throws SQLException; + + /** + * @since 1.4 + */ + public String getParameterTypeName(int param) throws SQLException; + + /** + * @since 1.4 + */ + public String getParameterClassName(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getParameterMode(int param) throws SQLException; +} diff --git a/libjava/java/sql/PreparedStatement.java b/libjava/java/sql/PreparedStatement.java index 6f98fbe3063..3507886a6be 100644 --- a/libjava/java/sql/PreparedStatement.java +++ b/libjava/java/sql/PreparedStatement.java @@ -35,523 +35,404 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.net.URL; import java.util.Calendar; /** - * This interface provides a mechanism for executing pre-compiled - * statements. This provides greater efficiency when calling the same - * statement multiple times. Parameters are allowed in a statement, - * providings for maximum reusability. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface PreparedStatement extends Statement + * This interface provides a mechanism for executing pre-compiled + * statements. This provides greater efficiency when calling the same + * statement multiple times. Parameters are allowed in a statement, + * providings for maximum reusability. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface PreparedStatement extends Statement { - -/** - * This method populates the specified parameter with a SQL NULL value - * for the specified type. - * - * @param index The index of the parameter to set. - * @param type The SQL type identifier of the parameter from Types - * - * @exception SQLException If an error occurs. - */ -public abstract void -setNull(int index, int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method populates the specified parameter with a SQL NULL value - * for the specified type. - * - * @param index The index of the parameter to set. - * @param type The SQL type identifier of the parameter from Types - * @param name The name of the data type, for user defined types. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setNull(int index, int type, String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * boolean value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setBoolean(int index, boolean value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * byte value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setByte(int index, byte value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * short value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setShort(int index, short value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * int value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setInt(int index, int value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * long value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setLong(int index, long value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * float value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setFloat(int index, float value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * double value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setDouble(int index, double value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * String value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setString(int index, String value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * byte array value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setBytes(int index, byte[] value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.math.BigDecimal value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setBigDecimal(int index, java.math.BigDecimal value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Date value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setDate(int index, java.sql.Date value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Date value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param calendar The Calendar to use for timezone and locale. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setDate(int index, java.sql.Date value, Calendar calendar) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Time value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTime(int index, java.sql.Time value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Time value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param calendar The Calendar to use for timezone and locale. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTime(int index, java.sql.Time value, Calendar calendar) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Timestamp value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTimestamp(int index, java.sql.Timestamp value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * java.sql.Timestamp value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param calendar The Calendar to use for timezone and locale. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setTimestamp(int index, java.sql.Timestamp value, Calendar calendar) - throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * ASCII InputStream value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param length The number of bytes in the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setAsciiStream(int index, InputStream value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Unicode UTF-8 InputStream value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param length The number of bytes in the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setUnicodeStream(int index, InputStream value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * binary InputStream value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param length The number of bytes in the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setBinaryStream(int index, InputStream value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * character Reader value. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param length The number of bytes in the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setCharacterStream(int index, Reader value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Ref value. The default object type to SQL type mapping - * will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setRef(int index, Ref value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Blob value. The default object type to SQL type mapping - * will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setBlob(int index, Blob value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Clob value. The default object type to SQL type mapping - * will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setClob(int index, Clob value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Array value. The default object type to SQL type mapping - * will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setArray(int index, Array value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Object value. The default object type to SQL type mapping - * will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setObject(int index, Object value) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Object value. The specified SQL object type will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param type The SQL type to use for the parameter, from Types - * - * @exception SQLException If an error occurs. - * - * @see Types - */ -public abstract void -setObject(int index, Object value, int type) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the specified parameter from the given Java - * Object value. The specified SQL object type will be used. - * - * @param index The index of the parameter value to set. - * @param value The value of the parameter. - * @param type The SQL type to use for the parameter, from Types - * @param scale The scale of the value, for numeric values only. - * - * @exception SQLException If an error occurs. - * - * @see Types - */ -public abstract void -setObject(int index, Object value, int type, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method adds a set of parameters to the batch for JDBC 2.0. - * - * @exception SQLException If an error occurs. - */ -public abstract void -addBatch() throws SQLException; - -/*************************************************************************/ - -/** - * This method clears all of the input parameter that have been - * set on this statement. - * - * @exception SQLException If an error occurs. - */ -public abstract void -clearParameters() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns meta data for the result set from this statement. - * - * @return Meta data for the result set from this statement. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSetMetaData -getMetaData() throws SQLException; - -/*************************************************************************/ - -/** - * This method executes a prepared SQL query. - * Some prepared statements return multiple results; the execute method - * handles these complex statements as well as the simpler form of - * statements handled by executeQuery and executeUpdate. - * - * @return The result of the SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -execute() throws SQLException; - -/*************************************************************************/ - -/** - * This method executes a prepared SQL query and returns its ResultSet. - * - * @return The ResultSet of the SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -executeQuery() throws SQLException; - -/*************************************************************************/ - -/** - * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL - * statements that return nothing such as SQL DDL statements can be executed. - * - * @return The result is either the row count for INSERT, UPDATE or DELETE - * statements; or 0 for SQL statements that return nothing. - * - * @exception SQLException If an error occurs. - */ -public abstract int -executeUpdate() throws SQLException; - -} // interface PreparedStatement - + /** + * This method executes a prepared SQL query and returns its ResultSet. + * + * @return The ResultSet of the SQL statement. + * @exception SQLException If an error occurs. + */ + public ResultSet executeQuery() throws SQLException; + + /** + * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL + * statements that return nothing such as SQL DDL statements can be executed. + * + * @return The result is either the row count for INSERT, UPDATE or DELETE + * statements; or 0 for SQL statements that return nothing. + * @exception SQLException If an error occurs. + */ + public int executeUpdate() throws SQLException; + + /** + * This method populates the specified parameter with a SQL NULL value + * for the specified type. + * + * @param index The index of the parameter to set. + * @param type The SQL type identifier of the parameter from Types + * + * @exception SQLException If an error occurs. + */ + public void setNull(int parameterIndex, int sqlType) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * boolean value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setBoolean(int parameterIndex, boolean x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * byte value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setByte(int parameterIndex, byte x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * short value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setShort(int parameterIndex, short x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * int value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setInt(int parameterIndex, int x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * long value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setLong(int parameterIndex, long x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * float value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setFloat(int parameterIndex, float x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * double value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setDouble(int parameterIndex, double x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.math.BigDecimal value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setBigDecimal(int parameterIndex, BigDecimal x) throws + SQLException; + + /** + * This method sets the specified parameter from the given Java + * String value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setString(int parameterIndex, String x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * byte array value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setBytes(int parameterIndex, byte[] x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Date value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setDate(int parameterIndex, Date x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Time value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setTime(int parameterIndex, Time x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Timestamp value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setTimestamp(int parameterIndex, Timestamp x) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * ASCII InputStream value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param length The number of bytes in the stream. + * @exception SQLException If an error occurs. + */ + public void setAsciiStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Unicode UTF-8 InputStream value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param length The number of bytes in the stream. + * @exception SQLException If an error occurs. + * @deprecated + */ + public void setUnicodeStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * binary InputStream value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param length The number of bytes in the stream. + * @exception SQLException If an error occurs. + */ + public void setBinaryStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * This method clears all of the input parameter that have been + * set on this statement. + * + * @exception SQLException If an error occurs. + */ + public void clearParameters() throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Object value. The specified SQL object type will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param type The SQL type to use for the parameter, from Types + * @param scale The scale of the value, for numeric values only. + * @exception SQLException If an error occurs. + * @see Types + */ + public void setObject(int parameterIndex, Object x, int targetSqlType, + int scale) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Object value. The specified SQL object type will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param type The SQL type to use for the parameter, from Types + * @exception SQLException If an error occurs. + * @see Types + */ + public void setObject(int parameterIndex, Object x, int targetSqlType) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Object value. The default object type to SQL type mapping + * will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setObject(int parameterIndex, Object x) throws SQLException; + + /** + * This method executes a prepared SQL query. + * Some prepared statements return multiple results; the execute method + * handles these complex statements as well as the simpler form of + * statements handled by executeQuery and executeUpdate. + * + * @return The result of the SQL statement. + * @exception SQLException If an error occurs. + */ + public boolean execute() throws SQLException; + + /** + * This method adds a set of parameters to the batch for JDBC 2.0. + * @exception SQLException If an error occurs. + */ + public void addBatch() throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * character Reader value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param length The number of bytes in the stream. + * @exception SQLException If an error occurs. + */ + public void setCharacterStream(int parameterIndex, Reader reader, + int length) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Ref value. The default object type to SQL type mapping + * will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setRef(int i, Ref x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Blob value. The default object type to SQL type mapping + * will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setBlob(int i, Blob x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Clob value. The default object type to SQL type mapping + * will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setClob(int i, Clob x) throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * Array value. The default object type to SQL type mapping + * will be used. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @exception SQLException If an error occurs. + */ + public void setArray(int i, Array x) throws SQLException; + + /** + * This method returns meta data for the result set from this statement. + * + * @return Meta data for the result set from this statement. + * @exception SQLException If an error occurs. + */ + public ResultSetMetaData getMetaData() throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Date value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param calendar The Calendar to use for timezone and locale. + * @exception SQLException If an error occurs. + */ + public void setDate(int parameterIndex, Date x, Calendar cal) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Time value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param calendar The Calendar to use for timezone and locale. + * @exception SQLException If an error occurs. + */ + public void setTime(int parameterIndex, Time x, Calendar cal) + throws SQLException; + + /** + * This method sets the specified parameter from the given Java + * java.sql.Timestamp value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * @param calendar The Calendar to use for timezone and locale. + * @exception SQLException If an error occurs. + */ + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) + throws SQLException; + + /** + * This method populates the specified parameter with a SQL NULL value + * for the specified type. + * + * @param index The index of the parameter to set. + * @param type The SQL type identifier of the parameter from Types + * @param name The name of the data type, for user defined types. + * @exception SQLException If an error occurs. + */ + public void setNull(int paramIndex, int sqlType, String typeName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setURL(int parameterIndex, URL x) throws SQLException; + + /** + * @since 1.4 + */ + public ParameterMetaData getParameterMetaData() throws SQLException; +} diff --git a/libjava/java/sql/Ref.java b/libjava/java/sql/Ref.java index 530a36e702c..207d75ed21d 100644 --- a/libjava/java/sql/Ref.java +++ b/libjava/java/sql/Ref.java @@ -35,28 +35,41 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; +import java.util.Map; + /** - * This interface provides a mechanism for obtaining information about - * a SQL structured type - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Ref + * This interface provides a mechanism for obtaining information about + * a SQL structured type + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.2 + */ +public interface Ref { + /** + * This method returns the fully qualified name of the SQL structured + * type of the referenced item. + * + * @return The fully qualified name of the SQL structured type. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public String getBaseTypeName() throws SQLException; -/** - * This method returns the fully qualified name of the SQL structured - * type of the referenced item. - * - * @return The fully qualified name of the SQL structured type. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getBaseTypeName() throws SQLException; - -} // interface Ref + /** + * @since 1.4 + */ + public Object getObject(Map map) throws SQLException; + + /** + * @since 1.4 + */ + public Object getObject() throws SQLException; + /** + * @since 1.4 + */ + public void setObject(Object value) throws SQLException; +} diff --git a/libjava/java/sql/ResultSet.java b/libjava/java/sql/ResultSet.java index 69585d5ea9f..de294d8a36d 100644 --- a/libjava/java/sql/ResultSet.java +++ b/libjava/java/sql/ResultSet.java @@ -1,5 +1,5 @@ /* ResultSet.java -- A SQL statement result set. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,1977 +41,1490 @@ package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.net.URL; import java.util.Calendar; import java.util.Map; /** - * This interface provides access to the data set returned by a SQL - * statement. An instance of this interface is returned by the various - * execution methods in the Statement - * This class models a cursor, which can be stepped through one row at a - * time. Methods are provided for accessing columns by column name or by - * index. - *

- * Note that a result set is invalidated if the statement that returned - * it is closed. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface ResultSet + * This interface provides access to the data set returned by a SQL + * statement. An instance of this interface is returned by the various + * execution methods in the Statement + * This class models a cursor, which can be stepped through one row at a + * time. Methods are provided for accessing columns by column name or by + * index. + *

+ * Note that a result set is invalidated if the statement that returned + * it is closed. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface ResultSet { - -/** - * The rows will be processed in order from first to last. - */ -public static final int FETCH_FORWARD = 0; - -/** - * The rows will be processed in order from last to first. - */ -public static final int FETCH_REVERSE = 1; - -/** - * The rows will be processed in an unknown order - */ -public static final int FETCH_UNKNOWN = 2; - -/** - * This type of result set may only step forward through the rows returned. - */ -public static final int TYPE_FORWARD_ONLY = 0; - -/** - * This type of result set is scrollable and is not sensitive to changes - * made by other statements. - */ -public static final int TYPE_SCROLL_INSENSITIVE = 1; - -/** - * This type of result set is scrollable and is also sensitive to changes - * made by other statements. - */ -public static final int TYPE_SCROLL_SENSITIVE = 1; - -/** - * The concurrency mode of for the result set may not be modified. - */ -public static final int CONCUR_READ_ONLY = 0; - -/** - * The concurrency mode of for the result set may be modified. - */ -public static final int CONCUR_UPDATABLE = 1; - -/*************************************************************************/ - -/** - * This method advances to the next row in the result set. Any streams - * open on the current row are closed automatically. - * - * @return true if the next row exists, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -next() throws SQLException; - -/*************************************************************************/ - -/** - * This method moves the current position to the previous row in the - * result set. - * - * @return true if the previous row exists, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -previous() throws SQLException; - -/*************************************************************************/ - -/** - * This method closes the result set and frees any associated resources. - * - * @exception SQLException If an error occurs. - */ -public abstract void -close() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether the value of the last column that was fetched - * was actually a SQL NULL value. - * - * @return true if the last column fetched was a NULL, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -wasNull() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * String. - * - * @param index The index of the column to return. - * - * @return The column value as a String. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getString(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * Object. - * - * @param index The index of the column to return. - * - * @return The column value as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * boolean. - * - * @param index The index of the column to return. - * - * @return The column value as a boolean. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -getBoolean(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * byte. - * - * @param index The index of the column to return. - * - * @return The column value as a byte. - * - * @exception SQLException If an error occurs. - */ -public abstract byte -getByte(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * short. - * - * @param index The index of the column to return. - * - * @return The column value as a short. - * - * @exception SQLException If an error occurs. - */ -public abstract short -getShort(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * int. - * - * @param index The index of the column to return. - * - * @return The column value as a int. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getInt(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * long. - * - * @param index The index of the column to return. - * - * @return The column value as a long. - * - * @exception SQLException If an error occurs. - */ -public abstract long -getLong(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * float. - * - * @param index The index of the column to return. - * - * @return The column value as a float. - * - * @exception SQLException If an error occurs. - */ -public abstract float -getFloat(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * double. - * - * @param index The index of the column to return. - * - * @return The column value as a double. - * - * @exception SQLException If an error occurs. - */ -public abstract double -getDouble(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * BigDecimal. - * - * @param index The index of the column to return. - * - * @return The column value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * BigDecimal. - * - * @param index The index of the column to return. - * @param scale The number of digits to the right of the decimal to return. - * - * @return The column value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(int index, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * byte array. - * - * @param index The index of the column to return. - * - * @return The column value as a byte array - * - * @exception SQLException If an error occurs. - */ -public abstract byte[] -getBytes(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Date. - * - * @param index The index of the column to return. - * - * @return The column value as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Time. - * - * @param index The index of the column to return. - * - * @return The column value as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Timestamp. - * - * @param index The index of the column to return. - * - * @return The column value as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as an ASCII - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param index The index of the column to return. - * - * @return The column value as an ASCII InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getAsciiStream(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Unicode UTF-8 - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param index The index of the column to return. - * - * @return The column value as a Unicode UTF-8 InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getUnicodeStream(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a raw byte - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param index The index of the column to return. - * - * @return The column value as a raw byte InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getBinaryStream(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a character - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param index The index of the column to return. - * - * @return The column value as an character Reader. - * - * @exception SQLException If an error occurs. - */ -public abstract Reader -getCharacterStream(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * String. - * - * @param column The name of the column to return. - * - * @return The column value as a String. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getString(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * Object. - * - * @param column The name of the column to return. - * - * @return The column value as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * boolean. - * - * @param column The name of the column to return. - * - * @return The column value as a boolean. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -getBoolean(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * byte. - * - * @param column The name of the column to return. - * - * @return The column value as a byte. - * - * @exception SQLException If an error occurs. - */ -public abstract byte -getByte(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * short. - * - * @param column The name of the column to return. - * - * @return The column value as a short. - * - * @exception SQLException If an error occurs. - */ -public abstract short -getShort(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * int. - * - * @param column The name of the column to return. - * - * @return The column value as a int. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getInt(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * long. - * - * @param column The name of the column to return. - * - * @return The column value as a long. - * - * @exception SQLException If an error occurs. - */ -public abstract long -getLong(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * float. - * - * @param column The name of the column to return. - * - * @return The column value as a float. - * - * @exception SQLException If an error occurs. - */ -public abstract float -getFloat(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * double. - * - * @param column The name of the column to return. - * - * @return The column value as a double. - * - * @exception SQLException If an error occurs. - */ -public abstract double -getDouble(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * BigDecimal. - * - * @param column The name of the column to return. - * - * @return The column value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * BigDecimal. - * - * @param column The name of the column to return. - * @param scale The number of digits to the right of the decimal to return. - * - * @return The column value as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -getBigDecimal(String column, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * byte array. - * - * @param column The name of the column to return. - * - * @return The column value as a byte array - * - * @exception SQLException If an error occurs. - */ -public abstract byte[] -getBytes(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Date. - * - * @param column The name of the column to return. - * - * @return The column value as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Time. - * - * @param column The name of the column to return. - * - * @return The column value as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * java.sql.Timestamp. - * - * @param column The name of the column to return. - * - * @return The column value as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as an ASCII - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param column The name of the column to return. - * - * @return The column value as an ASCII InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getAsciiStream(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Unicode UTF-8 - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param column The name of the column to return. - * - * @return The column value as a Unicode UTF-8 InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getUnicodeStream(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a raw byte - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param column The name of the column to return. - * - * @return The column value as a raw byte InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -getBinaryStream(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a character - * stream. Note that all the data from this stream must be read before - * fetching the value of any other column. Please also be aware that - * calling next() or close() on this result set - * will close this stream as well. - * - * @param column The name of the column to return. - * - * @return The column value as an character Reader. - * - * @exception SQLException If an error occurs. - */ -public abstract Reader -getCharacterStream(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the first SQL warning associated with this result - * set. Any additional warnings will be chained to this one. - * - * @return The first SQLWarning for this result set, or null if - * there are no warnings. - * - * @exception SQLException If an error occurs. - */ -public abstract SQLWarning -getWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method clears all warnings associated with this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -clearWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the database cursor used by this - * result set. - * - * @return The name of the database cursor used by this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getCursorName() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns data about the columns returned as part of the - * result set as a ResultSetMetaData instance. - * - * @return The ResultSetMetaData instance for this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSetMetaData -getMetaData() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the column index of the specified named column. - * - * @param column The name of the column. - * - * @return The index of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract int -findColumn(String column) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the cursor is before the first row - * in the result set. - * - * @return true if the cursor is positioned before the first - * row, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isBeforeFirst() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the cursor is after the last row - * in the result set. - * - * @return true if the cursor is positioned after the last - * row, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isAfterLast() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the cursor is positioned on the first - * row in the result set. - * - * @return true if the cursor is positioned on the first - * row, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isFirst() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the cursor is on the last row - * in the result set. - * - * @return true if the cursor is positioned on the last - * row, false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isLast() throws SQLException; - -/*************************************************************************/ - -/** - * This method repositions the cursor to before the first row in the - * result set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -beforeFirst() throws SQLException; - -/*************************************************************************/ - -/** - * This method repositions the cursor to after the last row in the result - * set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -afterLast() throws SQLException; - -/*************************************************************************/ - -/** - * This method repositions the cursor on the first row in the - * result set. - * - * @return true if the cursor is on a valid row; - * false if there are no rows in the result set. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -first() throws SQLException; - -/*************************************************************************/ - -/** - * This method repositions the cursor on the last row in the result - * set. - * - * @return true if the cursor is on a valid row; - * false if there are no rows in the result set. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -last() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the current row number in the cursor. Numbering - * begins at index 1. - * - * @return The current row number, or 0 if there is not current row. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method positions the result set to the specified absolute row. - * Positive numbers are row offsets from the beginning of the result - * set (numbering starts from row 1) and negative numbers are row offsets - * from the end of the result set (numbering starts from -1). - * - * @param row The row to position the result set to. - * - * @return true if the current position was changed, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -absolute(int row) throws SQLException; - -/*************************************************************************/ - -/** - * This method moves the result set position relative to the current row. - * The offset can be positive or negative. - * - * @param row The relative row position to move to. - * - * @return true if the current position was changed, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -relative(int row) throws SQLException; - -/*************************************************************************/ - -/** - * This method provides a hint to the driver about which direction the - * result set will be processed in. - * - * @param direction The direction in which rows will be processed. (Values?) - * - * @exception SQLException If an error occurs. - */ -public abstract void -setFetchDirection(int direction) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the current fetch direction for this result set. - * - * @return The fetch direction for this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getFetchDirection() throws SQLException; - -/*************************************************************************/ - -/** - * This method provides a hint to the driver about how many rows at a - * time it should fetch from the database. - * - * @param rows The number of rows the driver should fetch per call. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setFetchSize(int rows) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the current number of rows that will be fetched - * from the database at a time. - * - * @return The current fetch size for this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getFetchSize() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the result set type of this result set. This will - * be one of the TYPE_* constants defined in this interface. - * - * @return The result set type. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getType() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the concurrency type of this result set. This will - * be one of the CONCUR_* constants defined in this interface. - * - * @return The result set concurrency type. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getConcurrency() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the current row in the result set - * has been updated. Updates must be visible in order of this method to - * detect the update. - * - * @return true if the row has been updated, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -rowUpdated() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the current row in the result set - * has been inserted. Inserts must be visible in order of this method to - * detect the insert. - * - * @return true if the row has been inserted, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -rowInserted() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the current row in the result set - * has been deleted. Deletes must be visible in order of this method to - * detect the deletion. - * - * @return true if the row has been deleted, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -rowDeleted() throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a NULL value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @return index The index of the column to update. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateNull(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a boolean value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBoolean(int index, boolean value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a byte value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateByte(int index, byte value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a short value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateShort(int index, short value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an int value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateInt(int index, int value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a long value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateLong(int index, long value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a float value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateFloat(int index, float value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a double value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateDouble(int index, double value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a BigDecimal value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBigDecimal(int index, BigDecimal value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a String value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateString(int index, String value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a byte array value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBytes(int index, byte[] value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Date value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateDate(int index, java.sql.Date value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Time value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateTime(int index, java.sql.Time value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Timestamp value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateTimestamp(int index, java.sql.Timestamp value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from an ASCII text stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateAsciiStream(int index, InputStream value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from a binary stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBinaryStream(int index, InputStream value, int length) - throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from a character stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateCharacterStream(int index, Reader value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an Object value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateObject(int index, Object value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an Object value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param index The index of the column to update. - * @param value The new value of the column. - * @param scale The scale of the object in question, which is used only - * for numeric type objects. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateObject(int index, Object value, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a NULL value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @return name The name of the column to update. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateNull(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a boolean value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBoolean(String name, boolean value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a byte value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateByte(String name, byte value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a short value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateShort(String name, short value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an int value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateInt(String name, int value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a long value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateLong(String name, long value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a float value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateFloat(String name, float value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a double value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateDouble(String name, double value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a BigDecimal value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBigDecimal(String name, BigDecimal value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a String value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateString(String name, String value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a byte array value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBytes(String name, byte[] value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Date value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateDate(String name, java.sql.Date value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Time value. This - * does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateTime(String name, java.sql.Time value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have a java.sql.Timestamp value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateTimestamp(String name, java.sql.Timestamp value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from an ASCII text stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateAsciiStream(String name, InputStream value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from a binary stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateBinaryStream(String name, InputStream value, int length) - throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column from a character stream. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * @param length The length of the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateCharacterStream(String name, Reader value, int length) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an Object value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateObject(String name, Object value) throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the specified column to have an Object value. - * This does not update the actual database. updateRow must be - * called in order to do that. - * - * @param name The name of the column to update. - * @param value The new value of the column. - * @param scale The scale of the object in question, which is used only - * for numeric type objects. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateObject(String name, Object value, int scale) throws SQLException; - -/*************************************************************************/ - -/** - * This method inserts the current row into the database. The result set - * must be positioned on the insert row in order to call this method - * successfully. - * - * @exception SQLException If an error occurs. - */ -public abstract void -insertRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method updates the current row in the database. - * - * @exception SQLException If an error occurs. - */ -public abstract void -updateRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method deletes the current row in the database. - * - * @exception SQLException If an error occurs. - */ -public abstract void -deleteRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method refreshes the contents of the current row from the database. - * - * @exception SQLException If an error occurs. - */ -public abstract void -refreshRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method cancels any changes that have been made to a row. If - * the rowUpdate method has been called, then the changes - * cannot be undone. - * - * @exception SQLException If an error occurs. - */ -public abstract void -cancelRowUpdates() throws SQLException; - -/*************************************************************************/ - -/** - * This method positions the result set to the "insert row", which allows - * a new row to be inserted into the database from the result set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -moveToInsertRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method moves the result set position from the insert row back to - * the current row that was selected prior to moving to the insert row. - * - * @exception SQLException If an error occurs. - */ -public abstract void -moveToCurrentRow() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a the Statement that was used to - * produce this result set. - * - * @return The Statement used to produce this result set. - * - * @exception SQLException If an error occurs. - */ -public abstract Statement -getStatement() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * Object using the specified SQL type to Java type map. - * - * @param index The index of the column to return. - * @param map The SQL type to Java type map to use. - * - * @return The value of the column as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(int index, Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a Ref for the specified column which - * represents the structured type for the column. - * - * @param index The index of the column to return. - * - * @return A Ref object for the column - * - * @exception SQLException If an error occurs. - */ -public Ref -getRef(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a BLOB. - * - * @param index The index of the column value to return. - * - * @return The value of the column as a BLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract Blob -getBlob(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a CLOB. - * - * @param index The index of the column value to return. - * - * @return The value of the column as a CLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract Clob -getClob(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as an Array. - * - * @param index The index of the column value to return. - * - * @return The value of the column as an Array. - * - * @exception SQLException If an error occurs. - */ -public abstract Array -getArray(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the value of the specified column as a Java - * Object using the specified SQL type to Java type map. - * - * @param name The name of the column to return. - * @param map The SQL type to Java type map to use. - * - * @return The value of the column as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -getObject(String name, Map map) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a Ref for the specified column which - * represents the structured type for the column. - * - * @param index The index of the column to return. - * - * @return A Ref object for the column - * - * @exception SQLException If an error occurs. - */ -public Ref -getRef(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a BLOB. - * - * @param name The name of the column value to return. - * - * @return The value of the column as a BLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract Blob -getBlob(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a CLOB. - * - * @param name The name of the column value to return. - * - * @return The value of the column as a CLOB. - * - * @exception SQLException If an error occurs. - */ -public abstract Clob -getClob(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as an Array. - * - * @param name The name of the column value to return. - * - * @return The value of the column as an Array. - * - * @exception SQLException If an error occurs. - */ -public abstract Array -getArray(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Date. The specified Calendar is used - * to generate a value for the date if the database does not support - * timezones. - * - * @param index The index of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(int index, Calendar cal) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Time. The specified Calendar is used - * to generate a value for the time if the database does not support - * timezones. - * - * @param index The index of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(int index, Calendar cal) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Timestamp. The specified Calendar is used - * to generate a value for the timestamp if the database does not support - * timezones. - * - * @param index The index of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(int index, Calendar cal) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Date. The specified Calendar is used - * to generate a value for the date if the database does not support - * timezones. - * - * @param name The name of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -getDate(String name, Calendar cal) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Time. The specified Calendar is used - * to generate a value for the time if the database does not support - * timezones. - * - * @param name The name of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -getTime(String name, Calendar cal) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the specified column value as a - * java.sql.Timestamp. The specified Calendar is used - * to generate a value for the timestamp if the database does not support - * timezones. - * - * @param name The name of the column value to return. - * @param cal The Calendar to use for calculating timezones. - * - * @return The value of the column as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -getTimestamp(String name, Calendar cal) throws SQLException; - -} // interface ResultSet - + /** + * The rows will be processed in order from first to last. + */ + public static final int FETCH_FORWARD = 1000; + + /** + * The rows will be processed in order from last to first. + */ + public static final int FETCH_REVERSE = 1001; + + /** + * The rows will be processed in an unknown order + */ + public static final int FETCH_UNKNOWN = 1002; + + /** + * This type of result set may only step forward through the rows returned. + */ + public static final int TYPE_FORWARD_ONLY = 1003; + + /** + * This type of result set is scrollable and is not sensitive to changes + * made by other statements. + */ + public static final int TYPE_SCROLL_INSENSITIVE = 1004; + + /** + * This type of result set is scrollable and is also sensitive to changes + * made by other statements. + */ + public static final int TYPE_SCROLL_SENSITIVE = 1005; + + /** + * The concurrency mode of for the result set may not be modified. + */ + public static final int CONCUR_READ_ONLY = 1007; + + /** + * The concurrency mode of for the result set may be modified. + */ + public static final int CONCUR_UPDATABLE = 1008; + + public static final int HOLD_CURSORS_OVER_COMMIT = 1; + + public static final int CLOSE_CURSORS_AT_COMMIT = 2; + + /** + * This method advances to the next row in the result set. Any streams + * open on the current row are closed automatically. + * + * @return true if the next row exists, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean next() throws SQLException; + + /** + * This method closes the result set and frees any associated resources. + * + * @exception SQLException If an error occurs. + */ + public void close() throws SQLException; + + /** + * This method tests whether the value of the last column that was fetched + * was actually a SQL NULL value. + * + * @return true if the last column fetched was a NULL, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean wasNull() throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * String. + * + * @param index The index of the column to return. + * @return The column value as a String. + * @exception SQLException If an error occurs. + */ + public String getString(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * boolean. + * + * @param index The index of the column to return. + * @return The column value as a boolean. + * @exception SQLException If an error occurs. + */ + public boolean getBoolean(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * byte. + * + * @param index The index of the column to return. + * @return The column value as a byte. + * @exception SQLException If an error occurs. + */ + public byte getByte(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * short. + * + * @param index The index of the column to return. + * @return The column value as a short. + * @exception SQLException If an error occurs. + */ + public short getShort(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * int. + * + * @param index The index of the column to return. + * @return The column value as a int. + * @exception SQLException If an error occurs. + */ + public int getInt(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * long. + * + * @param index The index of the column to return. + * @return The column value as a long. + * @exception SQLException If an error occurs. + */ + public long getLong(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * float. + * + * @param index The index of the column to return. + * @return The column value as a float. + * @exception SQLException If an error occurs. + */ + public float getFloat(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * double. + * + * @param index The index of the column to return. + * @return The column value as a double. + * @exception SQLException If an error occurs. + */ + public double getDouble(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param index The index of the column to return. + * @param scale The number of digits to the right of the decimal to return. + * @return The column value as a BigDecimal. + * @exception SQLException If an error occurs. + * @deprecated + */ + public BigDecimal getBigDecimal(int columnIndex, int scale) + throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * byte array. + * + * @param index The index of the column to return. + * @return The column value as a byte array + * @exception SQLException If an error occurs. + */ + public byte[] getBytes(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Date. + * + * @param index The index of the column to return. + * @return The column value as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date getDate(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Time. + * + * @param index The index of the column to return. + * @return The column value as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time getTime(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Timestamp. + * + * @param index The index of the column to return. + * @return The column value as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + */ + public Timestamp getTimestamp(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as an ASCII + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * @return The column value as an ASCII InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream getAsciiStream(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Unicode UTF-8 + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * @return The column value as a Unicode UTF-8 InputStream. + * @exception SQLException If an error occurs. + * @deprecated Use getCharacterStream instead. + */ + public InputStream getUnicodeStream(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a raw byte + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * @return The column value as a raw byte InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream getBinaryStream(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * String. + * + * @param column The name of the column to return. + * @return The column value as a String. + * @exception SQLException If an error occurs. + */ + public String getString(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * boolean. + * + * @param column The name of the column to return. + * @return The column value as a boolean. + * @exception SQLException If an error occurs. + */ + public boolean getBoolean(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * byte. + * + * @param column The name of the column to return. + * @return The column value as a byte. + * @exception SQLException If an error occurs. + */ + public byte getByte(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * short. + * + * @param column The name of the column to return. + * @return The column value as a short. + * @exception SQLException If an error occurs. + */ + public short getShort(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * int. + * + * @param column The name of the column to return. + * @return The column value as a int. + * @exception SQLException If an error occurs. + */ + public int getInt(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * long. + * + * @param column The name of the column to return. + * @return The column value as a long. + * @exception SQLException If an error occurs. + */ + public long getLong(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * float. + * + * @param column The name of the column to return. + * @return The column value as a float. + * @exception SQLException If an error occurs. + */ + public float getFloat(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * double. + * + * @param column The name of the column to return. + * @return The column value as a double. + * @exception SQLException If an error occurs. + */ + public double getDouble(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param index The index of the column to return. + * @return The column value as a BigDecimal. + * @exception SQLException If an error occurs. + * @deprecated + */ + public BigDecimal getBigDecimal(String columnName, int scale) + throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * byte array. + * + * @param column The name of the column to return. + * @return The column value as a byte array + * @exception SQLException If an error occurs. + */ + public byte[] getBytes(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Date. + * + * @param column The name of the column to return. + * @return The column value as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date getDate(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Time. + * + * @param column The name of the column to return. + * @return The column value as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time getTime(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * java.sql.Timestamp. + * + * @param column The name of the column to return. + * @return The column value as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + */ + public Timestamp getTimestamp(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as an ASCII + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * @return The column value as an ASCII InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream getAsciiStream(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Unicode UTF-8 + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * @return The column value as a Unicode UTF-8 InputStream. + * @exception SQLException If an error occurs. + * @deprecated Use getCharacterStream instead. + */ + public InputStream getUnicodeStream(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a raw byte + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * @return The column value as a raw byte InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream getBinaryStream(String columnName) throws SQLException; + + /** + * This method returns the first SQL warning associated with this result + * set. Any additional warnings will be chained to this one. + * + * @return The first SQLWarning for this result set, or null if + * there are no warnings. + * @exception SQLException If an error occurs. + */ + public SQLWarning getWarnings() throws SQLException; + + /** + * This method clears all warnings associated with this result set. + * + * @exception SQLException If an error occurs. + */ + public void clearWarnings() throws SQLException; + + /** + * This method returns the name of the database cursor used by this + * result set. + * + * @return The name of the database cursor used by this result set. + * @exception SQLException If an error occurs. + */ + public String getCursorName() throws SQLException; + + /** + * This method returns data about the columns returned as part of the + * result set as a ResultSetMetaData instance. + * + * @return The ResultSetMetaData instance for this result set. + * @exception SQLException If an error occurs. + */ + public ResultSetMetaData getMetaData() throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * Object. + * + * @param index The index of the column to return. + * @return The column value as an Object. + * @exception SQLException If an error occurs. + */ + public Object getObject(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * Object. + * + * @param column The name of the column to return. + * @return The column value as an Object. + * @exception SQLException If an error occurs. + */ + public Object getObject(String columnName) throws SQLException; + + /** + * This method returns the column index of the specified named column. + * + * @param column The name of the column. + * @return The index of the column. + * @exception SQLException If an error occurs. + */ + public int findColumn(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a character + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * @return The column value as an character Reader. + * @exception SQLException If an error occurs. + */ + public Reader getCharacterStream(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a character + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * @return The column value as an character Reader. + * @exception SQLException If an error occurs. + */ + public Reader getCharacterStream(String columnName) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param index The index of the column to return. + * @return The column value as a BigDecimal. + * @exception SQLException If an error occurs. + */ + public BigDecimal getBigDecimal(int columnIndex) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param column The name of the column to return. + * @return The column value as a BigDecimal. + * @exception SQLException If an error occurs. + */ + public BigDecimal getBigDecimal(String columnName) throws SQLException; + + /** + * This method tests whether or not the cursor is before the first row + * in the result set. + * + * @return true if the cursor is positioned before the first + * row, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isBeforeFirst() throws SQLException; + + /** + * This method tests whether or not the cursor is after the last row + * in the result set. + * + * @return true if the cursor is positioned after the last + * row, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isAfterLast() throws SQLException; + + /** + * This method tests whether or not the cursor is positioned on the first + * row in the result set. + * + * @return true if the cursor is positioned on the first + * row, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isFirst() throws SQLException; + + /** + * This method tests whether or not the cursor is on the last row + * in the result set. + * + * @return true if the cursor is positioned on the last + * row, false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isLast() throws SQLException; + + /** + * This method repositions the cursor to before the first row in the + * result set. + * + * @exception SQLException If an error occurs. + */ + public void beforeFirst() throws SQLException; + + /** + * This method repositions the cursor to after the last row in the result + * set. + * + * @exception SQLException If an error occurs. + */ + public void afterLast() throws SQLException; + + /** + * This method repositions the cursor on the first row in the + * result set. + * + * @return true if the cursor is on a valid row; + * false if there are no rows in the result set. + * @exception SQLException If an error occurs. + */ + public boolean first() throws SQLException; + + /** + * This method repositions the cursor on the last row in the result + * set. + * + * @return true if the cursor is on a valid row; + * false if there are no rows in the result set. + * @exception SQLException If an error occurs. + */ + public boolean last() throws SQLException; + + /** + * This method returns the current row number in the cursor. Numbering + * begins at index 1. + * + * @return The current row number, or 0 if there is not current row. + * @exception SQLException If an error occurs. + */ + public int getRow() throws SQLException; + + /** + * This method positions the result set to the specified absolute row. + * Positive numbers are row offsets from the beginning of the result + * set (numbering starts from row 1) and negative numbers are row offsets + * from the end of the result set (numbering starts from -1). + * + * @param row The row to position the result set to. + * + * @return true if the current position was changed, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean absolute(int row) throws SQLException; + + /** + * This method moves the result set position relative to the current row. + * The offset can be positive or negative. + * + * @param row The relative row position to move to. + * @return true if the current position was changed, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean relative(int rows) throws SQLException; + + /** + * This method moves the current position to the previous row in the + * result set. + * + * @return true if the previous row exists, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean previous() throws SQLException; + + /** + * This method provides a hint to the driver about which direction the + * result set will be processed in. + * + * @param direction The direction in which rows will be processed. (Values?) + * @exception SQLException If an error occurs. + */ + public void setFetchDirection(int direction) throws SQLException; + + /** + * This method returns the current fetch direction for this result set. + * + * @return The fetch direction for this result set. + * @exception SQLException If an error occurs. + */ + public int getFetchDirection() throws SQLException; + + /** + * This method provides a hint to the driver about how many rows at a + * time it should fetch from the database. + * + * @param rows The number of rows the driver should fetch per call. + * @exception SQLException If an error occurs. + */ + public void setFetchSize(int rows) throws SQLException; + + /** + * This method returns the current number of rows that will be fetched + * from the database at a time. + * + * @return The current fetch size for this result set. + * @exception SQLException If an error occurs. + */ + public int getFetchSize() throws SQLException; + + /** + * This method returns the result set type of this result set. This will + * be one of the TYPE_* constants defined in this interface. + * + * @return The result set type. + * @exception SQLException If an error occurs. + */ + public int getType() throws SQLException; + + /** + * This method returns the concurrency type of this result set. This will + * be one of the CONCUR_* constants defined in this interface. + * + * @return The result set concurrency type. + * @exception SQLException If an error occurs. + */ + public int getConcurrency() throws SQLException; + + /** + * This method tests whether or not the current row in the result set + * has been updated. Updates must be visible in order of this method to + * detect the update. + * + * @return true if the row has been updated, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean rowUpdated() throws SQLException; + + /** + * This method tests whether or not the current row in the result set + * has been inserted. Inserts must be visible in order of this method to + * detect the insert. + * + * @return true if the row has been inserted, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean rowInserted() throws SQLException; + + /** + * This method tests whether or not the current row in the result set + * has been deleted. Deletes must be visible in order of this method to + * detect the deletion. + * + * @return true if the row has been deleted, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean rowDeleted() throws SQLException; + + /** + * This method updates the specified column to have a NULL value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @return index The index of the column to update. + * @exception SQLException If an error occurs. + */ + public void updateNull(int columnIndex) throws SQLException; + + /** + * This method updates the specified column to have a boolean value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBoolean(int columnIndex, boolean x) throws SQLException; + + /** + * This method updates the specified column to have a byte value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateByte(int columnIndex, byte x) throws SQLException; + + /** + * This method updates the specified column to have a short value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateShort(int columnIndex, short x) throws SQLException; + + /** + * This method updates the specified column to have an int value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateInt(int columnIndex, int x) throws SQLException; + + /** + * This method updates the specified column to have a long value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateLong(int columnIndex, long x) throws SQLException; + + /** + * This method updates the specified column to have a float value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateFloat(int columnIndex, float x) throws SQLException; + + /** + * This method updates the specified column to have a double value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateDouble(int columnIndex, double x) throws SQLException; + + /** + * This method updates the specified column to have a BigDecimal value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBigDecimal(int columnIndex, BigDecimal x) + throws SQLException; + + /** + * This method updates the specified column to have a String value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateString(int columnIndex, String x) throws SQLException; + + /** + * This method updates the specified column to have a byte array value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBytes(int columnIndex, byte[] x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Date value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateDate(int columnIndex, Date x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Time value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateTime(int columnIndex, Time x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Timestamp value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateTimestamp(int columnIndex, Timestamp x) + throws SQLException; + + /** + * This method updates the specified column from an ASCII text stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * @exception SQLException If an error occurs. + */ + public void updateAsciiStream(int columnIndex, InputStream x, int length) + throws SQLException; + + /** + * This method updates the specified column from a binary stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * @exception SQLException If an error occurs. + */ + public void updateBinaryStream(int columnIndex, InputStream x, int length) + throws SQLException; + + /** + * This method updates the specified column from a character stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * @exception SQLException If an error occurs. + */ + public void updateCharacterStream(int columnIndex, Reader x, int length) + throws SQLException; + + /** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ + public void updateObject(int columnIndex, Object x, int scale) + throws SQLException; + + /** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param scale The scale of the object in question, which is used only + * for numeric type objects. + * @exception SQLException If an error occurs. + */ + public void updateObject(int columnIndex, Object x) throws SQLException; + + /** + * This method updates the specified column to have a NULL value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @return name The name of the column to update. + * @exception SQLException If an error occurs. + */ + public void updateNull(String columnName) throws SQLException; + + /** + * This method updates the specified column to have a boolean value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBoolean(String columnName, boolean x) throws SQLException; + + /** + * This method updates the specified column to have a byte value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateByte(String columnName, byte x) throws SQLException; + + /** + * This method updates the specified column to have a short value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateShort(String columnName, short x) throws SQLException; + + /** + * This method updates the specified column to have an int value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateInt(String columnName, int x) throws SQLException; + + /** + * This method updates the specified column to have a long value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateLong(String columnName, long x) throws SQLException; + + /** + * This method updates the specified column to have a float value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateFloat(String columnName, float x) throws SQLException; + + /** + * This method updates the specified column to have a double value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateDouble(String columnName, double x) throws SQLException; + + /** + * This method updates the specified column to have a BigDecimal value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBigDecimal(String columnName, BigDecimal x) + throws SQLException; + + /** + * This method updates the specified column to have a String value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateString(String columnName, String x) throws SQLException; + + /** + * This method updates the specified column to have a byte array value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateBytes(String columnName, byte[] x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Date value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateDate(String columnName, Date x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Time value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateTime(String columnName, Time x) throws SQLException; + + /** + * This method updates the specified column to have a java.sql.Timestamp value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateTimestamp(String columnName, Timestamp x) + throws SQLException; + + /** + * This method updates the specified column from an ASCII text stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * @exception SQLException If an error occurs. + */ + public void updateAsciiStream(String columnName, InputStream x, int length) + throws SQLException; + + /** + * This method updates the specified column from a binary stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * @exception SQLException If an error occurs. + */ + public void updateBinaryStream(String columnName, InputStream x, int length) + throws SQLException; + + /** + * This method updates the specified column from a character stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ + public void updateCharacterStream(String columnName, Reader reader, + int length) throws SQLException; + + /** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @exception SQLException If an error occurs. + */ + public void updateObject(String columnName, Object x, int scale) + throws SQLException; + + /** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param scale The scale of the object in question, which is used only + * for numeric type objects. + * @exception SQLException If an error occurs. + */ + public void updateObject(String columnName, Object x) throws SQLException; + + /** + * This method inserts the current row into the database. The result set + * must be positioned on the insert row in order to call this method + * successfully. + * + * @exception SQLException If an error occurs. + */ + public void insertRow() throws SQLException; + + /** + * This method updates the current row in the database. + * + * @exception SQLException If an error occurs. + */ + public void updateRow() throws SQLException; + + /** + * This method deletes the current row in the database. + * + * @exception SQLException If an error occurs. + */ + public void deleteRow() throws SQLException; + + /** + * This method refreshes the contents of the current row from the database. + * + * @exception SQLException If an error occurs. + */ + public void refreshRow() throws SQLException; + + /** + * This method cancels any changes that have been made to a row. If + * the rowUpdate method has been called, then the changes + * cannot be undone. + * + * @exception SQLException If an error occurs. + */ + public void cancelRowUpdates() throws SQLException; + + /** + * This method positions the result set to the "insert row", which allows + * a new row to be inserted into the database from the result set. + * + * @exception SQLException If an error occurs. + */ + public void moveToInsertRow() throws SQLException; + + /** + * This method moves the result set position from the insert row back to + * the current row that was selected prior to moving to the insert row. + * + * @exception SQLException If an error occurs. + */ + public void moveToCurrentRow() throws SQLException; + + /** + * This method returns a the Statement that was used to + * produce this result set. + * + * @return The Statement used to produce this result set. + * + * @exception SQLException If an error occurs. + */ + public Statement getStatement() throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * Object using the specified SQL type to Java type map. + * + * @param index The index of the column to return. + * @param map The SQL type to Java type map to use. + * @return The value of the column as an Object. + * @exception SQLException If an error occurs. + */ + public Object getObject(int i, Map map) throws SQLException; + + /** + * This method returns a Ref for the specified column which + * represents the structured type for the column. + * + * @param index The index of the column to return. + * @return A Ref object for the column + * @exception SQLException If an error occurs. + */ + public Ref getRef(int i) throws SQLException; + + /** + * This method returns the specified column value as a BLOB. + * + * @param index The index of the column value to return. + * @return The value of the column as a BLOB. + * @exception SQLException If an error occurs. + */ + public Blob getBlob(int i) throws SQLException; + + /** + * This method returns the specified column value as a CLOB. + * + * @param index The index of the column value to return. + * @return The value of the column as a CLOB. + * @exception SQLException If an error occurs. + */ + public Clob getClob(int i) throws SQLException; + + /** + * This method returns the specified column value as an Array. + * + * @param index The index of the column value to return. + * @return The value of the column as an Array. + * @exception SQLException If an error occurs. + */ + public Array getArray(int i) throws SQLException; + + /** + * This method returns the value of the specified column as a Java + * Object using the specified SQL type to Java type map. + * + * @param name The name of the column to return. + * @param map The SQL type to Java type map to use. + * @return The value of the column as an Object. + * @exception SQLException If an error occurs. + */ + public Object getObject(String colName, Map map) throws SQLException; + + /** + * This method returns a Ref for the specified column which + * represents the structured type for the column. + * + * @param index The index of the column to return. + * @return A Ref object for the column + * @exception SQLException If an error occurs. + */ + public Ref getRef(String colName) throws SQLException; + + /** + * This method returns the specified column value as a BLOB. + * + * @param name The name of the column value to return. + * @return The value of the column as a BLOB. + * @exception SQLException If an error occurs. + */ + public Blob getBlob(String colName) throws SQLException; + + /** + * This method returns the specified column value as a CLOB. + * + * @param name The name of the column value to return. + * @return The value of the column as a CLOB. + * @exception SQLException If an error occurs. + */ + public Clob getClob(String colName) throws SQLException; + + /** + * This method returns the specified column value as an Array. + * + * @param name The name of the column value to return. + * @return The value of the column as an Array. + * @exception SQLException If an error occurs. + */ + public Array getArray(String colName) throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Date. The specified Calendar is used + * to generate a value for the date if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * @return The value of the column as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date getDate(int columnIndex, Calendar cal) throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Date. The specified Calendar is used + * to generate a value for the date if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * @return The value of the column as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date getDate(String columnName, Calendar cal) throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Time. The specified Calendar is used + * to generate a value for the time if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * @return The value of the column as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time getTime(int columnIndex, Calendar cal) throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Time. The specified Calendar is used + * to generate a value for the time if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * @return The value of the column as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time getTime(String columnName, Calendar cal) throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Timestamp. The specified Calendar is used + * to generate a value for the timestamp if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * @return The value of the column as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + */ + public Timestamp getTimestamp(int columnIndex, Calendar cal) + throws SQLException; + + /** + * This method returns the specified column value as a + * java.sql.Timestamp. The specified Calendar is used + * to generate a value for the timestamp if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Timestamp. + * + * @exception SQLException If an error occurs. + */ + public Timestamp getTimestamp(String columnName, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public URL getURL(int columnIndex) throws SQLException; + + /** + * @since 1.4 + */ + public URL getURL(String columnName) throws SQLException; + + /** + * @since 1.4 + */ + public void updateRef(int columnIndex, Ref x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateRef(String columnName, Ref x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateBlob(int columnIndex, Blob x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateBlob(String columnName, Blob x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateClob(int columnIndex, Clob x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateClob(String columnName, Clob x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateArray(int columnIndex, Array x) throws SQLException; + + /** + * @since 1.4 + */ + public void updateArray(String columnName, Array x) throws SQLException; +} diff --git a/libjava/java/sql/ResultSetMetaData.java b/libjava/java/sql/ResultSetMetaData.java index b3402c3fc66..889128975e5 100644 --- a/libjava/java/sql/ResultSetMetaData.java +++ b/libjava/java/sql/ResultSetMetaData.java @@ -1,5 +1,5 @@ /* ResultSetMetaData.java -- Returns information about the ResultSet - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,351 +39,243 @@ exception statement from your version. */ package java.sql; /** - * This interface provides a mechanism for obtaining information about - * the columns that are present in a ResultSet. - *

- * Note that in this class column indexes start at 1, not 0. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface ResultSetMetaData + * This interface provides a mechanism for obtaining information about + * the columns that are present in a ResultSet. + *

+ * Note that in this class column indexes start at 1, not 0. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface ResultSetMetaData { - -/** - * The column does not allow NULL's. - */ -public static final int columnNoNulls = 0; - -/** - * The column allows NULL's. - */ -public static final int columnNullable = 1; - -/** - * It is unknown whether or not the column allows NULL's. - */ -public static final int columnNullableUnknown = 2; - -/*************************************************************************/ - -/** - * This method returns the number of columns in the result set. - * - * @return The number of columns in the result set. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getColumnCount() throws SQLException; - -/*************************************************************************/ - -/** - * This method test whether or not the column is an auto-increment column. - * Auto-increment columns are read-only. - * - * @param index The index of the column to test. - * - * @return true if the column is auto-increment, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isAutoIncrement(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not a column is case sensitive in its values. - * - * @param index The index of the column to test. - * - * @return true if the column value is case sensitive, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isCaseSensitive(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether not the specified column can be used in - * a WHERE clause. - * - * @param index The index of the column to test. - * - * @return true if the column may be used in a WHERE clause, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isSearchable(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the column stores a monetary value. - * - * @param index The index of the column to test. - * - * @return true if the column contains a monetary value, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isCurrency(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a value indicating whether or not the specified - * column may contain a NULL value. - * - * @param index The index of the column to test. - * - * @return A constant indicating whether or not the column can contain NULL, - * which will be one of columnNoNulls, - * columnNullable, or columnNullableUnknown. - * - * @exception SQLException If an error occurs. - */ -public abstract int -isNullable(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the value of the specified column - * is signed or unsigned. - * - * @param index The index of the column to test. - * - * @return true if the column value is signed, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isSigned(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum number of characters that can be used - * to display a value in this column. - * - * @param index The index of the column to check. - * - * @return The maximum number of characters that can be used to display a - * value for this column. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getColumnDisplaySize(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns a string that should be used as a caption for this - * column for user display purposes. - * - * @param index The index of the column to check. - * - * @return A display string for the column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getColumnLabel(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the specified column. - * - * @param index The index of the column to return the name of. - * - * @return The name of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getColumnName(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the schema that contains the specified - * column. - * - * @param index The index of the column to check the schema name for. - * - * @return The name of the schema that contains the column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSchemaName(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the precision of the specified column, which is the - * number of decimal digits it contains. - * - * @param index The index of the column to check the precision on. - * - * @return The precision of the specified column. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getPrecision(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the scale of the specified column, which is the - * number of digits to the right of the decimal point. - * - * @param index The index column to check the scale of. - * - * @return The scale of the column. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getScale(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the table containing the specified - * column. - * - * @param index The index of the column to check the table name for. - * - * @return The name of the table containing the column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getTableName(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the catalog containing the specified - * column. - * - * @param index The index of the column to check the catalog name for. - * - * @return The name of the catalog containing the column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getCatalogName(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the SQL type of the specified column. This will - * be one of the constants from Types. - * - * @param index The index of the column to check the SQL type of. - * - * @return The SQL type for this column. - * - * @exception SQLException If an error occurs. - * - * @see Types - */ -public abstract int -getColumnType(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the SQL type for this column. - * - * @param index The index of the column to check the SQL type name for. - * - * @return The name of the SQL type for this column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getColumnTypeName(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the specified column is read only. - * - * @param index The index of the column to check. - * - * @return true if the column is read only, false - * otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isReadOnly(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the column may be writable. This - * does not guarantee that a write will be successful. - * - * @param index The index of the column to check for writability. - * - * @return true if the column may be writable, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isWritable(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the column is writable. This - * does guarantee that a write will be successful. - * - * @param index The index of the column to check for writability. - * - * @return true if the column is writable, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -isDefinitelyWritable(int index) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the name of the Java class which will be used to - * create objects representing the data in this column. - * - * @param index The index of the column to check. - * - * @return The name of the Java class that will be used for values in - * this column. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getColumnClassName(int index) throws SQLException; - -} // interface ResultSetMetaData - + /** + * The column does not allow NULL's. + */ + public static final int columnNoNulls = 0; + + /** + * The column allows NULL's. + */ + public static final int columnNullable = 1; + + /** + * It is unknown whether or not the column allows NULL's. + */ + public static final int columnNullableUnknown = 2; + + /** + * This method returns the number of columns in the result set. + * + * @return The number of columns in the result set. + * @exception SQLException If an error occurs. + */ + public int getColumnCount() throws SQLException; + + /** + * This method test whether or not the column is an auto-increment column. + * Auto-increment columns are read-only. + * + * @param index The index of the column to test. + * @return true if the column is auto-increment, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isAutoIncrement(int column) throws SQLException; + + /** + * This method tests whether or not a column is case sensitive in its values. + * + * @param index The index of the column to test. + * @return true if the column value is case sensitive, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isCaseSensitive(int column) throws SQLException; + + /** + * This method tests whether not the specified column can be used in + * a WHERE clause. + * + * @param index The index of the column to test. + * @return true if the column may be used in a WHERE clause, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isSearchable(int column) throws SQLException; + + /** + * This method tests whether or not the column stores a monetary value. + * + * @param index The index of the column to test. + * @return true if the column contains a monetary value, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isCurrency(int column) throws SQLException; + + /** + * This method returns a value indicating whether or not the specified + * column may contain a NULL value. + * + * @param index The index of the column to test. + * @return A constant indicating whether or not the column can contain NULL, + * which will be one of columnNoNulls, + * columnNullable, or columnNullableUnknown. + * @exception SQLException If an error occurs. + */ + public int isNullable(int column) throws SQLException; + + /** + * This method tests whether or not the value of the specified column + * is signed or unsigned. + * + * @param index The index of the column to test. + * @return true if the column value is signed, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isSigned(int column) throws SQLException; + + /** + * This method returns the maximum number of characters that can be used + * to display a value in this column. + * + * @param index The index of the column to check. + * @return The maximum number of characters that can be used to display a + * value for this column. + * @exception SQLException If an error occurs. + */ + public int getColumnDisplaySize(int column) throws SQLException; + + /** + * This method returns a string that should be used as a caption for this + * column for user display purposes. + * + * @param index The index of the column to check. + * @return A display string for the column. + * @exception SQLException If an error occurs. + */ + public String getColumnLabel(int column) throws SQLException; + + /** + * This method returns the name of the specified column. + * + * @param index The index of the column to return the name of. + * @return The name of the column. + * @exception SQLException If an error occurs. + */ + public String getColumnName(int column) throws SQLException; + + /** + * This method returns the name of the schema that contains the specified + * column. + * + * @param index The index of the column to check the schema name for. + * @return The name of the schema that contains the column. + * @exception SQLException If an error occurs. + */ + public String getSchemaName(int column) throws SQLException; + + /** + * This method returns the precision of the specified column, which is the + * number of decimal digits it contains. + * + * @param index The index of the column to check the precision on. + * @return The precision of the specified column. + * @exception SQLException If an error occurs. + */ + public int getPrecision(int column) throws SQLException; + + /** + * This method returns the scale of the specified column, which is the + * number of digits to the right of the decimal point. + * + * @param index The index column to check the scale of. + * @return The scale of the column. + * @exception SQLException If an error occurs. + */ + public int getScale(int column) throws SQLException; + + /** + * This method returns the name of the table containing the specified + * column. + * + * @param index The index of the column to check the table name for. + * @return The name of the table containing the column. + * @exception SQLException If an error occurs. + */ + public String getTableName(int column) throws SQLException; + + /** + * This method returns the name of the catalog containing the specified + * column. + * + * @param index The index of the column to check the catalog name for. + * @return The name of the catalog containing the column. + * @exception SQLException If an error occurs. + */ + public String getCatalogName(int column) throws SQLException; + + /** + * This method returns the SQL type of the specified column. This will + * be one of the constants from Types. + * + * @param index The index of the column to check the SQL type of. + * @return The SQL type for this column. + * @exception SQLException If an error occurs. + * @see Types + */ + public int getColumnType(int column) throws SQLException; + + /** + * This method returns the name of the SQL type for this column. + * + * @param index The index of the column to check the SQL type name for. + * @return The name of the SQL type for this column. + * @exception SQLException If an error occurs. + */ + public String getColumnTypeName(int column) throws SQLException; + + /** + * This method tests whether or not the specified column is read only. + * + * @param index The index of the column to check. + * @return true if the column is read only, false + * otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isReadOnly(int column) throws SQLException; + + /** + * This method tests whether or not the column may be writable. This + * does not guarantee that a write will be successful. + * + * @param index The index of the column to check for writability. + * @return true if the column may be writable, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isWritable(int column) throws SQLException; + + /** + * This method tests whether or not the column is writable. This + * does guarantee that a write will be successful. + * + * @param index The index of the column to check for writability. + * @return true if the column is writable, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean isDefinitelyWritable(int column) throws SQLException; + + /** + * This method returns the name of the Java class which will be used to + * create objects representing the data in this column. + * + * @param index The index of the column to check. + * @return The name of the Java class that will be used for values in + * this column. + * @exception SQLException If an error occurs. + */ + public String getColumnClassName(int column) throws SQLException; +} diff --git a/libjava/java/sql/SQLData.java b/libjava/java/sql/SQLData.java index 3980d6f3713..1d1c205ec56 100644 --- a/libjava/java/sql/SQLData.java +++ b/libjava/java/sql/SQLData.java @@ -39,47 +39,34 @@ exception statement from your version. */ package java.sql; /** - * This interface is used for mapping SQL data to user defined datatypes. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface SQLData + * This interface is used for mapping SQL data to user defined datatypes. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface SQLData { + /** + * This method returns the user defined datatype name for this object. + * + * @return The user defined data type name for this object. + * @exception SQLException If an error occurs. + */ + public String getSQLTypeName() throws SQLException; -/** - * This method returns the user defined datatype name for this object. - * - * @return The user defined data type name for this object. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSQLTypeName() throws SQLException; - -/*************************************************************************/ - -/** - * This method populates the data in the object from the specified stream. - * - * @param stream The stream to read the data from. - * @param name The data type name of the data on the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -readSQL(SQLInput stream, String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the data in this object to the specified stream. - * - * @param stream The stream to write the data to. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeSQL(SQLOutput stream) throws SQLException; - -} // interface SQLData + /** + * This method populates the data in the object from the specified stream. + * + * @param stream The stream to read the data from. + * @param name The data type name of the data on the stream. + * @exception SQLException If an error occurs. + */ + public void readSQL(SQLInput stream, String typeName) throws SQLException; + /** + * This method writes the data in this object to the specified stream. + * + * @param stream The stream to write the data to. + * @exception SQLException If an error occurs. + */ + public void writeSQL(SQLOutput stream) throws SQLException; +} diff --git a/libjava/java/sql/SQLException.java b/libjava/java/sql/SQLException.java index fce56650fb0..892330228db 100644 --- a/libjava/java/sql/SQLException.java +++ b/libjava/java/sql/SQLException.java @@ -39,183 +39,129 @@ exception statement from your version. */ package java.sql; /** - * This exception is thrown when a database error occurs. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class SQLException extends Exception -{ - -/*************************************************************************/ - -/* - * Instance Variables + * This exception is thrown when a database error occurs. + * + * @author Aaron M. Renn (arenn@urbanophile.com) */ - -/** - * This is the next exception in the chain - * @serialized - */ -private SQLException next; - -/** - * This is the state of the SQL statement at the time of the error. - * @serialized - */ -private String SQLState; - -/** - * The vendor error code for this error - * @serialized - */ -private int vendorCode; - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 2135244094396331484L; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of SQLException - * that does not have a descriptive messages and SQL state, and which - * has a vendor error code of 0. - */ -public -SQLException() -{ - this(null, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of SQLException - * with the specified descriptive error message. The SQL state of this - * instance will be null and the vendor error code will be 0. - * - * @param message A string describing the nature of the error. - */ -public -SQLException(String message) +public class SQLException extends Exception { - this(message, null, 0); + static final long serialVersionUID = 2135244094396331484L; + + /** + * This is the next exception in the chain + */ + private SQLException next; + + /** + * This is the state of the SQL statement at the time of the error. + */ + private String SQLState; + + /** + * The vendor error code for this error + */ + private int vendorCode; + + /** + * This method initializes a nwe instance of SQLException + * with the specified descriptive error message, SQL state string, and + * vendor code. + * + * @param message A string describing the nature of the error. + * @param SQLState A string containing the SQL state of the error. + * @param vendorCode The vendor error code associated with this error. + */ + public SQLException(String message, String SQLState, int vendorCode) + { + super(message); + this.SQLState = SQLState; + this.vendorCode = vendorCode; + } + + /** + * This method initializes a new instance of SQLException + * with the specified descriptive error message and SQL state string. + * The vendor error code of this instance will be 0. + * + * @param message A string describing the nature of the error. + * @param SQLState A string containing the SQL state of the error. + */ + public SQLException(String message, String SQLState) + { + this(message, SQLState, 0); + } + + /** + * This method initializes a new instance of SQLException + * with the specified descriptive error message. The SQL state of this + * instance will be null and the vendor error code will be 0. + * + * @param message A string describing the nature of the error. + */ + public SQLException(String message) + { + this(message, null, 0); + } + + /** + * This method initializes a new instance of SQLException + * that does not have a descriptive messages and SQL state, and which + * has a vendor error code of 0. + */ + public SQLException() + { + this(null, null, 0); + } + + /** + * This method returns the SQLState information associated with this + * error. The value returned is a String which is formatted + * using the XOPEN SQL state conventions. + * + * @return The SQL state, which may be null. + */ + public String getSQLState() + { + return SQLState; + } + + /** + * This method returns the vendor specific error code associated with + * this error. + * + * @return The vendor specific error code associated with this error. + */ + public int getErrorCode() + { + return vendorCode; + } + + /** + * This method returns the exception that is chained to this object. + * + * @return The exception chained to this object, which may be + * null. + */ + public SQLException getNextException() + { + return next; + } + + /** + * This method adds a new exception to the end of the chain of exceptions + * that are chained to this object. + * + * @param e The exception to add to the end of the chain. + */ + public void setNextException(SQLException e) + { + if (e == null) + return; + + SQLException list_entry = this; + while (list_entry.getNextException() != null) + list_entry = list_entry.getNextException(); + + list_entry.next = e; + } } - -/*************************************************************************/ - -/** - * This method initializes a new instance of SQLException - * with the specified descriptive error message and SQL state string. - * The vendor error code of this instance will be 0. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - */ -public -SQLException(String message, String SQLState) -{ - this(message, SQLState, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a nwe instance of SQLException - * with the specified descriptive error message, SQL state string, and - * vendor code. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - * @param vendorCode The vendor error code associated with this error. - */ -public -SQLException(String message, String SQLState, int vendorCode) -{ - super(message); - - this.SQLState = SQLState; - this.vendorCode = vendorCode; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the SQLState information associated with this - * error. The value returned is a String which is formatted - * using the XOPEN SQL state conventions. - * - * @return The SQL state, which may be null. - */ -public String -getSQLState() -{ - return(SQLState); -} - -/*************************************************************************/ - -/** - * This method returns the vendor specific error code associated with - * this error. - * - * @return The vendor specific error code associated with this error. - */ -public int -getErrorCode() -{ - return(vendorCode); -} - -/*************************************************************************/ - -/** - * This method returns the exception that is chained to this object. - * - * @return The exception chained to this object, which may be - * null. - */ -public SQLException -getNextException() -{ - return(next); -} - -/*************************************************************************/ - -/** - * This method adds a new exception to the end of the chain of exceptions - * that are chained to this object. - * - * @param e The exception to add to the end of the chain. - */ -public void -setNextException(SQLException e) -{ - if (e == null) - return; - - SQLException list_entry = this; - while (list_entry.getNextException() != null) - list_entry = list_entry.getNextException(); - - list_entry.next = e; -} - -} // class SQLException - diff --git a/libjava/java/sql/SQLInput.java b/libjava/java/sql/SQLInput.java index bb71853b8d7..6fcec1fe4c4 100644 --- a/libjava/java/sql/SQLInput.java +++ b/libjava/java/sql/SQLInput.java @@ -1,5 +1,5 @@ /* SQLInput.java -- Read SQL values from a stream - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,303 +41,219 @@ package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.net.URL; /** - * This interface provides methods for reading values from a stream - * that is connected to a SQL structured or distinct type. It is used - * for custom mapping of user defined data types. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface SQLInput + * This interface provides methods for reading values from a stream + * that is connected to a SQL structured or distinct type. It is used + * for custom mapping of user defined data types. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface SQLInput { - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * String. - * - * @return The value read from the stream as a String. - * - * @exception SQLException If an error occurs. - */ -public abstract String -readString() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * boolean. - * - * @return The value read from the stream as a boolean. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -readBoolean() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * byte. - * - * @return The value read from the stream as a byte. - * - * @exception SQLException If an error occurs. - */ -public abstract byte -readByte() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * short. - * - * @return The value read from the stream as a short. - * - * @exception SQLException If an error occurs. - */ -public abstract short -readShort() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * int. - * - * @return The value read from the stream as an int. - * - * @exception SQLException If an error occurs. - */ -public abstract int -readInt() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * long. - * - * @return The value read from the stream as a long. - * - * @exception SQLException If an error occurs. - */ -public abstract long -readLong() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * float. - * - * @return The value read from the stream as a float. - * - * @exception SQLException If an error occurs. - */ -public abstract float -readFloat() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * double. - * - * @return The value read from the stream as a double. - * - * @exception SQLException If an error occurs. - */ -public abstract double -readDouble() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * BigDecimal. - * - * @return The value read from the stream as a BigDecimal. - * - * @exception SQLException If an error occurs. - */ -public abstract BigDecimal -readBigDecimal() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * byte array - * - * @return The value read from the stream as a byte array. - * - * @exception SQLException If an error occurs. - */ -public abstract byte[] -readBytes() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * java.sql.Date. - * - * @return The value read from the stream as a java.sql.Date. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Date -readDate() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * java.sql.Time. - * - * @return The value read from the stream as a java.sql.Time. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Time -readTime() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * java.sql.Timestamp. - * - * @return The value read from the stream as a java.sql.Timestamp. - * - * @exception SQLException If an error occurs. - */ -public abstract java.sql.Timestamp -readTimestamp() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a ASCII text - * InputStream. - * - * @return The value read from the stream as an InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -readAsciiStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a binary - * InputStream. - * - * @return The value read from the stream as an InputStream. - * - * @exception SQLException If an error occurs. - */ -public abstract InputStream -readBinaryStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a character - * Reader. - * - * @return The value read from the stream as a Reader. - * - * @exception SQLException If an error occurs. - */ -public abstract Reader -readCharacterStream() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java - * Object. - * - * @return The value read from the stream as an Object. - * - * @exception SQLException If an error occurs. - */ -public abstract Object -readObject() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java SQL - * Ref. - * - * @return The value read from the stream as an Ref. - * - * @exception SQLException If an error occurs. - */ -public abstract Ref -readRef() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java SQL - * Blob. - * - * @return The value read from the stream as a Blob. - * - * @exception SQLException If an error occurs. - */ -public abstract Blob -readBlob() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java SQL - * Clob. - * - * @return The value read from the stream as a Clob. - * - * @exception SQLException If an error occurs. - */ -public abstract Clob -readClob() throws SQLException; - -/*************************************************************************/ - -/** - * This method reads the next item from the stream a Java SQL - * Array. - * - * @return The value read from the stream as an Array. - * - * @exception SQLException If an error occurs. - */ -public abstract Array -readArray() throws SQLException; - -/*************************************************************************/ - -/** - * This method tests whether or not the last value read was a SQL - * NULL value. - * - * @return true if the last value read was a NULL, - * false otherwise. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -wasNull() throws SQLException; - -} // interface SQLInput + /** + * This method reads the next item from the stream a Java + * String. + * + * @return The value read from the stream as a String. + * @exception SQLException If an error occurs. + */ + public String readString() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * boolean. + * + * @return The value read from the stream as a boolean. + * @exception SQLException If an error occurs. + */ + public boolean readBoolean() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * byte. + * + * @return The value read from the stream as a byte. + * @exception SQLException If an error occurs. + */ + public byte readByte() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * short. + * + * @return The value read from the stream as a short. + * @exception SQLException If an error occurs. + */ + public short readShort() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * int. + * + * @return The value read from the stream as an int. + * @exception SQLException If an error occurs. + */ + public int readInt() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * long. + * + * @return The value read from the stream as a long. + * @exception SQLException If an error occurs. + */ + public long readLong() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * float. + * + * @return The value read from the stream as a float. + * @exception SQLException If an error occurs. + */ + public float readFloat() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * double. + * + * @return The value read from the stream as a double. + * @exception SQLException If an error occurs. + */ + public double readDouble() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * BigDecimal. + * + * @return The value read from the stream as a BigDecimal. + * @exception SQLException If an error occurs. + */ + public BigDecimal readBigDecimal() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * byte array + * + * @return The value read from the stream as a byte array. + * @exception SQLException If an error occurs. + */ + public byte[] readBytes() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * java.sql.Date. + * + * @return The value read from the stream as a java.sql.Date. + * @exception SQLException If an error occurs. + */ + public Date readDate() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * java.sql.Time. + * + * @return The value read from the stream as a java.sql.Time. + * @exception SQLException If an error occurs. + */ + public Time readTime() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * java.sql.Timestamp. + * + * @return The value read from the stream as a java.sql.Timestamp. + * @exception SQLException If an error occurs. + */ + public Timestamp readTimestamp() throws SQLException; + + /** + * This method reads the next item from the stream a character + * Reader. + * + * @return The value read from the stream as a Reader. + * @exception SQLException If an error occurs. + */ + public Reader readCharacterStream() throws SQLException; + + /** + * This method reads the next item from the stream a ASCII text + * InputStream. + * + * @return The value read from the stream as an InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream readAsciiStream() throws SQLException; + + /** + * This method reads the next item from the stream a binary + * InputStream. + * + * @return The value read from the stream as an InputStream. + * @exception SQLException If an error occurs. + */ + public InputStream readBinaryStream() throws SQLException; + + /** + * This method reads the next item from the stream a Java + * Object. + * + * @return The value read from the stream as an Object. + * @exception SQLException If an error occurs. + */ + public Object readObject() throws SQLException; + + /** + * This method reads the next item from the stream a Java SQL + * Ref. + * + * @return The value read from the stream as an Ref. + * @exception SQLException If an error occurs. + */ + public Ref readRef() throws SQLException; + + /** + * This method reads the next item from the stream a Java SQL + * Blob. + * + * @return The value read from the stream as a Blob. + * @exception SQLException If an error occurs. + */ + public Blob readBlob() throws SQLException; + + /** + * This method reads the next item from the stream a Java SQL + * Clob. + * + * @return The value read from the stream as a Clob. + * @exception SQLException If an error occurs. + */ + public Clob readClob() throws SQLException; + + /** + * This method reads the next item from the stream a Java SQL + * Array. + * + * @return The value read from the stream as an Array. + * @exception SQLException If an error occurs. + */ + public Array readArray() throws SQLException; + + /** + * This method tests whether or not the last value read was a SQL + * NULL value. + * + * @return true if the last value read was a NULL, + * false otherwise. + * @exception SQLException If an error occurs. + */ + public boolean wasNull() throws SQLException; + + /** + * @since 1.4 + */ + public URL readURL() throws SQLException; +} diff --git a/libjava/java/sql/SQLOutput.java b/libjava/java/sql/SQLOutput.java index d2dc71d7e50..730e0c05892 100644 --- a/libjava/java/sql/SQLOutput.java +++ b/libjava/java/sql/SQLOutput.java @@ -1,5 +1,5 @@ /* SQLOutput.java -- Write SQL values to a stream - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,302 +41,217 @@ package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.net.URL; /** - * This interface provides methods for writing Java types to a SQL stream. - * It is used for implemented custom type mappings for user defined data - * types. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface SQLOutput + * This interface provides methods for writing Java types to a SQL stream. + * It is used for implemented custom type mappings for user defined data + * types. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface SQLOutput { - -/*************************************************************************/ - -/** - * This method writes the specified Java String - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeString(String value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java boolean - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeBoolean(boolean value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java byte - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeByte(byte value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java short - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeShort(short value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java int - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeInt(int value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java long - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeLong(long value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java float - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeFloat(float value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java double - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeDouble(double value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java BigDecimal - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeBigDecimal(BigDecimal value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java byte array - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeBytes(byte[] value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java java.sql.Date - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeDate(java.sql.Date value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java java.sql.Time - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeTime(java.sql.Time value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java java.sql.Timestamp - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeTimestamp(java.sql.Timestamp value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java character stream - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeCharacterStream(Reader value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified uninterpreted binary byte stream - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeBinaryStream(InputStream value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified ASCII text stream - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeAsciiStream(InputStream value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQLData object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeObject(SQLData value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQL Ref object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeRef(Ref value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQL Blob object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeBlob(Blob value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQL Clob object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeClob(Clob value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQL Struct object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeStruct(Struct value) throws SQLException; - -/*************************************************************************/ - -/** - * This method writes the specified Java SQL Array object - * to the SQL stream. - * - * @param value The value to write to the stream. - * - * @exception SQLException If an error occurs. - */ -public abstract void -writeArray(Array value) throws SQLException; - -} // interface SQLOutput - + /** + * This method writes the specified Java String + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeString(String x) throws SQLException; + + /** + * This method writes the specified Java boolean + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeBoolean(boolean x) throws SQLException; + + /** + * This method writes the specified Java byte + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeByte(byte x) throws SQLException; + + /** + * This method writes the specified Java short + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeShort(short x) throws SQLException; + + /** + * This method writes the specified Java int + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeInt(int x) throws SQLException; + + /** + * This method writes the specified Java long + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeLong(long x) throws SQLException; + + /** + * This method writes the specified Java float + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeFloat(float x) throws SQLException; + + /** + * This method writes the specified Java double + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeDouble(double x) throws SQLException; + + /** + * This method writes the specified Java BigDecimal + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeBigDecimal(BigDecimal x) throws SQLException; + + /** + * This method writes the specified Java byte array + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeBytes(byte[] x) throws SQLException; + + /** + * This method writes the specified Java java.sql.Date + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeDate(Date x) throws SQLException; + + /** + * This method writes the specified Java java.sql.Time + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeTime(Time x) throws SQLException; + + /** + * This method writes the specified Java java.sql.Timestamp + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeTimestamp(Timestamp x) throws SQLException; + + /** + * This method writes the specified Java character stream + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeCharacterStream(Reader x) throws SQLException; + + /** + * This method writes the specified ASCII text stream + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeAsciiStream(InputStream x) throws SQLException; + + /** + * This method writes the specified uninterpreted binary byte stream + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeBinaryStream(InputStream x) throws SQLException; + + /** + * This method writes the specified Java SQLData object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeObject(SQLData x) throws SQLException; + + /** + * This method writes the specified Java SQL Ref object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeRef(Ref x) throws SQLException; + + /** + * This method writes the specified Java SQL Blob object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeBlob(Blob x) throws SQLException; + + /** + * This method writes the specified Java SQL Clob object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeClob(Clob x) throws SQLException; + + /** + * This method writes the specified Java SQL Struct object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeStruct(Struct x) throws SQLException; + + /** + * This method writes the specified Java SQL Array object + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeArray(Array x) throws SQLException; + + /** + * @since 1.4 + */ + public void writeURL(URL x) throws SQLException; +} diff --git a/libjava/java/sql/SQLPermission.java b/libjava/java/sql/SQLPermission.java new file mode 100644 index 00000000000..10c6d78714f --- /dev/null +++ b/libjava/java/sql/SQLPermission.java @@ -0,0 +1,57 @@ +/* SQLPermission.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.sql; + +import java.security.BasicPermission; + +/** + * @since 1.3 + */ +public final class SQLPermission extends BasicPermission +{ + public SQLPermission(String name) + { + super(name); + } + + public SQLPermission(String name, String actions) + { + super(name, actions); + } +} diff --git a/libjava/java/sql/SQLWarning.java b/libjava/java/sql/SQLWarning.java index 1a74ae0282a..fafb9b7c5ff 100644 --- a/libjava/java/sql/SQLWarning.java +++ b/libjava/java/sql/SQLWarning.java @@ -1,5 +1,5 @@ /* SQLWarning.java -- Database access warnings. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,120 +39,82 @@ exception statement from your version. */ package java.sql; /** - * This exception is thrown when a database warning occurs. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class SQLWarning extends SQLException -{ - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 3917336774604784856L; - -/*************************************************************************/ - -/* - * Constructors + * This exception is thrown when a database warning occurs. + * + * @author Aaron M. Renn (arenn@urbanophile.com) */ - -/** - * This method initializes a new instance of SQLWarning - * that does not have a descriptive messages and SQL state, and which - * has a vendor error code of 0. - */ -public -SQLWarning() -{ - this(null, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of SQLWarning - * with the specified descriptive error message. The SQL state of this - * instance will be null and the vendor error code will be 0. - * - * @param message A string describing the nature of the error. - */ -public -SQLWarning(String message) -{ - this(message, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of SQLWarning - * with the specified descriptive error message and SQL state string. - * The vendor error code of this instance will be 0. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - */ -public -SQLWarning(String message, String SQLState) +public class SQLWarning extends SQLException { - this(message, SQLState, 0); + static final long serialVersionUID = 3917336774604784856L; + + /** + * This method initializes a nwe instance of SQLWarning + * with the specified descriptive error message, SQL state string, and + * vendor code. + * + * @param message A string describing the nature of the error. + * @param SQLState A string containing the SQL state of the error. + * @param vendorCode The vendor error code associated with this error. + */ + public SQLWarning(String reason, String SQLState, int vendorCode) + { + super(reason, SQLState, vendorCode); + } + + /** + * This method initializes a new instance of SQLWarning + * with the specified descriptive error message and SQL state string. + * The vendor error code of this instance will be 0. + * + * @param message A string describing the nature of the error. + * @param SQLState A string containing the SQL state of the error. + */ + public SQLWarning(String message, String SQLState) + { + super(message, SQLState); + } + + /** + * This method initializes a new instance of SQLWarning + * with the specified descriptive error message. The SQL state of this + * instance will be null and the vendor error code will be 0. + * + * @param message A string describing the nature of the error. + */ + public SQLWarning(String message) + { + super(message); + } + + /** + * This method initializes a new instance of SQLWarning + * that does not have a descriptive messages and SQL state, and which + * has a vendor error code of 0. + */ + public SQLWarning() + { + super(); + } + + /** + * This method returns the exception that is chained to this object. + * + * @return The exception chained to this object, which may be + * null. + */ + public SQLWarning getNextWarning() + { + return (SQLWarning) super.getNextException(); + } + + /** + * This method adds a new exception to the end of the chain of exceptions + * that are chained to this object. + * + * @param w The exception to add to the end of the chain. + */ + public void setNextWarning(SQLWarning w) + { + super.setNextException(w); + } } - -/*************************************************************************/ - -/** - * This method initializes a nwe instance of SQLWarning - * with the specified descriptive error message, SQL state string, and - * vendor code. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - * @param vendorCode The vendor error code associated with this error. - */ -public -SQLWarning(String message, String SQLState, int vendorCode) -{ - super(message, SQLState, vendorCode); -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the exception that is chained to this object. - * - * @return The exception chained to this object, which may be - * null. - */ -public SQLWarning -getNextWarning() -{ - return((SQLWarning)super.getNextException()); -} - -/*************************************************************************/ - -/** - * This method adds a new exception to the end of the chain of exceptions - * that are chained to this object. - * - * @param e The exception to add to the end of the chain. - */ -public void -setNextWarning(SQLWarning e) -{ - super.setNextException(e); -} - -} // class SQLWarning - diff --git a/libjava/java/sql/Savepoint.java b/libjava/java/sql/Savepoint.java new file mode 100644 index 00000000000..f9b839ba8c7 --- /dev/null +++ b/libjava/java/sql/Savepoint.java @@ -0,0 +1,55 @@ +/* SavePoint.java -- Returns information about the ResultSet + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.sql; + +/** + * @since 1.4 + */ +public interface Savepoint +{ + /** + * @since 1.4 + */ + public int getSavepointId() throws SQLException; + + /** + * @since 1.4 + */ + public String getSavepointName() throws SQLException; +} diff --git a/libjava/java/sql/Statement.java b/libjava/java/sql/Statement.java index 8c9f68bde20..fd8a99950d2 100644 --- a/libjava/java/sql/Statement.java +++ b/libjava/java/sql/Statement.java @@ -1,5 +1,5 @@ /* Statement.java -- Interface for executing SQL statements. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,386 +39,328 @@ exception statement from your version. */ package java.sql; /** - * This interface provides a mechanism for executing SQL statements. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Statement + * This interface provides a mechanism for executing SQL statements. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface Statement { - -/** - * This method executes the specified SQL SELECT statement and returns a - * (possibly empty) ResultSet with the results of the query. - * - * @param sql The SQL statement to execute. - * - * @return The result set of the SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract ResultSet -executeQuery(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method executes the specified SQL INSERT, UPDATE, or DELETE statement - * and returns the number of rows affected, which may be 0. - * - * @param sql The SQL statement to execute. - * - * @return The number of rows affected by the SQL statement. - * - * @exception SQLException If an error occurs. - */ -public abstract int -executeUpdate(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method closes the statement and frees any associated resources. - * - * @exception SQLException If an error occurs. - */ -public abstract void -close() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum length of any column value in bytes. - * - * @return The maximum length of any column value in bytes. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxFieldSize() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the limit for the maximum length of any column in bytes. - * - * @param maxsize The new maximum length of any column in bytes. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setMaxFieldSize(int maxsize) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the maximum possible number of rows in a result set. - * - * @return The maximum possible number of rows in a result set. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getMaxRows() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the maximum number of rows that can be present in a - * result set. - * - * @param maxrows The maximum possible number of rows in a result set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setMaxRows(int maxrows) throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the local escape processing mode on or off. The - * default value is on. - * - * @param escape true to enable local escape processing, - * false to disable it. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setEscapeProcessing(boolean esacpe) throws SQLException; - -/*************************************************************************/ - -/** - * The method returns the number of seconds a statement may be in process - * before timing out. A value of 0 means there is no timeout. - * - * @return The SQL statement timeout in seconds. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getQueryTimeout() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the number of seconds a statement may be in process - * before timing out. A value of 0 means there is no timeout. - * - * @param timeout The new SQL statement timeout value. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setQueryTimeout(int timeout) throws SQLException; - -/*************************************************************************/ - -/** - * This method cancels an outstanding statement, if the database supports - * that operation. - * - * @exception SQLException If an error occurs. - */ -public abstract void -cancel() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the first SQL warning attached to this statement. - * Subsequent warnings will be chained to this one. - * - * @return The first SQL warning for this statement. - * - * @exception SQLException If an error occurs. - */ -public abstract SQLWarning -getWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method clears any SQL warnings that have been attached to this - * statement. - * - * @exception SQLException If an error occurs. - */ -public abstract void -clearWarnings() throws SQLException; - -/*************************************************************************/ - -/** - * This method sets the cursor name that will be used by the result set. - * - * @param name The cursor name to use for this statement. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setCursorName(String name) throws SQLException; - -/*************************************************************************/ - -/** - * This method executes an arbitrary SQL statement of any time. The - * methods getResultSet, getMoreResults and - * getUpdateCount retrieve the results. - * - * @return true if a result set was returned, false - * if an update count was returned. - * - * @exception SQLException If an error occurs. - */ -public abstract boolean -execute(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the result set of the SQL statement that was - * executed. This should be called only once per result set returned. - * - * @return The result set of the query, or null if there was - * no result set (for example, if the statement was an UPDATE). - * - * @exception SQLException If an error occurs. - * - * @see execute - */ -public abstract ResultSet -getResultSet() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the update count of the SQL statement that was - * executed. This should be called only once per executed SQL statement. - * - * @return The update count of the query, or -1 if there was no update - * count (for example, if the statement was a SELECT). - * - * @exception SQLException If an error occurs. - * - * @see execute - */ -public abstract int -getUpdateCount() throws SQLException; - -/*************************************************************************/ - -/** - * This method advances the result set pointer to the next result set, - * which can then be retrieved using getResultSet - * - * @return true if there is another result set, - * false otherwise (for example, the next result is an - * update count). - * - * @exception SQLException If an error occurs. - * - * @see execute - */ -public abstract boolean -getMoreResults() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the current direction that the driver thinks the - * result set will be accessed int. - * - * @return The direction the result set will be accessed in (????) - * - * @exception SQLException If an error occurs. - */ -public abstract int -getFetchDirection() throws SQLException; - -/*************************************************************************/ - -/** - * This method informs the driver which direction the result set will - * be accessed in. - * - * @param direction The direction the result set will be accessed in (?????) - * - * @exception SQLException If an error occurs. - */ -public abstract void -setFetchDirection(int direction) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the number of rows the driver believes should be - * fetched from the database at a time. - * - * @return The number of rows that will be fetched from the database at a time. - * - * @exception SQLException If an error occurs. - */ -public abstract int -getFetchSize() throws SQLException; - -/*************************************************************************/ - -/** - * This method informs the driver how many rows it should fetch from the - * database at a time. - * - * @param numrows The number of rows the driver should fetch at a time - * to populate the result set. - * - * @exception SQLException If an error occurs. - */ -public abstract void -setFetchSize(int numrows) throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the concurrency type of the result set for this - * statement. This will be one of the concurrency types defined in - * ResultSet. - * - * @return The concurrency type of the result set for this statement. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract int -getResultSetConcurrency() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the result set type for this statement. This will - * be one of the result set types defined in ResultSet. - * - * @return The result set type for this statement. - * - * @exception SQLException If an error occurs. - * - * @see ResultSet - */ -public abstract int -getResultSetType() throws SQLException; - -/*************************************************************************/ - -/** - * This method adds a SQL statement to a SQL batch. A driver is not - * required to implement this method. - * - * @param sql The sql statement to add to the batch. - * - * @exception SQLException If an error occurs. - */ -public abstract void -addBatch(String sql) throws SQLException; - -/*************************************************************************/ - -/** - * This method clears out any SQL statements that have been populated in - * the current batch. A driver is not required to implement this method. - * - * @exception SQLException If an error occurs. - */ -public abstract void -clearBatch() throws SQLException; - -/*************************************************************************/ - -/** - * This method executes the SQL batch and returns an array of update - * counts - one for each SQL statement in the batch - ordered in the same - * order the statements were added to the batch. A driver is not required - * to implement this method. - * - * @return An array of update counts for this batch. - * - * @exception SQLException If an error occurs. - */ -public abstract int[] -executeBatch() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the Connection instance that was - * used to create this object. - * - * @return The connection used to create this object. - * - * @exception SQLException If an error occurs. - */ -public abstract Connection -getConnection() throws SQLException; - -} // interface Statement - + public static final int CLOSE_CURRENT_RESULT = 1; + public static final int KEEP_CURRENT_RESULT = 2; + public static final int CLOSE_ALL_RESULTS = 3; + public static final int SUCCESS_NO_INFO = -2; + public static final int EXECUTE_FAILED = -3; + public static final int RETURN_GENERATED_KEYS = 1; + public static final int NO_GENERATED_KEYS = 2; + + /** + * This method executes the specified SQL SELECT statement and returns a + * (possibly empty) ResultSet with the results of the query. + * + * @param sql The SQL statement to execute. + * @return The result set of the SQL statement. + * @exception SQLException If an error occurs. + */ + public ResultSet executeQuery(String sql) throws SQLException; + + /** + * This method executes the specified SQL INSERT, UPDATE, or DELETE statement + * and returns the number of rows affected, which may be 0. + * + * @param sql The SQL statement to execute. + * @return The number of rows affected by the SQL statement. + * @exception SQLException If an error occurs. + */ + public int executeUpdate(String sql) throws SQLException; + + /** + * This method closes the statement and frees any associated resources. + * + * @exception SQLException If an error occurs. + */ + public void close() throws SQLException; + + /** + * This method returns the maximum length of any column value in bytes. + * + * @return The maximum length of any column value in bytes. + * @exception SQLException If an error occurs. + */ + public int getMaxFieldSize() throws SQLException; + + /** + * This method sets the limit for the maximum length of any column in bytes. + * + * @param maxsize The new maximum length of any column in bytes. + * @exception SQLException If an error occurs. + */ + public void setMaxFieldSize(int max) throws SQLException; + + /** + * This method returns the maximum possible number of rows in a result set. + * + * @return The maximum possible number of rows in a result set. + * @exception SQLException If an error occurs. + */ + public int getMaxRows() throws SQLException; + + /** + * This method sets the maximum number of rows that can be present in a + * result set. + * + * @param maxrows The maximum possible number of rows in a result set. + * @exception SQLException If an error occurs. + */ + public void setMaxRows(int max) throws SQLException; + + /** + * This method sets the local escape processing mode on or off. The + * default value is on. + * + * @param escape true to enable local escape processing, + * false to disable it. + * @exception SQLException If an error occurs. + */ + public void setEscapeProcessing(boolean enable) throws SQLException; + + /** + * The method returns the number of seconds a statement may be in process + * before timing out. A value of 0 means there is no timeout. + * + * @return The SQL statement timeout in seconds. + * @exception SQLException If an error occurs. + */ + public int getQueryTimeout() throws SQLException; + + /** + * This method sets the number of seconds a statement may be in process + * before timing out. A value of 0 means there is no timeout. + * + * @param timeout The new SQL statement timeout value. + * @exception SQLException If an error occurs. + */ + public void setQueryTimeout(int seconds) throws SQLException; + + /** + * This method cancels an outstanding statement, if the database supports + * that operation. + * + * @exception SQLException If an error occurs. + */ + public void cancel() throws SQLException; + + /** + * This method returns the first SQL warning attached to this statement. + * Subsequent warnings will be chained to this one. + * + * @return The first SQL warning for this statement. + * @exception SQLException If an error occurs. + */ + public SQLWarning getWarnings() throws SQLException; + + /** + * This method clears any SQL warnings that have been attached to this + * statement. + * + * @exception SQLException If an error occurs. + */ + public void clearWarnings() throws SQLException; + + /** + * This method sets the cursor name that will be used by the result set. + * + * @param name The cursor name to use for this statement. + * @exception SQLException If an error occurs. + */ + public void setCursorName(String name) throws SQLException; + + /** + * This method executes an arbitrary SQL statement of any time. The + * methods getResultSet, getMoreResults and + * getUpdateCount retrieve the results. + * + * @return true if a result set was returned, false + * if an update count was returned. + * @exception SQLException If an error occurs. + */ + public boolean execute(String sql) throws SQLException; + + /** + * This method returns the result set of the SQL statement that was + * executed. This should be called only once per result set returned. + * + * @return The result set of the query, or null if there was + * no result set (for example, if the statement was an UPDATE). + * @exception SQLException If an error occurs. + * @see execute + */ + public ResultSet getResultSet() throws SQLException; + + /** + * This method returns the update count of the SQL statement that was + * executed. This should be called only once per executed SQL statement. + * + * @return The update count of the query, or -1 if there was no update + * count (for example, if the statement was a SELECT). + * @exception SQLException If an error occurs. + * @see execute + */ + public int getUpdateCount() throws SQLException; + + /** + * This method advances the result set pointer to the next result set, + * which can then be retrieved using getResultSet + * + * @return true if there is another result set, + * false otherwise (for example, the next result is an + * update count). + * @exception SQLException If an error occurs. + * @see execute + */ + public boolean getMoreResults() throws SQLException; + + /** + * This method informs the driver which direction the result set will + * be accessed in. + * + * @param direction The direction the result set will be accessed in (?????) + * @exception SQLException If an error occurs. + */ + public void setFetchDirection(int direction) throws SQLException; + + /** + * This method returns the current direction that the driver thinks the + * result set will be accessed int. + * + * @return The direction the result set will be accessed in (????) + * @exception SQLException If an error occurs. + */ + public int getFetchDirection() throws SQLException; + + /** + * This method informs the driver how many rows it should fetch from the + * database at a time. + * + * @param numrows The number of rows the driver should fetch at a time + * to populate the result set. + * @exception SQLException If an error occurs. + */ + public void setFetchSize(int rows) throws SQLException; + + /** + * This method returns the number of rows the driver believes should be + * fetched from the database at a time. + * + * @return The number of rows that will be fetched from the database at a time. + * @exception SQLException If an error occurs. + */ + public int getFetchSize() throws SQLException; + + /** + * This method returns the concurrency type of the result set for this + * statement. This will be one of the concurrency types defined in + * ResultSet. + * + * @return The concurrency type of the result set for this statement. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public int getResultSetConcurrency() throws SQLException; + + /** + * This method returns the result set type for this statement. This will + * be one of the result set types defined in ResultSet. + * + * @return The result set type for this statement. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public int getResultSetType() throws SQLException; + + /** + * This method adds a SQL statement to a SQL batch. A driver is not + * required to implement this method. + * + * @param sql The sql statement to add to the batch. + * @exception SQLException If an error occurs. + */ + public void addBatch(String sql) throws SQLException; + + /** + * This method clears out any SQL statements that have been populated in + * the current batch. A driver is not required to implement this method. + * + * @exception SQLException If an error occurs. + */ + public void clearBatch() throws SQLException; + + /** + * This method executes the SQL batch and returns an array of update + * counts - one for each SQL statement in the batch - ordered in the same + * order the statements were added to the batch. A driver is not required + * to implement this method. + * + * @return An array of update counts for this batch. + * @exception SQLException If an error occurs. + */ + public int[] executeBatch() throws SQLException; + + /** + * This method returns the Connection instance that was + * used to create this object. + * + * @return The connection used to create this object. + * @exception SQLException If an error occurs. + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public boolean getMoreResults(int current) throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getGeneratedKeys() throws SQLException; + + /** + * @since 1.4 + */ + public int executeUpdate(String sql, int autoGeneratedKeys) + throws SQLException; + + /** + * @since 1.4 + */ + public int executeUpdate(String sql, int[] columnIndexes) + throws SQLException; + + /** + * @since 1.4 + */ + public int executeUpdate(String sql, String[] columnNames) + throws SQLException; + + /** + * @since 1.4 + */ + public boolean execute(String sql, int autoGeneratedKeys) + throws SQLException; + + /** + * @since 1.4 + */ + public boolean execute(String sql, int[] columnIndexes) throws SQLException; + + /** + * @since 1.4 + */ + public boolean execute(String sql, String[] columnNames) + throws SQLException; + + /** + * @since 1.4 + */ + public int getResultSetHoldability() throws SQLException; +} diff --git a/libjava/java/sql/Struct.java b/libjava/java/sql/Struct.java index 9db31ab4e75..beec072fa1d 100644 --- a/libjava/java/sql/Struct.java +++ b/libjava/java/sql/Struct.java @@ -1,5 +1,5 @@ /* Struct.java -- Mapping for a SQL structured type. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,51 +41,37 @@ package java.sql; import java.util.Map; /** - * This interface implements the standard type mapping for a SQL - * structured type. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface Struct + * This interface implements the standard type mapping for a SQL + * structured type. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface Struct { - -/** - * This method returns the name of the SQL structured type for this - * object. - * - * @return The SQL structured type name. - * - * @exception SQLException If an error occurs. - */ -public abstract String -getSQLTypeName() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the attributes of this SQL structured type. - * - * @return The attributes of this structure type. - * - * @exception SQLException If an error occurs. - */ -public abstract Object[] -getAttributes() throws SQLException; - -/*************************************************************************/ - -/** - * This method returns the attributes of this SQL structured type. - * The specified map of type mappings overrides the default mappings. - * - * @param map The map of SQL type mappings. - * - * @return The attributes of this structure type. - * - * @exception SQLException If a error occurs. - */ -public abstract Object[] -getAttributes(Map map) throws SQLException; - -} // interface Struct - + /** + * This method returns the name of the SQL structured type for this + * object. + * + * @return The SQL structured type name. + * @exception SQLException If an error occurs. + */ + public String getSQLTypeName() throws SQLException; + + /** + * This method returns the attributes of this SQL structured type. + * + * @return The attributes of this structure type. + * @exception SQLException If an error occurs. + */ + public Object[] getAttributes() throws SQLException; + + /** + * This method returns the attributes of this SQL structured type. + * The specified map of type mappings overrides the default mappings. + * + * @param map The map of SQL type mappings. + * @return The attributes of this structure type. + * @exception SQLException If a error occurs. + */ + public Object[] getAttributes(Map map) throws SQLException; +} diff --git a/libjava/java/sql/Time.java b/libjava/java/sql/Time.java index 307ccc97765..81f5d8cbf7b 100644 --- a/libjava/java/sql/Time.java +++ b/libjava/java/sql/Time.java @@ -1,5 +1,5 @@ /* Time.java -- Wrapper around java.util.Date - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,113 +41,81 @@ package java.sql; import java.text.SimpleDateFormat; /** - * This class is a wrapper around java.util.Date to allow the JDBC - * driver to identify the value as a SQL Time. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class Time extends java.util.Date -{ - -/* - * Class Variables - */ - -/** - * Used for parsing and formatting this date. - */ -private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); - -/** - * This is the serialization UID for this class. - */ -private static final long serialVersionUID = 8397324403548013681L; - -/*************************************************************************/ - -/* - * Class Methods - */ - -/** - * This method returns a new instance of this class by parsing a - * date in JDBC format into a Java date. - * - * @param str The string to parse. - * - * @return The resulting java.sql.Time value. - */ -public static Time -valueOf(String str) -{ - try - { - java.util.Date d = (java.util.Date)sdf.parseObject(str); - return(new Time(d.getTime())); - } - catch(Exception e) - { - return(null); - } -} - -/*************************************************************************/ - -/* - * Constructors + * This class is a wrapper around java.util.Date to allow the JDBC + * driver to identify the value as a SQL Time. + * + * @author Aaron M. Renn (arenn@urbanophile.com) */ - -/** - * This method initializes a new instance of this class with the - * specified year, month, and day. - * - * @param hour The hour for this Time (0-23) - * @param minute The minute for this time (0-59) - * @param second The second for this time (0-59) - * - * @deprecated - */ -public -Time(int hour, int minute, int second) -{ - super(System.currentTimeMillis()); - - setHours(hour); - setMinutes(minute); - setSeconds(second); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of this class with the - * specified time value representing the number of seconds since - * Jan 1, 1970 at 12:00 midnight GMT. - * - * @param time The time value to intialize this Time to. - */ -public -Time(long date) +public class Time extends java.util.Date { - super(date); -} - -/*************************************************************************/ - -/* - * Instance Methods - */ + static final long serialVersionUID = 8397324403548013681L; + + /** + * Used for parsing and formatting this date. + */ + private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + + + /** + * This method returns a new instance of this class by parsing a + * date in JDBC format into a Java date. + * + * @param str The string to parse. + * @return The resulting java.sql.Time value. + */ + public static Time valueOf(String str) + { + try + { + java.util.Date d = (java.util.Date) sdf.parseObject(str); + return new Time(d.getTime()); + } + catch (Exception e) + { + return null; + } + } + + /** + * This method initializes a new instance of this class with the + * specified year, month, and day. + * + * @param hour The hour for this Time (0-23) + * @param minute The minute for this time (0-59) + * @param second The second for this time (0-59) + * @deprecated + */ + public Time(int hour, int minute, int second) + { + super(System.currentTimeMillis()); + + setHours(hour); + setMinutes(minute); + setSeconds(second); + } + + /** + * This method initializes a new instance of this class with the + * specified time value representing the number of seconds since + * Jan 1, 1970 at 12:00 midnight GMT. + * + * @param time The time value to intialize this Time to. + */ + public Time(long date) + { + super(date); + } + + /** + * This method returns this date in JDBC format. + * + * @return This date as a string. + */ + public String + toString() + { + return sdf.format(this); + } -/** - * This method returns this date in JDBC format. - * - * @return This date as a string. - */ -public String -toString() -{ - return(sdf.format(this)); } -} // class Time - diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java index 742aeee46a3..c42ff3ca9e9 100644 --- a/libjava/java/sql/Timestamp.java +++ b/libjava/java/sql/Timestamp.java @@ -41,261 +41,215 @@ package java.sql; import java.text.SimpleDateFormat; /** - * This class is a wrapper around java.util.Date to allow the JDBC - * driver to identify the value as a SQL Timestamp. Note that this - * class also adds an additional field for nano-seconds, and so - * is not completely identical to java.util.Date as - * the java.sql.Date and java.sql.Time - * classes are. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This class is a wrapper around java.util.Date to allow the JDBC + * driver to identify the value as a SQL Timestamp. Note that this + * class also adds an additional field for nano-seconds, and so + * is not completely identical to java.util.Date as + * the java.sql.Date and java.sql.Time + * classes are. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public class Timestamp extends java.util.Date { + static final long serialVersionUID = 3581463369166924961L; -/* - * Class Variables - */ - -/** - * Used for parsing and formatting this date. - */ + /** + * Used for parsing and formatting this date. + */ // Millisecond will have to be close enough for now. -private static SimpleDateFormat parse_sdf = - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); - -private static SimpleDateFormat format_sdf = - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - -/** - * This is the serialization UID for this class. - */ -private static final long serialVersionUID = 3581463369166924961L; - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * @serial The nanosecond value for this object - */ -private int nanos; - -/*************************************************************************/ - -/* - * Class Methods - */ - -/** - * This method returns a new instance of this class by parsing a - * date in JDBC format into a Java date. - * - * @param str The string to parse. - * - * @return The resulting java.sql.Timestamp value. - */ -public static Timestamp -valueOf(String str) -{ - try - { - Date d = (Date)parse_sdf.parseObject(str); - return(new Timestamp(d.getTime())); - } - catch(Exception e) - { - return(null); - } -} - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of this class with the - * specified year, month, and day. - * - * @param year The year for this Timestamp (year - 1900) - * @param month The month for this Timestamp (0-11) - * @param day The day for this Timestamp (1-31) - * @param hour The hour for this Timestamp (0-23) - * @param minute The minute for this Timestamp (0-59) - * @param second The second for this Timestamp (0-59) - * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999) - * - * @deprecated - */ -public -Timestamp(int year, int month, int day, int hour, int minute, int second, - int nanos) -{ - super(year, month, day, hour, minute, second); - - this.nanos = nanos; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of this class with the - * specified time value representing the number of seconds since - * Jan 1, 1970 at 12:00 midnight GMT. - * - * @param time The time value to intialize this Time to. - */ -public -Timestamp(long date) -{ - super(date); -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns this date in JDBC format. - * - * @return This date as a string. - */ -public String -toString() -{ - return(format_sdf.format(this) + "." + getNanos()); + private static SimpleDateFormat parse_sdf = + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); + + private static SimpleDateFormat format_sdf = + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + /** + * The nanosecond value for this object + */ + private int nanos; + + /** + * This method returns a new instance of this class by parsing a + * date in JDBC format into a Java date. + * + * @param str The string to parse. + * @return The resulting java.sql.Timestamp value. + */ + public static Timestamp valueOf(String str) + { + try + { + Date d = (Date) parse_sdf.parseObject(str); + return new Timestamp(d.getTime()); + } + catch (Exception e) + { + return null; + } + } + + /** + * This method initializes a new instance of this class with the + * specified year, month, and day. + * + * @param year The year for this Timestamp (year - 1900) + * @param month The month for this Timestamp (0-11) + * @param day The day for this Timestamp (1-31) + * @param hour The hour for this Timestamp (0-23) + * @param minute The minute for this Timestamp (0-59) + * @param second The second for this Timestamp (0-59) + * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999) + * @deprecated + */ + public Timestamp(int year, int month, int day, int hour, int minute, + int second, int nanos) + { + super(year, month, day, hour, minute, second); + this.nanos = nanos; + } + + /** + * This method initializes a new instance of this class with the + * specified time value representing the number of seconds since + * Jan 1, 1970 at 12:00 midnight GMT. + * + * @param time The time value to intialize this Time to. + */ + public Timestamp(long date) + { + super(date); + } + + /** + * This method returns this date in JDBC format. + * + * @return This date as a string. + */ + public String toString() + { + return format_sdf.format(this) + "." + getNanos(); + } + + /** + * This method returns the nanosecond value for this object. + * @return The nanosecond value for this object. + */ + public int getNanos() + { + return nanos; + } + + /** + * This method sets the nanosecond value for this object. + * + * @param nanos The nanosecond value for this object. + */ + public void setNanos(int nanos) + { + this.nanos = nanos; + } + + /** + * This methods tests whether this object is earlier than the specified + * object. + * + * @param ts The other Timestamp to test against. + * @return true if this object is earlier than the other object, + * false otherwise. + */ + public boolean before(Timestamp ts) + { + if (ts.getTime() > getTime()) + return true; + + if (ts.getNanos() > getNanos()) + return true; + + return false; + } + + /** + * This methods tests whether this object is later than the specified + * object. + * + * @param ts The other Timestamp to test against. + * + * @return true if this object is later than the other object, + * false otherwise. + */ + public boolean after(Timestamp ts) + { + if (ts.getTime() < getTime()) + return true; + + if (ts.getNanos() < getNanos()) + return true; + + return false; + } + + /** + * This method these the specified Object for equality + * against this object. This will be true if an only if the specified + * object is an instance of Timestamp and has the same + * time value fields. + * + * @param obj The object to test against for equality. + * + * @return true if the specified object is equal to this + * object, false otherwise. + */ + public boolean equals(Object obj) + { + if (obj == null) + return false; + + if (!(obj instanceof Timestamp)) + return false; + + return equals((Timestamp) obj); + } + + /** + * This method tests the specified timestamp for equality against this + * object. This will be true if and only if the specified object is + * not null and contains all the same time value fields + * as this object. + * + * @param ts The Timestamp to test against for equality. + * + * @return true if the specified object is equal to this + * object, false otherwise. + */ + public boolean equals(Timestamp ts) + { + if (ts == null) + return false; + + if (ts.getTime() != getTime()) + return false; + + if (ts.getNanos() != getNanos()) + return false; + + return true; + } + + /** + * @since 1.2 + */ + /* + public int compareTo(Timestamp ts) + { + + }*/ + + /** + * @since 1.2 + *//* + public int compareTo(Object obj) + { + return compareTo((Timestamp) obj); + }*/ } - -/*************************************************************************/ - -/** - * This method returns the nanosecond value for this object. - * - * @return The nanosecond value for this object. - */ -public int -getNanos() -{ - return(nanos); -} - -/*************************************************************************/ - -/** - * This method sets the nanosecond value for this object. - * - * @param nanos The nanosecond value for this object. - */ -public void -setNanos(int nanos) -{ - this.nanos = nanos; -} - -/*************************************************************************/ - -/** - * This methods tests whether this object is earlier than the specified - * object. - * - * @param ts The other Timestamp to test against. - * - * @return true if this object is earlier than the other object, - * false otherwise. - */ -public boolean -before(Timestamp ts) -{ - if (ts.getTime() > getTime()) - return(true); - - if (ts.getNanos() > getNanos()) - return(true); - - return(false); -} - -/*************************************************************************/ - -/** - * This methods tests whether this object is later than the specified - * object. - * - * @param ts The other Timestamp to test against. - * - * @return true if this object is later than the other object, - * false otherwise. - */ -public boolean -after(Timestamp ts) -{ - if (ts.getTime() < getTime()) - return(true); - - if (ts.getNanos() < getNanos()) - return(true); - - return(false); -} - -/*************************************************************************/ - -/** - * This method these the specified Object for equality - * against this object. This will be true if an only if the specified - * object is an instance of Timestamp and has the same - * time value fields. - * - * @param obj The object to test against for equality. - * - * @return true if the specified object is equal to this - * object, false otherwise. - */ -public boolean -equals(Object obj) -{ - if (obj == null) - return(false); - - if (!(obj instanceof Timestamp)) - return(false); - - return(equals((Timestamp)obj)); -} - -/*************************************************************************/ - -/** - * This method tests the specified timestamp for equality against this - * object. This will be true if and only if the specified object is - * not null and contains all the same time value fields - * as this object. - * - * @param ts The Timestamp to test against for equality. - * - * @return true if the specified object is equal to this - * object, false otherwise. - */ -public boolean -equals(Timestamp ts) -{ - if (ts == null) - return(false); - - if (ts.getTime() != getTime()) - return(false); - - if (ts.getNanos() != getNanos()) - return(false); - - return(true); -} - -} // class Timestamp - diff --git a/libjava/java/sql/Types.java b/libjava/java/sql/Types.java index 4769dae27c6..7c4bc910763 100644 --- a/libjava/java/sql/Types.java +++ b/libjava/java/sql/Types.java @@ -39,49 +39,47 @@ exception statement from your version. */ package java.sql; /** - * This class contains constants that are used to identify SQL data types. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This class contains constants that are used to identify SQL data types. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public class Types { - -// These should be self explanatory. People need a SQL book, not -// Javadoc comments for these. - -public static final int BIT = -7; -public static final int TINYINT = -6; -public static final int SMALLINT = 5; -public static final int INTEGER = 4; -public static final int BIGINT = -5; -public static final int FLOAT = 6; -public static final int REAL = 7; -public static final int DOUBLE = 8; -public static final int NUMERIC = 2; -public static final int DECIMAL = 3; -public static final int CHAR = 1; -public static final int VARCHAR = 12; -public static final int LONGVARCHAR = -1; -public static final int DATE = 91; -public static final int TIME = 92; -public static final int TIMESTAMP = 93; -public static final int BINARY = -2; -public static final int VARBINARY = -3; -public static final int LONGVARBINARY = -4; -public static final int NULL = 0; -public static final int OTHER = 1111; -public static final int JAVA_OBJECT = 2000; -public static final int DISTINCT = 2001; -public static final int STRUCT = 2002; -public static final int ARRAY = 2003; -public static final int BLOB = 2004; -public static final int CLOB = 2005; -public static final int REF = 2006; + // These should be self explanatory. People need a SQL book, not + // Javadoc comments for these. + public static final int BIT = -7; + public static final int TINYINT = -6; + public static final int SMALLINT = 5; + public static final int INTEGER = 4; + public static final int BIGINT = -5; + public static final int FLOAT = 6; + public static final int REAL = 7; + public static final int DOUBLE = 8; + public static final int NUMERIC = 2; + public static final int DECIMAL = 3; + public static final int CHAR = 1; + public static final int VARCHAR = 12; + public static final int LONGVARCHAR = -1; + public static final int DATE = 91; + public static final int TIME = 92; + public static final int TIMESTAMP = 93; + public static final int BINARY = -2; + public static final int VARBINARY = -3; + public static final int LONGVARBINARY = -4; + public static final int NULL = 0; + public static final int OTHER = 1111; + public static final int JAVA_OBJECT = 2000; + public static final int DISTINCT = 2001; + public static final int STRUCT = 2002; + public static final int ARRAY = 2003; + public static final int BLOB = 2004; + public static final int CLOB = 2005; + public static final int REF = 2006; + public static final int DATALINK = 70; + public static final int BOOLEAN = 16; // This class can't be instantiated. - private Types () + private Types() { } - -} // class Types - +} diff --git a/libjava/javax/sql/ConnectionEvent.java b/libjava/javax/sql/ConnectionEvent.java new file mode 100644 index 00000000000..1c4b5ef5b71 --- /dev/null +++ b/libjava/javax/sql/ConnectionEvent.java @@ -0,0 +1,75 @@ +/* ConnectionEvent.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.SQLException; +import java.util.EventObject; + +/** + * @since 1.4 + */ +public class ConnectionEvent extends EventObject +{ + private SQLException sqlException; + + /** + * @since 1.4 + */ + public ConnectionEvent(PooledConnection con) + { + super(con); + } + + /** + * @since 1.4 + */ + public ConnectionEvent(PooledConnection con, SQLException ex) + { + super(con); + this.sqlException = ex; + } + + /** + * @since 1.4 + */ + public SQLException getSQLException() + { + return sqlException; + } +} diff --git a/libjava/javax/sql/ConnectionEventListener.java b/libjava/javax/sql/ConnectionEventListener.java new file mode 100644 index 00000000000..9358e694d7e --- /dev/null +++ b/libjava/javax/sql/ConnectionEventListener.java @@ -0,0 +1,57 @@ +/* ConnectionEventListener.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.util.EventListener; + +/** + * @since 1.4 + */ +public interface ConnectionEventListener extends EventListener +{ + /** + * @since 1.4 + */ + public void connectionClosed(ConnectionEvent event); + + /** + * @since 1.4 + */ + public void connectionErrorOccurred(ConnectionEvent event); +} diff --git a/libjava/javax/sql/ConnectionPoolDataSource.java b/libjava/javax/sql/ConnectionPoolDataSource.java new file mode 100644 index 00000000000..e281840bd77 --- /dev/null +++ b/libjava/javax/sql/ConnectionPoolDataSource.java @@ -0,0 +1,79 @@ +/* ConnectionPoolDataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.io.PrintWriter; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface ConnectionPoolDataSource +{ + /** + * @since 1.4 + */ + public PooledConnection getPooledConnection() throws SQLException; + + /** + * @since 1.4 + */ + public PooledConnection getPooledConnection(String user, String password) + throws SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; +} diff --git a/libjava/javax/sql/DataSource.java b/libjava/javax/sql/DataSource.java new file mode 100644 index 00000000000..05f97fd4b70 --- /dev/null +++ b/libjava/javax/sql/DataSource.java @@ -0,0 +1,80 @@ +/* DataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface DataSource +{ + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public Connection getConnection(String username, String password) + throws SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; +} diff --git a/libjava/javax/sql/PooledConnection.java b/libjava/javax/sql/PooledConnection.java new file mode 100644 index 00000000000..f76ab8c90e7 --- /dev/null +++ b/libjava/javax/sql/PooledConnection.java @@ -0,0 +1,68 @@ +/* PooledConnection.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.Connection; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface PooledConnection +{ + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public void close() throws SQLException; + + /** + * @since 1.4 + */ + public void addConnectionEventListener(ConnectionEventListener listener); + + /** + * @since 1.4 + */ + public void removeConnectionEventListener(ConnectionEventListener listener); +} diff --git a/libjava/javax/sql/RowSet.java b/libjava/javax/sql/RowSet.java new file mode 100644 index 00000000000..f5f7d9b2595 --- /dev/null +++ b/libjava/javax/sql/RowSet.java @@ -0,0 +1,361 @@ +/* RowSet.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Map; + +/** + * @since 1.4 + */ +public interface RowSet extends ResultSet +{ + /** + * @since 1.4 + */ + public String getUrl() throws SQLException; + + /** + * @since 1.4 + */ + public void setUrl(String url) throws SQLException; + + /** + * @since 1.4 + */ + public String getDataSourceName(); + + /** + * @since 1.4 + */ + public void setDataSourceName(String name) throws SQLException; + + /** + * @since 1.4 + */ + public String getUsername(); + + /** + * @since 1.4 + */ + public void setUsername(String name) throws SQLException; + + /** + * @since 1.4 + */ + public String getPassword(); + + /** + * @since 1.4 + */ + public void setPassword(String password) throws SQLException; + + /** + * @since 1.4 + */ + public int getTransactionIsolation(); + + /** + * @since 1.4 + */ + public void setTransactionIsolation(int level) throws SQLException; + + /** + * @since 1.4 + */ + public Map getTypeMap() throws SQLException; + + /** + * @since 1.4 + */ + public void setTypeMap(Map map) throws SQLException; + + /** + * @since 1.4 + */ + public String getCommand(); + + /** + * @since 1.4 + */ + public void setCommand(String cmd) throws SQLException; + + /** + * @since 1.4 + */ + public boolean isReadOnly(); + + /** + * @since 1.4 + */ + public void setReadOnly(boolean value) throws SQLException; + + /** + * @since 1.4 + */ + public int getMaxFieldSize() throws SQLException; + + /** + * @since 1.4 + */ + public void setMaxFieldSize(int max) throws SQLException; + + /** + * @since 1.4 + */ + public int getMaxRows() throws SQLException; + + /** + * @since 1.4 + */ + public void setMaxRows(int max) throws SQLException; + + /** + * @since 1.4 + */ + public boolean getEscapeProcessing() throws SQLException; + + /** + * @since 1.4 + */ + public void setEscapeProcessing(boolean enable) throws SQLException; + + /** + * @since 1.4 + */ + public int getQueryTimeout() throws SQLException; + + /** + * @since 1.4 + */ + public void setQueryTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public void setType(int type) throws SQLException; + + /** + * @since 1.4 + */ + public void setConcurrency(int concurrency) throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(int parameterIndex, int sqlType) throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(int paramIndex, int sqlType, String typeName) throws + SQLException; + + /** + * @since 1.4 + */ + public void setBoolean(int parameterIndex, boolean x) throws SQLException; + + /** + * @since 1.4 + */ + public void setByte(int parameterIndex, byte x) throws SQLException; + + /** + * @since 1.4 + */ + public void setShort(int parameterIndex, short x) throws SQLException; + + /** + * @since 1.4 + */ + public void setInt(int parameterIndex, int x) throws SQLException; + + /** + * @since 1.4 + */ + public void setLong(int parameterIndex, long x) throws SQLException; + + /** + * @since 1.4 + */ + public void setFloat(int parameterIndex, float x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDouble(int parameterIndex, double x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBigDecimal(int parameterIndex, BigDecimal x) throws + SQLException; + + /** + * @since 1.4 + */ + public void setString(int parameterIndex, String x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBytes(int parameterIndex, byte[] x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(int parameterIndex, Date x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTime(int parameterIndex, Time x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(int parameterIndex, Timestamp x) throws + SQLException; + + /** + * @since 1.4 + */ + public void setAsciiStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setBinaryStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCharacterStream(int parameterIndex, Reader reader, int + length) throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x, int targetSqlType, int + scale) throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x, int targetSqlType) + throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x) throws SQLException; + + /** + * @since 1.4 + */ + public void setRef(int i, Ref x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBlob(int i, Blob x) throws SQLException; + + /** + * @since 1.4 + */ + public void setClob(int i, Clob x) throws SQLException; + + /** + * @since 1.4 + */ + public void setArray(int i, Array x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(int parameterIndex, Date x, Calendar cal) throws + SQLException; + + /** + * @since 1.4 + */ + public void setTime(int parameterIndex, Time x, Calendar cal) throws + SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public void clearParameters() throws SQLException; + + /** + * @since 1.4 + */ + public void execute() throws SQLException; + + /** + * @since 1.4 + */ + public void addRowSetListener(RowSetListener listener); + + /** + * @since 1.4 + */ + public void removeRowSetListener(RowSetListener listener); +} diff --git a/libjava/javax/sql/RowSetEvent.java b/libjava/javax/sql/RowSetEvent.java new file mode 100644 index 00000000000..357e999ac5f --- /dev/null +++ b/libjava/javax/sql/RowSetEvent.java @@ -0,0 +1,52 @@ +/* RowSetEvent.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.util.EventObject; + +/** + * @since 1.4 + */ +public class RowSetEvent extends EventObject +{ + public RowSetEvent(RowSet source) + { + super(source); + } +} diff --git a/libjava/javax/sql/RowSetInternal.java b/libjava/javax/sql/RowSetInternal.java new file mode 100644 index 00000000000..1fd900bda85 --- /dev/null +++ b/libjava/javax/sql/RowSetInternal.java @@ -0,0 +1,74 @@ +/* RowSetInternal.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface RowSetInternal +{ + /** + * @since 1.4 + */ + public Object[] getParams() throws SQLException; + + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public void setMetaData(RowSetMetaData md) throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getOriginal() throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getOriginalRow() throws SQLException; +} diff --git a/libjava/javax/sql/RowSetListener.java b/libjava/javax/sql/RowSetListener.java new file mode 100644 index 00000000000..a29623714a4 --- /dev/null +++ b/libjava/javax/sql/RowSetListener.java @@ -0,0 +1,62 @@ +/* RowSetListener.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.util.EventListener; + +/** + * @since 1.4 + */ +public interface RowSetListener extends EventListener +{ + /** + * @since 1.4 + */ + public void rowSetChanged(RowSetEvent event); + + /** + * @since 1.4 + */ + public void rowChanged(RowSetEvent event); + + /** + * @since 1.4 + */ + public void cursorMoved(RowSetEvent event); +} diff --git a/libjava/javax/sql/RowSetMetaData.java b/libjava/javax/sql/RowSetMetaData.java new file mode 100644 index 00000000000..9e667f6b97d --- /dev/null +++ b/libjava/javax/sql/RowSetMetaData.java @@ -0,0 +1,147 @@ +/* RowSetMetaData.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.ResultSetMetaData; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface RowSetMetaData extends ResultSetMetaData +{ + + /** + * @since 1.4 + */ + public void setColumnCount(int columnCount) throws SQLException; + + /** + * @since 1.4 + */ + public void setAutoIncrement(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCaseSensitive(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setSearchable(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCurrency(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setNullable(int columnIndex, int property) throws SQLException; + + /** + * @since 1.4 + */ + public void setSigned(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnDisplaySize(int columnIndex, int size) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnLabel(int columnIndex, String label) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnName(int columnIndex, String columnName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setSchemaName(int columnIndex, String schemaName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setPrecision(int columnIndex, int precision) + throws SQLException; + + /** + * @since 1.4 + */ + public void setScale(int columnIndex, int scale) throws SQLException; + + /** + * @since 1.4 + */ + public void setTableName(int columnIndex, String tableName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCatalogName(int columnIndex, String catalogName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnType(int columnIndex, int SQLType) throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnTypeName(int columnIndex, String typeName) + throws SQLException; +} diff --git a/libjava/javax/sql/RowSetReader.java b/libjava/javax/sql/RowSetReader.java new file mode 100644 index 00000000000..d3000c01c66 --- /dev/null +++ b/libjava/javax/sql/RowSetReader.java @@ -0,0 +1,52 @@ +/* RowSetReader.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface RowSetReader +{ + /** + * @since 1.4 + */ + public void readData(RowSetInternal caller) throws SQLException; +} diff --git a/libjava/javax/sql/RowSetWriter.java b/libjava/javax/sql/RowSetWriter.java new file mode 100644 index 00000000000..4f5c0c2a789 --- /dev/null +++ b/libjava/javax/sql/RowSetWriter.java @@ -0,0 +1,52 @@ +/* RowSetWriter.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface RowSetWriter +{ + /** + * @since 1.4 + */ + public boolean writeData(RowSetInternal caller) throws SQLException; +} diff --git a/libjava/javax/sql/XAConnection.java b/libjava/javax/sql/XAConnection.java new file mode 100644 index 00000000000..3c28c1740d8 --- /dev/null +++ b/libjava/javax/sql/XAConnection.java @@ -0,0 +1,53 @@ +/* XAConnection.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.sql.SQLException; +import javax.transaction.xa.XAResource; + +/** + * @since 1.4 + */ +public interface XAConnection extends PooledConnection +{ + /** + * @since 1.4 + */ + public XAResource getXAResource() throws SQLException; +} diff --git a/libjava/javax/sql/XADataSource.java b/libjava/javax/sql/XADataSource.java new file mode 100644 index 00000000000..1d552ddda77 --- /dev/null +++ b/libjava/javax/sql/XADataSource.java @@ -0,0 +1,79 @@ +/* XADataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.sql; + +import java.io.PrintWriter; +import java.sql.SQLException; + +/** + * @since 1.4 + */ +public interface XADataSource +{ + /** + * @since 1.4 + */ + public XAConnection getXAConnection() throws SQLException; + + /** + * @since 1.4 + */ + public XAConnection getXAConnection(String user, String password) throws + SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; +} -- 2.11.0