Commit f2390fad by Bryce McKinlay Committed by 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.

From-SVN: r54871
parent 00b94a44
2002-06-21 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
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 <tromey@redhat.com> 2002-06-20 Tom Tromey <tromey@redhat.com>
For PR libgcj/7073: For PR libgcj/7073:
......
...@@ -997,6 +997,20 @@ javax/naming/ldap/UnsolicitedNotification.java \ ...@@ -997,6 +997,20 @@ javax/naming/ldap/UnsolicitedNotification.java \
javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationEvent.java \
javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \
javax/naming/OperationNotSupportedException.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/XAException.java \
javax/transaction/xa/XAResource.java \ javax/transaction/xa/XAResource.java \
javax/transaction/xa/Xid.java \ javax/transaction/xa/Xid.java \
...@@ -1604,14 +1618,17 @@ java/sql/Date.java \ ...@@ -1604,14 +1618,17 @@ java/sql/Date.java \
java/sql/Driver.java \ java/sql/Driver.java \
java/sql/DriverManager.java \ java/sql/DriverManager.java \
java/sql/DriverPropertyInfo.java \ java/sql/DriverPropertyInfo.java \
java/sql/ParameterMetaData.java \
java/sql/PreparedStatement.java \ java/sql/PreparedStatement.java \
java/sql/Ref.java \ java/sql/Ref.java \
java/sql/ResultSet.java \ java/sql/ResultSet.java \
java/sql/ResultSetMetaData.java \ java/sql/ResultSetMetaData.java \
java/sql/Savepoint.java \
java/sql/SQLData.java \ java/sql/SQLData.java \
java/sql/SQLException.java \ java/sql/SQLException.java \
java/sql/SQLInput.java \ java/sql/SQLInput.java \
java/sql/SQLOutput.java \ java/sql/SQLOutput.java \
java/sql/SQLPermission.java \
java/sql/SQLWarning.java \ java/sql/SQLWarning.java \
java/sql/Statement.java \ java/sql/Statement.java \
java/sql/Struct.java \ java/sql/Struct.java \
......
...@@ -768,6 +768,20 @@ javax/naming/ldap/UnsolicitedNotification.java \ ...@@ -768,6 +768,20 @@ javax/naming/ldap/UnsolicitedNotification.java \
javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationEvent.java \
javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \
javax/naming/OperationNotSupportedException.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/XAException.java \
javax/transaction/xa/XAResource.java \ javax/transaction/xa/XAResource.java \
javax/transaction/xa/Xid.java \ javax/transaction/xa/Xid.java \
...@@ -1366,14 +1380,17 @@ java/sql/Date.java \ ...@@ -1366,14 +1380,17 @@ java/sql/Date.java \
java/sql/Driver.java \ java/sql/Driver.java \
java/sql/DriverManager.java \ java/sql/DriverManager.java \
java/sql/DriverPropertyInfo.java \ java/sql/DriverPropertyInfo.java \
java/sql/ParameterMetaData.java \
java/sql/PreparedStatement.java \ java/sql/PreparedStatement.java \
java/sql/Ref.java \ java/sql/Ref.java \
java/sql/ResultSet.java \ java/sql/ResultSet.java \
java/sql/ResultSetMetaData.java \ java/sql/ResultSetMetaData.java \
java/sql/Savepoint.java \
java/sql/SQLData.java \ java/sql/SQLData.java \
java/sql/SQLException.java \ java/sql/SQLException.java \
java/sql/SQLInput.java \ java/sql/SQLInput.java \
java/sql/SQLOutput.java \ java/sql/SQLOutput.java \
java/sql/SQLPermission.java \
java/sql/SQLWarning.java \ java/sql/SQLWarning.java \
java/sql/Statement.java \ java/sql/Statement.java \
java/sql/Struct.java \ java/sql/Struct.java \
...@@ -2506,13 +2523,15 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ ...@@ -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/Connection.P .deps/java/sql/DataTruncation.P \
.deps/java/sql/DatabaseMetaData.P .deps/java/sql/Date.P \ .deps/java/sql/DatabaseMetaData.P .deps/java/sql/Date.P \
.deps/java/sql/Driver.P .deps/java/sql/DriverManager.P \ .deps/java/sql/Driver.P .deps/java/sql/DriverManager.P \
.deps/java/sql/DriverPropertyInfo.P .deps/java/sql/PreparedStatement.P \ .deps/java/sql/DriverPropertyInfo.P .deps/java/sql/ParameterMetaData.P \
.deps/java/sql/Ref.P .deps/java/sql/ResultSet.P \ .deps/java/sql/PreparedStatement.P .deps/java/sql/Ref.P \
.deps/java/sql/ResultSetMetaData.P .deps/java/sql/SQLData.P \ .deps/java/sql/ResultSet.P .deps/java/sql/ResultSetMetaData.P \
.deps/java/sql/SQLException.P .deps/java/sql/SQLInput.P \ .deps/java/sql/SQLData.P .deps/java/sql/SQLException.P \
.deps/java/sql/SQLOutput.P .deps/java/sql/SQLWarning.P \ .deps/java/sql/SQLInput.P .deps/java/sql/SQLOutput.P \
.deps/java/sql/Statement.P .deps/java/sql/Struct.P \ .deps/java/sql/SQLPermission.P .deps/java/sql/SQLWarning.P \
.deps/java/sql/Time.P .deps/java/sql/Timestamp.P .deps/java/sql/Types.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/Annotation.P \
.deps/java/text/AttributedCharacterIterator.P \ .deps/java/text/AttributedCharacterIterator.P \
.deps/java/text/AttributedString.P \ .deps/java/text/AttributedString.P \
...@@ -2659,6 +2678,14 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.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/ObjectFactoryBuilder.P \
.deps/javax/naming/spi/ResolveResult.P \ .deps/javax/naming/spi/ResolveResult.P \
.deps/javax/naming/spi/Resolver.P .deps/javax/naming/spi/StateFactory.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/HeuristicCommitException.P \
.deps/javax/transaction/HeuristicMixedException.P \ .deps/javax/transaction/HeuristicMixedException.P \
.deps/javax/transaction/HeuristicRollbackException.P \ .deps/javax/transaction/HeuristicRollbackException.P \
......
/* Array.java -- Interface for accessing SQL array object /* 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. This file is part of GNU Classpath.
...@@ -35,80 +35,60 @@ this exception to your version of the library, but you are not ...@@ -35,80 +35,60 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.util.Map; import java.util.Map;
/** /**
* This interface provides methods for accessing SQL array types * This interface provides methods for accessing SQL array types.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public interface Array public interface Array
{ {
/**
/** * Returns the name of the SQL type of the elements in this
* This method returns the name of the SQL type of the elements in this
* array. This name is database specific. * array. This name is database specific.
* *
* @param The name of the SQL type of the elements in this array. * @param The name of the SQL type of the elements in this array.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract String public String getBaseTypeName() throws SQLException;
getBaseTypeName() throws SQLException;
/*************************************************************************/
/** /**
* This method returns the JDBC type identifier of the elements in this * Returns the JDBC type identifier of the elements in this
* array. This will be one of the values defined in the <code>Types</code> * array. This will be one of the values defined in the
* class. * <code>Types</code> class.
* *
* @return The JDBC type of the elements in this array. * @return The JDBC type of the elements in this array.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*
* @see Types * @see Types
*/ */
public abstract int public int getBaseType() throws SQLException;
getBaseType() throws SQLException;
/*************************************************************************/
/** /**
* This method returns the contents of this array. This object returned * Returns the contents of this array. This object returned
* will be an array of Java objects of the appropriate types. * will be an array of Java objects of the appropriate types.
* *
* @return The contents of the array as an array of Java objects. * @return The contents of the array as an array of Java objects.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract Object public Object getArray() throws SQLException;
getArray() throws SQLException;
/*************************************************************************/
/** /**
* This method returns the contents of this array. The specified * Returns the contents of this array. The specified
* <code>Map</code> will be used to override selected mappings between * <code>Map</code> will be used to override selected mappings
* SQL types and Java classes. * between SQL types and Java classes.
* *
* @param map A mapping of SQL types to Java classes. * @param map A mapping of SQL types to Java classes.
*
* @return The contents of the array as an array of Java objects. * @return The contents of the array as an array of Java objects.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract Object public Object getArray(Map map) throws SQLException;
getArray(Map map) throws SQLException;
/*************************************************************************/ /**
* Returns a portion of this array starting at <code>index</code>
/** * into the array and continuing for <code>count</code>
* This method returns a portion of this array starting at index
* <code>offset</code> into the array and continuing for <code>length</code>
* elements. Fewer than the requested number of elements will be * elements. Fewer than the requested number of elements will be
* returned if the array does not contain the requested number of elements. * returned if the array does not contain the requested number of elements.
* The object returned will be an array of Java objects of * The object returned will be an array of Java objects of
...@@ -116,19 +96,14 @@ getArray(Map map) throws SQLException; ...@@ -116,19 +96,14 @@ getArray(Map map) throws SQLException;
* *
* @param offset The offset into this array to start returning elements from. * @param offset The offset into this array to start returning elements from.
* @param count The requested number of elements to return. * @param count The requested number of elements to return.
*
* @return The requested portion of the array. * @return The requested portion of the array.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract Object public Object getArray(long index, int count) throws SQLException;
getArray(long offset, int count) throws SQLException;
/*************************************************************************/
/** /**
* This method returns a portion of this array starting at index * This method returns a portion of this array starting at <code>index</code>
* <code>offset</code> into the array and continuing for <code>length</code> * into the array and continuing for <code>count</code>
* elements. Fewer than the requested number of elements will be * elements. Fewer than the requested number of elements will be
* returned if the array does not contain the requested number of elements. * returned if the array does not contain the requested number of elements.
* The object returned will be an array of Java objects. The specified * The object returned will be an array of Java objects. The specified
...@@ -138,34 +113,24 @@ getArray(long offset, int count) throws SQLException; ...@@ -138,34 +113,24 @@ getArray(long offset, int count) throws SQLException;
* @param offset The offset into this array to start returning elements from. * @param offset The offset into this array to start returning elements from.
* @param count The requested number of elements to return. * @param count The requested number of elements to return.
* @param map A mapping of SQL types to Java classes. * @param map A mapping of SQL types to Java classes.
*
* @return The requested portion of the array. * @return The requested portion of the array.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract Object public Object getArray(long index, int count, Map map) throws SQLException;
getArray(long index, int count, Map map) throws SQLException;
/*************************************************************************/ /**
* Returns the elements in the array as a <code>ResultSet</code>.
/**
* This method returns the elements in the array as a <code>ResultSet</code>.
* Each row of the result set will have two columns. The first will be * 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 index into the array of that row's contents. The second will be
* the actual value of that array element. * the actual value of that array element.
* *
* @return The elements of this array as a <code>ResultSet</code>. * @return The elements of this array as a <code>ResultSet</code>.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*
* @see ResultSet * @see ResultSet
*/ */
public abstract ResultSet public ResultSet getResultSet() throws SQLException;
getResultSet() throws SQLException;
/*************************************************************************/
/** /**
* This method returns the elements in the array as a <code>ResultSet</code>. * This method returns the elements in the array as a <code>ResultSet</code>.
* Each row of the result set will have two columns. The first will be * 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 index into the array of that row's contents. The second will be
...@@ -174,22 +139,16 @@ getResultSet() throws SQLException; ...@@ -174,22 +139,16 @@ getResultSet() throws SQLException;
* Java classes. * Java classes.
* *
* @param map A mapping of SQL types to Java classes. * @param map A mapping of SQL types to Java classes.
*
* @return The elements of this array as a <code>ResultSet</code>. * @return The elements of this array as a <code>ResultSet</code>.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*
* @see ResultSet * @see ResultSet
*/ */
public abstract ResultSet public ResultSet getResultSet(Map map) throws SQLException;
getResultSet(Map map) throws SQLException;
/*************************************************************************/
/** /**
* This method returns a portion of the array as a <code>ResultSet</code>. * This method returns a portion of the array as a <code>ResultSet</code>.
* The returned portion will start at index <code>offset</code> into the * The returned portion will start at <code>index</code> into the
* array and up to <code>length</code> elements will be returned. * array and up to <code>count</code> elements will be returned.
* <p> * <p>
* Each row of the result set will have two columns. The first will be * 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 index into the array of that row's contents. The second will be
...@@ -197,22 +156,16 @@ getResultSet(Map map) throws SQLException; ...@@ -197,22 +156,16 @@ getResultSet(Map map) throws SQLException;
* *
* @param offset The index into the array to start returning elements from. * @param offset The index into the array to start returning elements from.
* @param length The requested number of elements to return. * @param length The requested number of elements to return.
*
* @return The requested elements of this array as a <code>ResultSet</code>. * @return The requested elements of this array as a <code>ResultSet</code>.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*
* @see ResultSet * @see ResultSet
*/ */
public abstract ResultSet public ResultSet getResultSet(long index, int count) throws SQLException;
getResultSet(long index, int count) throws SQLException;
/*************************************************************************/
/** /**
* This method returns a portion of the array as a <code>ResultSet</code>. * This method returns a portion of the array as a <code>ResultSet</code>.
* The returned portion will start at index <code>offset</code> into the * The returned portion will start at <code>index</code> into the
* array and up to <code>length</code> elements will be returned. * array and up to <cod>count</code> elements will be returned.
* <p> * <p>
* Each row of the result set will have two columns. The first will be * 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 index into the array of that row's contents. The second will be
...@@ -223,15 +176,10 @@ getResultSet(long index, int count) throws SQLException; ...@@ -223,15 +176,10 @@ getResultSet(long index, int count) throws SQLException;
* @param offset The index into the array to start returning elements from. * @param offset The index into the array to start returning elements from.
* @param length The requested number of elements to return. * @param length The requested number of elements to return.
* @param map A mapping of SQL types to Java classes. * @param map A mapping of SQL types to Java classes.
*
* @return The requested elements of this array as a <code>ResultSet</code>. * @return The requested elements of this array as a <code>ResultSet</code>.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*
* @see ResultSet * @see ResultSet
*/ */
public abstract ResultSet public ResultSet getResultSet(long index, int count, Map map)
getResultSet(long index, int count, Map map) throws SQLException; throws SQLException;
}
} // interface Array
/* BatchUpdateException.java -- Exception for batch oriented SQL errors /* 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. This file is part of GNU Classpath.
...@@ -35,7 +35,6 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
/** /**
...@@ -47,78 +46,32 @@ package java.sql; ...@@ -47,78 +46,32 @@ package java.sql;
*/ */
public class BatchUpdateException extends SQLException public class BatchUpdateException extends SQLException
{ {
static final long serialVersionUID = 5977529877145521757L;
/*************************************************************************/ /**
/*
* Instance Variables
*/
/**
* This is the array of update counts for the commands which completed * This is the array of update counts for the commands which completed
* successfully prior to the error. * successfully prior to the error.
* @serialized
*/
private int[] updateCounts;
/*************************************************************************/
/*
* Constructors
*/
/**
* This method initializes a new instance of <code>BatchUpdateException</code>
* with no descriptive error message. The SQL state and update count will
* be initialized to <code>null</code> and the vendor specific error code will
* initialized to 0.
*/
public
BatchUpdateException()
{
super();
}
/*************************************************************************/
/**
* This method initializes a new instance of <code>BatchUpdateException</code>
* with the specified update count information and no descriptive error
* message. This SQL state will be initialized to <code>null</code> and
* the vendor specific error code will be initialized to 0.
*
* @param updateCounts The update count array.
*/ */
public private int[] updateCounts;
BatchUpdateException(int[] updateCounts)
{
super();
this.updateCounts = updateCounts; /**
}
/*************************************************************************/
/**
* This method initializes a new instance of <code>BatchUpdateException</code> * This method initializes a new instance of <code>BatchUpdateException</code>
* with the specified descriptive error message and update count information. * with the specified descriptive error message, SQL state, and update count
* The SQL state will be initialized to <code>null</code> and the vendor * information. The vendor specific error code will be initialized to 0.
* specific error code will be initialized to 0.
* *
* @param message The descriptive error message. * @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. * @param updateCounts The update count information for this error.
*/ */
public public BatchUpdateException(String message, String SQLState, int vendorCode,
BatchUpdateException(String message, int[] updateCounts) int[] updateCounts)
{ {
super(message); super(message, SQLState, vendorCode);
this.updateCounts = updateCounts; this.updateCounts = updateCounts;
} }
/*************************************************************************/
/** /**
* This method initializes a new instance of <code>BatchUpdateException</code> * This method initializes a new instance of <code>BatchUpdateException</code>
* with the specified descriptive error message, SQL state, and update count * with the specified descriptive error message, SQL state, and update count
* information. The vendor specific error code will be initialized to 0. * information. The vendor specific error code will be initialized to 0.
...@@ -127,42 +80,53 @@ BatchUpdateException(String message, int[] updateCounts) ...@@ -127,42 +80,53 @@ BatchUpdateException(String message, int[] updateCounts)
* @param SQLState The SQL state information for this error. * @param SQLState The SQL state information for this error.
* @param updateCounts The update count information for this error. * @param updateCounts The update count information for this error.
*/ */
public public BatchUpdateException(String message, String SQLState,
BatchUpdateException(String message, String SQLState, int[] updateCounts) int[] updateCounts)
{ {
super(message, SQLState); super(message, SQLState);
this.updateCounts = updateCounts; this.updateCounts = updateCounts;
} }
/*************************************************************************/ /**
/**
* This method initializes a new instance of <code>BatchUpdateException</code> * This method initializes a new instance of <code>BatchUpdateException</code>
* with the specified descriptive error message, SQL state, vendor * with the specified descriptive error message and update count information.
* specific error code and update count information. * The SQL state will be initialized to <code>null</code> and the vendor
* specific error code will be initialized to 0.
* *
* @param message The descriptive error message. * @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. * @param updateCounts The update count information for this error.
*/ */
public public BatchUpdateException(String message, int[] updateCounts)
BatchUpdateException(String message, String SQLState, int vendorCode, {
int[] updateCounts) super(message);
{
super(message, SQLState, vendorCode);
this.updateCounts = updateCounts; this.updateCounts = updateCounts;
} }
/*************************************************************************/ /**
* Initializes a new instance of <code>BatchUpdateException</code>
* with the specified update count information and no descriptive error
* message. This SQL state will be initialized to <code>null</code> and
* the vendor specific error code will be initialized to 0.
*
* @param updateCounts The update count array.
*/
public BatchUpdateException(int[] updateCounts)
{
this.updateCounts = updateCounts;
}
/* /**
* Instance Methods * Initializes a new instance of <code>BatchUpdateException</code>
* with no descriptive error message. The SQL state and update count will
* be initialized to <code>null</code> and the vendor specific error code will
* initialized to 0.
*/ */
public BatchUpdateException()
{
super();
}
/** /**
* This method returns the update count information for this error. If * This method returns the update count information for this error. If
* not <code>null</code> this is an array of <code>int</code>'s that are * not <code>null</code> this is an array of <code>int</code>'s that are
* the update accounts for each command that was successfully executed. * the update accounts for each command that was successfully executed.
...@@ -170,11 +134,8 @@ BatchUpdateException(String message, String SQLState, int vendorCode, ...@@ -170,11 +134,8 @@ BatchUpdateException(String message, String SQLState, int vendorCode,
* *
* @return The update count information, which may be <code>null</code>. * @return The update count information, which may be <code>null</code>.
*/ */
public int[] public int[] getUpdateCounts()
getUpdateCounts() {
{ return updateCounts;
return(updateCounts); }
} }
} // class BatchUpdateException
/* Blob.java -- Access a SQL Binary Large OBject. /* 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. This file is part of GNU Classpath.
...@@ -35,81 +35,61 @@ this exception to your version of the library, but you are not ...@@ -35,81 +35,61 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
/** /**
* This interface specified methods for accessing a SQL BLOB (Binary * This interface specified methods for accessing a SQL BLOB (Binary
* Large OBject) type. * Large OBject) type.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.2
*/ */
public interface Blob public interface Blob
{ {
/**
/*************************************************************************/
/**
* This method returns the number of bytes in the BLOB. * This method returns the number of bytes in the BLOB.
* *
* @return The number of bytes in the BLOB. * @return The number of bytes in the BLOB.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract long public long length() throws SQLException;
length() throws SQLException;
/*************************************************************************/
/** /**
* This method returns up to the requested bytes of this BLOB as a * This method returns up to the requested bytes of this BLOB as a
* <code>byte</code> array. * <code>byte</code> array.
* *
* @param offset The index into the BLOB to start returning bytes from. * @param pos The index into the BLOB to start returning bytes from.
* @param length The requested number of bytes to return. * @param length The requested number of bytes to return.
*
* @return The requested bytes from the BLOB. * @return The requested bytes from the BLOB.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract byte[] public byte[] getBytes(long pos, int length) throws SQLException;
getBytes(long offset, int length) throws SQLException;
/*************************************************************************/
/** /**
* This method returns a stream that will read the bytes of the BLOB. * This method returns a stream that will read the bytes of the BLOB.
* *
* @return 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. * @exception SQLException If an error occurs.
*/ */
public abstract InputStream public InputStream getBinaryStream() throws SQLException;
getBinaryStream() throws SQLException;
/*************************************************************************/ /**
/**
* This method returns the index into the BLOB at which the first instance * This method returns the index into the BLOB at which the first instance
* of the specified bytes occur. The searching starts at the specified * of the specified bytes occur. The searching starts at the specified
* index into the BLOB. * index into the BLOB.
* *
* @param pattern The byte pattern to search for. * @param pattern The byte pattern to search for.
* @param offset The index into the BLOB to starting searching for the pattern. * @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 * @return The offset at which the pattern is first found, or -1 if the
* pattern is not found. * pattern is not found.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract long public long position(byte[] pattern, long start) throws SQLException;
position(byte[] pattern, long offset) throws SQLException;
/*************************************************************************/
/** /**
* This method returns the index into the BLOB at which the first instance * This method returns the index into the BLOB at which the first instance
* of the specified pattern occurs. The searching starts at the specified * of the specified pattern occurs. The searching starts at the specified
* index into this BLOB. The bytes in the specified <code>Blob</code> are * index into this BLOB. The bytes in the specified <code>Blob</code> are
...@@ -118,14 +98,34 @@ position(byte[] pattern, long offset) throws SQLException; ...@@ -118,14 +98,34 @@ position(byte[] pattern, long offset) throws SQLException;
* @param pattern The <code>Blob</code> containing the byte pattern to * @param pattern The <code>Blob</code> containing the byte pattern to
* search for. * search for.
* @param offset The index into the BLOB to starting searching for the pattern. * @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 * @return The offset at which the pattern is first found, or -1 if the
* pattern is not found. * pattern is not found.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract long public long position(Blob pattern, long start) throws SQLException;
position(Blob pattern, long offset) throws SQLException;
} // interface Blob /**
* @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;
}
/* Clob.java -- Access Character Large OBjects /* 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. This file is part of GNU Classpath.
...@@ -35,11 +35,12 @@ this exception to your version of the library, but you are not ...@@ -35,11 +35,12 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader; import java.io.Reader;
import java.io.Writer;
/** /**
* This interface contains methods for accessing a SQL CLOB (Character * This interface contains methods for accessing a SQL CLOB (Character
...@@ -49,99 +50,103 @@ import java.io.Reader; ...@@ -49,99 +50,103 @@ import java.io.Reader;
*/ */
public interface Clob public interface Clob
{ {
/**
/**
* This method returns the number of characters in the CLOB. * This method returns the number of characters in the CLOB.
* *
* @return The number of characters in the CLOB. * @return The number of characters in the CLOB.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
* @since 1.2
*/ */
public abstract long public long length() throws SQLException;
length() throws SQLException;
/*************************************************************************/
/** /**
* This method returns the specified portion of the CLOB as a * This method returns the specified portion of the CLOB as a
* <code>String</code>. * <code>String</code>.
* *
* @param offset The index into the CLOB (index values start at 1) to * @param offset The index into the CLOB (index values start at 1) to
* start returning characters from. * start returning characters from.
* @param length The requested number of characters to return. * @param length The requested number of characters to return.
*
* @return The requested CLOB section, as a <code>String</code>. * @return The requested CLOB section, as a <code>String</code>.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
* @since 1.2
*/ */
public abstract String public String getSubString(long pos, int length) throws SQLException;
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 * This method returns a character stream that reads the contents of the
* CLOB. * CLOB.
* *
* @return A character stream to read the CLOB's contents. * @return A character stream to read the CLOB's contents.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
* @since 1.2
*/ */
public abstract Reader public Reader getCharacterStream() throws SQLException;
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 * This method returns the index into the CLOB of the first occurrence of
* the specified character pattern (supplied by the caller as a * the specified character pattern (supplied by the caller as a
* <code>String</code>). The search begins at the specified index. * <code>String</code>). The search begins at the specified index.
* *
* @param pattern The character pattern to search for, passed as a * @param searchstr The character pattern to search for, passed as a
* <code>String</code>. * <code>String</code>.
* @param offset. The index into the CLOB to start search (indexes start * @param start. The index into the CLOB to start search (indexes start
* at 1). * at 1).
*
* @return The index at which the pattern was found (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. * or -1 if the pattern was not found.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
* @since 1.2
*/ */
public abstract long public long position(String searchstr, long start) throws SQLException;
position(String pattern, long offset) throws SQLException;
/*************************************************************************/ /**
/**
* This method returns the index into the CLOB of the first occurrence of * This method returns the index into the CLOB of the first occurrence of
* the specified character pattern (supplied by the caller as a * the specified character pattern (supplied by the caller as a
* <code>Clob</code>). The search begins at the specified index. * <code>Clob</code>). The search begins at the specified index.
* *
* @param pattern The character pattern to search for, passed as a * @param searchstr The character pattern to search for, passed as a
* <code>Clob</code>. * <code>Clob</code>.
* @param offset. The index into the CLOB to start search (indexes start * @param start. The index into the CLOB to start search (indexes start
* at 1). * at 1).
*
* @return The index at which the pattern was found (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. * or -1 if the pattern was not found.
*
* @exception SQLException If an error occurs. * @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 abstract long public int setString(long pos, String str, int offset, int len)
position(Clob pattern, long offset) throws SQLException; throws SQLException;
} // interface Clob /**
* @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;
}
/* DataTruncation.java -- Warning when data has been truncated. /* 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. This file is part of GNU Classpath.
...@@ -35,7 +35,6 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
/** /**
...@@ -46,61 +45,34 @@ package java.sql; ...@@ -46,61 +45,34 @@ package java.sql;
*/ */
public class DataTruncation extends SQLWarning public class DataTruncation extends SQLWarning
{ {
static final long serialVersionUID = 6464298989504059473L;
/*************************************************************************/ /**
/*
* Instance Variables
*/
/**
* The original size of the data. * The original size of the data.
* @serialized
*/ */
private int dataSize; private int dataSize;
/** /**
* The index of the parameter or column whose value was truncated. * The index of the parameter or column whose value was truncated.
* @serialized
*/ */
private int index; private int index;
/** /**
* Indicates whether or not a parameter value was truncated. * Indicates whether or not a parameter value was truncated.
* @serialized
*/ */
private boolean parameter; private boolean parameter;
/** /**
* Indicates whether or not a data column value was truncated. * Indicates whether or not a data column value was truncated.
* @serialized
*/ */
private boolean read; private boolean read;
/** /**
* This is the size of the data after truncation. * This is the size of the data after truncation.
* @serialized
*/ */
private int transferSize; 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 <code>DataTruncation</code> * This method initializes a new instance of <code>DataTruncation</code>
* with the specified values. The descriptive error message for this * with the specified values. The descriptive error message for this
* exception will be "Data truncation", the SQL state will be "01004" * exception will be "Data truncation", the SQL state will be "01004"
...@@ -114,10 +86,9 @@ private static final long serialVersionUID = 6464298989504059473L; ...@@ -114,10 +86,9 @@ private static final long serialVersionUID = 6464298989504059473L;
* @param dataSize The original size of the data. * @param dataSize The original size of the data.
* @param transferSize The size of the data after truncation. * @param transferSize The size of the data after truncation.
*/ */
public public DataTruncation(int index, boolean parameter, boolean read, int
DataTruncation(int index, boolean parameter, boolean read, int dataSize, dataSize, int transferSize)
int transferSize) {
{
super("Data truncation", "01004"); super("Data truncation", "01004");
this.index = index; this.index = index;
...@@ -125,83 +96,62 @@ DataTruncation(int index, boolean parameter, boolean read, int dataSize, ...@@ -125,83 +96,62 @@ DataTruncation(int index, boolean parameter, boolean read, int dataSize,
this.read = read; this.read = read;
this.dataSize = dataSize; this.dataSize = dataSize;
this.transferSize = transferSize; this.transferSize = transferSize;
} }
/*************************************************************************/
/* /**
* Instance Methods
*/
/**
* This method returns the index of the column or parameter that was * This method returns the index of the column or parameter that was
* truncated. * truncated.
* *
* @return The index of the column or parameter that was truncated. * @return The index of the column or parameter that was truncated.
*/ */
public int public int getIndex()
getIndex() {
{ return index;
return(index); }
}
/*************************************************************************/
/** /**
* This method determines whether or not it was a parameter that was * This method determines whether or not it was a parameter that was
* truncated. * truncated.
* *
* @return <code>true</code> if a parameter was truncated, <code>false</code> * @return <code>true</code> if a parameter was truncated, <code>false</code>
* otherwise. * otherwise.
*/ */
public boolean public boolean getParameter()
getParameter() {
{ return parameter;
return(parameter); }
}
/*************************************************************************/ /**
/**
* This method determines whether or not it was a column that was * This method determines whether or not it was a column that was
* truncated. * truncated.
* *
* @return <code>true</code> if a column was truncated, <code>false</code> * @return <code>true</code> if a column was truncated, <code>false</code>
* otherwise. * otherwise.
*/ */
public boolean public boolean getRead()
getRead() {
{ return read;
return(read); }
}
/*************************************************************************/
/** /**
* This method returns the original size of the parameter or column that * This method returns the original size of the parameter or column that
* was truncated. * was truncated.
* *
* @return 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 public int getDataSize()
getDataSize() {
{ return dataSize;
return(dataSize); }
}
/*************************************************************************/ /**
/**
* This method returns the size of the parameter or column after it was * This method returns the size of the parameter or column after it was
* truncated. * truncated.
* *
* @return 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 public int getTransferSize()
getTransferSize() {
{ return transferSize;
return(transferSize); }
} }
} // class DataTruncation
...@@ -35,7 +35,6 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -48,56 +47,14 @@ import java.text.SimpleDateFormat; ...@@ -48,56 +47,14 @@ import java.text.SimpleDateFormat;
*/ */
public class Date extends java.util.Date public class Date extends java.util.Date
{ {
static final long serialVersionUID = 1511598038487230103L;
/* /**
* Class Variables
*/
/**
* Used for parsing and formatting this date. * Used for parsing and formatting this date.
*/ */
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 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 <code>java.sql.Date</code> 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 * This method initializes a new instance of this class with the
* specified year, month, and day. * specified year, month, and day.
* *
...@@ -107,43 +64,50 @@ valueOf(String str) ...@@ -107,43 +64,50 @@ valueOf(String str)
* *
* @deprecated * @deprecated
*/ */
public public Date(int year, int month, int day)
Date(int year, int month, int day) {
{
super(year, month, day); super(year, month, day);
} }
/*************************************************************************/
/** /**
* This method initializes a new instance of this class with the * This method initializes a new instance of this class with the
* specified time value representing the number of seconds since * specified time value representing the number of seconds since
* Jan 1, 1970 at 12:00 midnight GMT. * Jan 1, 1970 at 12:00 midnight GMT.
* *
* @param time The time value to intialize this date to. * @param time The time value to intialize this date to.
*/ */
public public Date(long date)
Date(long date) {
{
super(date); super(date);
} }
/*************************************************************************/
/* /**
* Instance 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 <code>java.sql.Date</code> 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. * This method returns this date in JDBC format.
* *
* @return This date as a string. * @return This date as a string.
*/ */
public String public String toString()
toString() {
{
return(sdf.format(this)); return(sdf.format(this));
}
} }
} // class Date
...@@ -35,7 +35,6 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.util.Properties; import java.util.Properties;
...@@ -56,93 +55,69 @@ import java.util.Properties; ...@@ -56,93 +55,69 @@ import java.util.Properties;
*/ */
public interface Driver public interface Driver
{ {
/**
/** * This method connects to the specified database using the connection
* This method returns the major version number of the driver. * properties supplied. If the driver does not understand the database
* * URL, it should return <code>null</code> instead of throwing an
* @return The major version number of the driver. * exception since the <code>DriverManager</code> will probe a driver
*/ * in this manner.
public abstract int
getMajorVersion();
/*************************************************************************/
/**
* This method returns the minor version number of the driver.
* *
* @return The minor version number of the driver. * @param url The URL string for this connection.
* @param properties The list of database connection properties.
* @return A <code>Connection</code> object for the newly established
* connection, or <code>null</code> if the URL is not understood.
* @exception SQLException If an error occurs.
*/ */
public abstract int public Connection connect(String url, Properties info) throws SQLException;
getMinorVersion();
/*************************************************************************/
/** /**
* This method tests whether or not the driver is JDBC compliant. This * This method tests whether or not the driver believes it can connect to
* method should only return <code>true</code> if the driver has been * the specified database. The driver should only test whether it
* certified as JDBC compliant. * understands and accepts the URL. It should not necessarily attempt to
* probe the database for a connection.
* *
* @return <code>true</code> if the driver has been certified JDBC compliant, * @param The database URL string.
* @return <code>true</code> if the drivers can connect to the database,
* <code>false</code> otherwise. * <code>false</code> otherwise.
* @exception SQLException If an error occurs.
*/ */
public abstract boolean public boolean acceptsURL(String url) throws SQLException;
jdbcCompliant();
/*************************************************************************/ /**
/**
* This method returns an array of possible properties that could be * This method returns an array of possible properties that could be
* used to connect to the specified database. * used to connect to the specified database.
* *
* @param url The URL string of the database to connect to. * @param url The URL string of the database to connect to.
* @param properties The list of properties the caller is planning to use * @param properties The list of properties the caller is planning to use
* to connect to the database. * to connect to the database.
*
* @return A list of possible additional properties for a connection to this * @return A list of possible additional properties for a connection to this
* database. This list may be empty. * database. This list may be empty.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract DriverPropertyInfo[] public DriverPropertyInfo[] getPropertyInfo(String url, Properties properties)
getPropertyInfo(String url, Properties properties) throws SQLException; throws SQLException;
/*************************************************************************/ /**
* This method returns the major version number of the driver.
/**
* 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 <code>true</code> if the drivers can connect to the database,
* <code>false</code> otherwise.
* *
* @exception SQLException If an error occurs. * @return The major version number of the driver.
*/ */
public abstract boolean public int getMajorVersion();
acceptsURL(String url) throws SQLException;
/*************************************************************************/
/** /**
* This method connects to the specified database using the connection * This method returns the minor version number of the driver.
* properties supplied. If the driver does not understand the database
* URL, it should return <code>null</code> instead of throwing an
* exception since the <code>DriverManager</code> 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 <code>Connection</code> object for the newly established
* connection, or <code>null</code> if the URL is not understood.
* *
* @exception SQLException If an error occurs. * @return The minor version number of the driver.
*/ */
public abstract Connection public int getMinorVersion();
connect(String url, Properties properties) throws SQLException;
} // interface Driver
/**
* This method tests whether or not the driver is JDBC compliant. This
* method should only return <code>true</code> if the driver has been
* certified as JDBC compliant.
*
* @return <code>true</code> if the driver has been certified JDBC compliant,
* <code>false</code> otherwise.
*/
public boolean jdbcCompliant();
}
...@@ -46,57 +46,43 @@ package java.sql; ...@@ -46,57 +46,43 @@ package java.sql;
*/ */
public class DriverPropertyInfo public class DriverPropertyInfo
{ {
/**
/*
* Instance Variables
*/
/**
* The name of the property. * The name of the property.
*/ */
public String name; public String name;
/** /**
* This is the value of the property.
*/
public String value;
/**
* A description of the property, possibly <code>null</code>. * A description of the property, possibly <code>null</code>.
*/ */
public String description; public String description;
/** /**
* A flag indicating whether or not a value for this property is required * A flag indicating whether or not a value for this property is required
* in order to connect to the database. * in order to connect to the database.
*/ */
public boolean required; public boolean required;
/** /**
* If values are restricted to certain choices, this is the list of valid * This is the value of the property.
* ones. Otherwise it is <code>null</code>.
*/ */
public String[] choices; public String value;
/*************************************************************************/ /**
* If values are restricted to certain choices, this is the list of valid
/* * ones. Otherwise it is <code>null</code>.
* Constructors
*/ */
public String[] choices;
/** /**
* This method initializes a new instance of <code>DriverPropertyInfo</code> * This method initializes a new instance of <code>DriverPropertyInfo</code>
* with the specified name and value. All other fields are defaulted. * with the specified name and value. All other fields are defaulted.
* *
* @param name The name of the property. * @param name The name of the property.
* @param value The value to assign to the property. * @param value The value to assign to the property.
*/ */
public public DriverPropertyInfo(String name, String value)
DriverPropertyInfo(String name, String value) {
{
this.name = name; this.name = name;
this.value = value; this.value = value;
}
} }
} // DriverPropertyInfo
/* 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;
}
...@@ -35,28 +35,41 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package java.sql; package java.sql;
import java.util.Map;
/** /**
* This interface provides a mechanism for obtaining information about * This interface provides a mechanism for obtaining information about
* a SQL structured type * a SQL structured type
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.2
*/ */
public interface Ref public interface Ref
{ {
/**
/**
* This method returns the fully qualified name of the SQL structured * This method returns the fully qualified name of the SQL structured
* type of the referenced item. * type of the referenced item.
* *
* @return The fully qualified name of the SQL structured type. * @return The fully qualified name of the SQL structured type.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
* @since 1.2
*/ */
public abstract String public String getBaseTypeName() throws SQLException;
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;
}
...@@ -45,41 +45,28 @@ package java.sql; ...@@ -45,41 +45,28 @@ package java.sql;
*/ */
public interface SQLData public interface SQLData
{ {
/**
/**
* This method returns the user defined datatype name for this object. * This method returns the user defined datatype name for this object.
* *
* @return The user defined data type name for this object. * @return The user defined data type name for this object.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract String public String getSQLTypeName() throws SQLException;
getSQLTypeName() throws SQLException;
/*************************************************************************/ /**
/**
* This method populates the data in the object from the specified stream. * This method populates the data in the object from the specified stream.
* *
* @param stream The stream to read the data from. * @param stream The stream to read the data from.
* @param name The data type name of the data on the stream. * @param name The data type name of the data on the stream.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract void public void readSQL(SQLInput stream, String typeName) throws SQLException;
readSQL(SQLInput stream, String name) throws SQLException;
/*************************************************************************/ /**
/**
* This method writes the data in this object to the specified stream. * This method writes the data in this object to the specified stream.
* *
* @param stream The stream to write the data to. * @param stream The stream to write the data to.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract void public void writeSQL(SQLOutput stream) throws SQLException;
writeSQL(SQLOutput stream) throws SQLException; }
} // interface SQLData
...@@ -45,77 +45,40 @@ package java.sql; ...@@ -45,77 +45,40 @@ package java.sql;
*/ */
public class SQLException extends Exception public class SQLException extends Exception
{ {
static final long serialVersionUID = 2135244094396331484L;
/*************************************************************************/ /**
/*
* Instance Variables
*/
/**
* This is the next exception in the chain * This is the next exception in the chain
* @serialized
*/ */
private SQLException next; private SQLException next;
/** /**
* This is the state of the SQL statement at the time of the error. * This is the state of the SQL statement at the time of the error.
* @serialized
*/ */
private String SQLState; private String SQLState;
/** /**
* The vendor error code for this error * 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 <code>SQLException</code>
* that does not have a descriptive messages and SQL state, and which
* has a vendor error code of 0.
*/ */
public private int vendorCode;
SQLException()
{
this(null, null, 0);
}
/*************************************************************************/
/** /**
* This method initializes a new instance of <code>SQLException</code> * This method initializes a nwe instance of <code>SQLException</code>
* with the specified descriptive error message. The SQL state of this * with the specified descriptive error message, SQL state string, and
* instance will be <code>null</code> and the vendor error code will be 0. * vendor code.
* *
* @param message A string describing the nature of the error. * @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 public SQLException(String message, String SQLState, int vendorCode)
SQLException(String message) {
{ super(message);
this(message, null, 0); this.SQLState = SQLState;
} this.vendorCode = vendorCode;
}
/*************************************************************************/
/** /**
* This method initializes a new instance of <code>SQLException</code> * This method initializes a new instance of <code>SQLException</code>
* with the specified descriptive error message and SQL state string. * with the specified descriptive error message and SQL state string.
* The vendor error code of this instance will be 0. * The vendor error code of this instance will be 0.
...@@ -123,90 +86,75 @@ SQLException(String message) ...@@ -123,90 +86,75 @@ SQLException(String message)
* @param message A string describing the nature of the error. * @param message A string describing the nature of the error.
* @param SQLState A string containing the SQL state of the error. * @param SQLState A string containing the SQL state of the error.
*/ */
public public SQLException(String message, String SQLState)
SQLException(String message, String SQLState) {
{
this(message, SQLState, 0); this(message, SQLState, 0);
} }
/*************************************************************************/ /**
* This method initializes a new instance of <code>SQLException</code>
/** * with the specified descriptive error message. The SQL state of this
* This method initializes a nwe instance of <code>SQLException</code> * instance will be <code>null</code> and the vendor error code will be 0.
* with the specified descriptive error message, SQL state string, and
* vendor code.
* *
* @param message A string describing the nature of the error. * @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 public SQLException(String message)
SQLException(String message, String SQLState, int vendorCode) {
{ this(message, null, 0);
super(message); }
this.SQLState = SQLState;
this.vendorCode = vendorCode;
}
/*************************************************************************/
/* /**
* Instance Methods * This method initializes a new instance of <code>SQLException</code>
* 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 * This method returns the SQLState information associated with this
* error. The value returned is a <code>String</code> which is formatted * error. The value returned is a <code>String</code> which is formatted
* using the XOPEN SQL state conventions. * using the XOPEN SQL state conventions.
* *
* @return The SQL state, which may be <code>null</code>. * @return The SQL state, which may be <code>null</code>.
*/ */
public String public String getSQLState()
getSQLState() {
{ return SQLState;
return(SQLState); }
}
/*************************************************************************/
/** /**
* This method returns the vendor specific error code associated with * This method returns the vendor specific error code associated with
* this error. * this error.
* *
* @return The vendor specific error code associated with this error. * @return The vendor specific error code associated with this error.
*/ */
public int public int getErrorCode()
getErrorCode() {
{ return vendorCode;
return(vendorCode); }
}
/*************************************************************************/
/** /**
* This method returns the exception that is chained to this object. * This method returns the exception that is chained to this object.
* *
* @return The exception chained to this object, which may be * @return The exception chained to this object, which may be
* <code>null</code>. * <code>null</code>.
*/ */
public SQLException public SQLException getNextException()
getNextException() {
{ return next;
return(next); }
}
/*************************************************************************/ /**
/**
* This method adds a new exception to the end of the chain of exceptions * This method adds a new exception to the end of the chain of exceptions
* that are chained to this object. * that are chained to this object.
* *
* @param e The exception to add to the end of the chain. * @param e The exception to add to the end of the chain.
*/ */
public void public void setNextException(SQLException e)
setNextException(SQLException e) {
{
if (e == null) if (e == null)
return; return;
...@@ -215,7 +163,5 @@ setNextException(SQLException e) ...@@ -215,7 +163,5 @@ setNextException(SQLException e)
list_entry = list_entry.getNextException(); list_entry = list_entry.getNextException();
list_entry.next = e; list_entry.next = e;
}
} }
} // class SQLException
/* 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);
}
}
/* SQLWarning.java -- Database access warnings. /* 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. This file is part of GNU Classpath.
...@@ -45,53 +45,23 @@ package java.sql; ...@@ -45,53 +45,23 @@ package java.sql;
*/ */
public class SQLWarning extends SQLException public class SQLWarning extends SQLException
{ {
static final long serialVersionUID = 3917336774604784856L;
/*************************************************************************/ /**
* This method initializes a nwe instance of <code>SQLWarning</code>
/** * with the specified descriptive error message, SQL state string, and
* Static Variables * vendor code.
*/
/**
* This is the serialization UID for this class
*/
private static final long serialVersionUID = 3917336774604784856L;
/*************************************************************************/
/*
* Constructors
*/
/**
* This method initializes a new instance of <code>SQLWarning</code>
* 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 <code>SQLWarning</code>
* with the specified descriptive error message. The SQL state of this
* instance will be <code>null</code> and the vendor error code will be 0.
* *
* @param message A string describing the nature of the error. * @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 public SQLWarning(String reason, String SQLState, int vendorCode)
SQLWarning(String message) {
{ super(reason, SQLState, vendorCode);
this(message, null, 0); }
}
/*************************************************************************/
/** /**
* This method initializes a new instance of <code>SQLWarning</code> * This method initializes a new instance of <code>SQLWarning</code>
* with the specified descriptive error message and SQL state string. * with the specified descriptive error message and SQL state string.
* The vendor error code of this instance will be 0. * The vendor error code of this instance will be 0.
...@@ -99,60 +69,52 @@ SQLWarning(String message) ...@@ -99,60 +69,52 @@ SQLWarning(String message)
* @param message A string describing the nature of the error. * @param message A string describing the nature of the error.
* @param SQLState A string containing the SQL state of the error. * @param SQLState A string containing the SQL state of the error.
*/ */
public public SQLWarning(String message, String SQLState)
SQLWarning(String message, String SQLState) {
{ super(message, SQLState);
this(message, SQLState, 0); }
}
/*************************************************************************/
/** /**
* This method initializes a nwe instance of <code>SQLWarning</code> * This method initializes a new instance of <code>SQLWarning</code>
* with the specified descriptive error message, SQL state string, and * with the specified descriptive error message. The SQL state of this
* vendor code. * instance will be <code>null</code> and the vendor error code will be 0.
* *
* @param message A string describing the nature of the error. * @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 public SQLWarning(String message)
SQLWarning(String message, String SQLState, int vendorCode) {
{ super(message);
super(message, SQLState, vendorCode); }
}
/*************************************************************************/ /**
* This method initializes a new instance of <code>SQLWarning</code>
/* * that does not have a descriptive messages and SQL state, and which
* Instance Methods * has a vendor error code of 0.
*/ */
public SQLWarning()
{
super();
}
/** /**
* This method returns the exception that is chained to this object. * This method returns the exception that is chained to this object.
* *
* @return The exception chained to this object, which may be * @return The exception chained to this object, which may be
* <code>null</code>. * <code>null</code>.
*/ */
public SQLWarning public SQLWarning getNextWarning()
getNextWarning() {
{ return (SQLWarning) super.getNextException();
return((SQLWarning)super.getNextException()); }
}
/*************************************************************************/ /**
/**
* This method adds a new exception to the end of the chain of exceptions * This method adds a new exception to the end of the chain of exceptions
* that are chained to this object. * that are chained to this object.
* *
* @param e The exception to add to the end of the chain. * @param w The exception to add to the end of the chain.
*/ */
public void public void setNextWarning(SQLWarning w)
setNextWarning(SQLWarning e) {
{ super.setNextException(w);
super.setNextException(e); }
} }
} // class SQLWarning
/* 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;
}
/* Struct.java -- Mapping for a SQL structured type. /* 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. This file is part of GNU Classpath.
...@@ -48,44 +48,30 @@ import java.util.Map; ...@@ -48,44 +48,30 @@ import java.util.Map;
*/ */
public interface Struct public interface Struct
{ {
/**
/**
* This method returns the name of the SQL structured type for this * This method returns the name of the SQL structured type for this
* object. * object.
* *
* @return The SQL structured type name. * @return The SQL structured type name.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract String public String getSQLTypeName() throws SQLException;
getSQLTypeName() throws SQLException;
/*************************************************************************/ /**
/**
* This method returns the attributes of this SQL structured type. * This method returns the attributes of this SQL structured type.
* *
* @return The attributes of this structure type. * @return The attributes of this structure type.
*
* @exception SQLException If an error occurs. * @exception SQLException If an error occurs.
*/ */
public abstract Object[] public Object[] getAttributes() throws SQLException;
getAttributes() throws SQLException;
/*************************************************************************/ /**
/**
* This method returns the attributes of this SQL structured type. * This method returns the attributes of this SQL structured type.
* The specified map of type mappings overrides the default mappings. * The specified map of type mappings overrides the default mappings.
* *
* @param map The map of SQL type mappings. * @param map The map of SQL type mappings.
*
* @return The attributes of this structure type. * @return The attributes of this structure type.
*
* @exception SQLException If a error occurs. * @exception SQLException If a error occurs.
*/ */
public abstract Object[] public Object[] getAttributes(Map map) throws SQLException;
getAttributes(Map map) throws SQLException; }
} // interface Struct
/* Time.java -- Wrapper around java.util.Date /* 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. This file is part of GNU Classpath.
...@@ -48,106 +48,74 @@ import java.text.SimpleDateFormat; ...@@ -48,106 +48,74 @@ import java.text.SimpleDateFormat;
*/ */
public class Time extends java.util.Date public class Time extends java.util.Date
{ {
static final long serialVersionUID = 8397324403548013681L;
/* /**
* Class Variables
*/
/**
* Used for parsing and formatting this date. * Used for parsing and formatting this date.
*/ */
private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); 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 * This method returns a new instance of this class by parsing a
* date in JDBC format into a Java date. * date in JDBC format into a Java date.
* *
* @param str The string to parse. * @param str The string to parse.
*
* @return The resulting <code>java.sql.Time</code> value. * @return The resulting <code>java.sql.Time</code> value.
*/ */
public static Time public static Time valueOf(String str)
valueOf(String str) {
{
try try
{ {
java.util.Date d = (java.util.Date)sdf.parseObject(str); java.util.Date d = (java.util.Date) sdf.parseObject(str);
return(new Time(d.getTime())); return new Time(d.getTime());
} }
catch(Exception e) catch (Exception e)
{ {
return(null); return null;
}
} }
}
/*************************************************************************/
/*
* Constructors
*/
/** /**
* This method initializes a new instance of this class with the * This method initializes a new instance of this class with the
* specified year, month, and day. * specified year, month, and day.
* *
* @param hour The hour for this Time (0-23) * @param hour The hour for this Time (0-23)
* @param minute The minute for this time (0-59) * @param minute The minute for this time (0-59)
* @param second The second for this time (0-59) * @param second The second for this time (0-59)
*
* @deprecated * @deprecated
*/ */
public public Time(int hour, int minute, int second)
Time(int hour, int minute, int second) {
{
super(System.currentTimeMillis()); super(System.currentTimeMillis());
setHours(hour); setHours(hour);
setMinutes(minute); setMinutes(minute);
setSeconds(second); setSeconds(second);
} }
/*************************************************************************/
/** /**
* This method initializes a new instance of this class with the * This method initializes a new instance of this class with the
* specified time value representing the number of seconds since * specified time value representing the number of seconds since
* Jan 1, 1970 at 12:00 midnight GMT. * Jan 1, 1970 at 12:00 midnight GMT.
* *
* @param time The time value to intialize this <code>Time</code> to. * @param time The time value to intialize this <code>Time</code> to.
*/ */
public public Time(long date)
Time(long date) {
{
super(date); super(date);
} }
/*************************************************************************/
/*
* Instance Methods
*/
/** /**
* This method returns this date in JDBC format. * This method returns this date in JDBC format.
* *
* @return This date as a string. * @return This date as a string.
*/ */
public String public String
toString() toString()
{ {
return(sdf.format(this)); return sdf.format(this);
} }
} // class Time }
...@@ -52,72 +52,44 @@ import java.text.SimpleDateFormat; ...@@ -52,72 +52,44 @@ import java.text.SimpleDateFormat;
*/ */
public class Timestamp extends java.util.Date 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. // Millisecond will have to be close enough for now.
private static SimpleDateFormat parse_sdf = private static SimpleDateFormat parse_sdf =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS");
private static SimpleDateFormat format_sdf = private static SimpleDateFormat format_sdf =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/** /**
* This is the serialization UID for this class. * The nanosecond value for this object
*/
private static final long serialVersionUID = 3581463369166924961L;
/*************************************************************************/
/*
* Instance Variables
*/
/**
* @serial The nanosecond value for this object
*/
private int nanos;
/*************************************************************************/
/*
* Class Methods
*/ */
private int nanos;
/** /**
* This method returns a new instance of this class by parsing a * This method returns a new instance of this class by parsing a
* date in JDBC format into a Java date. * date in JDBC format into a Java date.
* *
* @param str The string to parse. * @param str The string to parse.
*
* @return The resulting <code>java.sql.Timestamp</code> value. * @return The resulting <code>java.sql.Timestamp</code> value.
*/ */
public static Timestamp public static Timestamp valueOf(String str)
valueOf(String str) {
{
try try
{ {
Date d = (Date)parse_sdf.parseObject(str); Date d = (Date) parse_sdf.parseObject(str);
return(new Timestamp(d.getTime())); return new Timestamp(d.getTime());
} }
catch(Exception e) catch (Exception e)
{ {
return(null); return null;
}
} }
}
/*************************************************************************/
/*
* Constructors
*/
/** /**
* This method initializes a new instance of this class with the * This method initializes a new instance of this class with the
* specified year, month, and day. * specified year, month, and day.
* *
...@@ -128,102 +100,76 @@ valueOf(String str) ...@@ -128,102 +100,76 @@ valueOf(String str)
* @param minute The minute for this Timestamp (0-59) * @param minute The minute for this Timestamp (0-59)
* @param second The second 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) * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999)
*
* @deprecated * @deprecated
*/ */
public public Timestamp(int year, int month, int day, int hour, int minute,
Timestamp(int year, int month, int day, int hour, int minute, int second, int second, int nanos)
int nanos) {
{
super(year, month, day, hour, minute, second); super(year, month, day, hour, minute, second);
this.nanos = nanos; this.nanos = nanos;
} }
/*************************************************************************/
/** /**
* This method initializes a new instance of this class with the * This method initializes a new instance of this class with the
* specified time value representing the number of seconds since * specified time value representing the number of seconds since
* Jan 1, 1970 at 12:00 midnight GMT. * Jan 1, 1970 at 12:00 midnight GMT.
* *
* @param time The time value to intialize this <code>Time</code> to. * @param time The time value to intialize this <code>Time</code> to.
*/ */
public public Timestamp(long date)
Timestamp(long date) {
{
super(date); super(date);
} }
/*************************************************************************/
/*
* Instance Methods
*/
/** /**
* This method returns this date in JDBC format. * This method returns this date in JDBC format.
* *
* @return This date as a string. * @return This date as a string.
*/ */
public String public String toString()
toString() {
{ return format_sdf.format(this) + "." + getNanos();
return(format_sdf.format(this) + "." + getNanos()); }
}
/*************************************************************************/
/** /**
* This method returns the nanosecond value for this object. * This method returns the nanosecond value for this object.
*
* @return The nanosecond value for this object. * @return The nanosecond value for this object.
*/ */
public int public int getNanos()
getNanos() {
{ return nanos;
return(nanos); }
}
/*************************************************************************/
/** /**
* This method sets the nanosecond value for this object. * This method sets the nanosecond value for this object.
* *
* @param nanos The nanosecond value for this object. * @param nanos The nanosecond value for this object.
*/ */
public void public void setNanos(int nanos)
setNanos(int nanos) {
{
this.nanos = nanos; this.nanos = nanos;
} }
/*************************************************************************/
/** /**
* This methods tests whether this object is earlier than the specified * This methods tests whether this object is earlier than the specified
* object. * object.
* *
* @param ts The other <code>Timestamp</code> to test against. * @param ts The other <code>Timestamp</code> to test against.
*
* @return <code>true</code> if this object is earlier than the other object, * @return <code>true</code> if this object is earlier than the other object,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean before(Timestamp ts)
before(Timestamp ts) {
{
if (ts.getTime() > getTime()) if (ts.getTime() > getTime())
return(true); return true;
if (ts.getNanos() > getNanos()) if (ts.getNanos() > getNanos())
return(true); return true;
return(false);
}
/*************************************************************************/ return false;
}
/** /**
* This methods tests whether this object is later than the specified * This methods tests whether this object is later than the specified
* object. * object.
* *
...@@ -232,21 +178,18 @@ before(Timestamp ts) ...@@ -232,21 +178,18 @@ before(Timestamp ts)
* @return <code>true</code> if this object is later than the other object, * @return <code>true</code> if this object is later than the other object,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean after(Timestamp ts)
after(Timestamp ts) {
{
if (ts.getTime() < getTime()) if (ts.getTime() < getTime())
return(true); return true;
if (ts.getNanos() < getNanos()) if (ts.getNanos() < getNanos())
return(true); return true;
return(false);
}
/*************************************************************************/ return false;
}
/** /**
* This method these the specified <code>Object</code> for equality * This method these the specified <code>Object</code> for equality
* against this object. This will be true if an only if the specified * against this object. This will be true if an only if the specified
* object is an instance of <code>Timestamp</code> and has the same * object is an instance of <code>Timestamp</code> and has the same
...@@ -257,21 +200,18 @@ after(Timestamp ts) ...@@ -257,21 +200,18 @@ after(Timestamp ts)
* @return <code>true</code> if the specified object is equal to this * @return <code>true</code> if the specified object is equal to this
* object, <code>false</code> otherwise. * object, <code>false</code> otherwise.
*/ */
public boolean public boolean equals(Object obj)
equals(Object obj) {
{
if (obj == null) if (obj == null)
return(false); return false;
if (!(obj instanceof Timestamp)) if (!(obj instanceof Timestamp))
return(false); return false;
return(equals((Timestamp)obj)); return equals((Timestamp) obj);
} }
/*************************************************************************/
/** /**
* This method tests the specified timestamp for equality against this * This method tests the specified timestamp for equality against this
* object. This will be true if and only if the specified object is * object. This will be true if and only if the specified object is
* not <code>null</code> and contains all the same time value fields * not <code>null</code> and contains all the same time value fields
...@@ -282,20 +222,34 @@ equals(Object obj) ...@@ -282,20 +222,34 @@ equals(Object obj)
* @return <code>true</code> if the specified object is equal to this * @return <code>true</code> if the specified object is equal to this
* object, <code>false</code> otherwise. * object, <code>false</code> otherwise.
*/ */
public boolean public boolean equals(Timestamp ts)
equals(Timestamp ts) {
{
if (ts == null) if (ts == null)
return(false); return false;
if (ts.getTime() != getTime()) if (ts.getTime() != getTime())
return(false); return false;
if (ts.getNanos() != getNanos()) if (ts.getNanos() != getNanos())
return(false); return false;
return(true); return true;
} }
} // class Timestamp /**
* @since 1.2
*/
/*
public int compareTo(Timestamp ts)
{
}*/
/**
* @since 1.2
*//*
public int compareTo(Object obj)
{
return compareTo((Timestamp) obj);
}*/
}
...@@ -45,43 +45,41 @@ package java.sql; ...@@ -45,43 +45,41 @@ package java.sql;
*/ */
public class Types public class Types
{ {
// These should be self explanatory. People need a SQL book, not
// These should be self explanatory. People need a SQL book, not // Javadoc comments for these.
// Javadoc comments for these. public static final int BIT = -7;
public static final int TINYINT = -6;
public static final int BIT = -7; public static final int SMALLINT = 5;
public static final int TINYINT = -6; public static final int INTEGER = 4;
public static final int SMALLINT = 5; public static final int BIGINT = -5;
public static final int INTEGER = 4; public static final int FLOAT = 6;
public static final int BIGINT = -5; public static final int REAL = 7;
public static final int FLOAT = 6; public static final int DOUBLE = 8;
public static final int REAL = 7; public static final int NUMERIC = 2;
public static final int DOUBLE = 8; public static final int DECIMAL = 3;
public static final int NUMERIC = 2; public static final int CHAR = 1;
public static final int DECIMAL = 3; public static final int VARCHAR = 12;
public static final int CHAR = 1; public static final int LONGVARCHAR = -1;
public static final int VARCHAR = 12; public static final int DATE = 91;
public static final int LONGVARCHAR = -1; public static final int TIME = 92;
public static final int DATE = 91; public static final int TIMESTAMP = 93;
public static final int TIME = 92; public static final int BINARY = -2;
public static final int TIMESTAMP = 93; public static final int VARBINARY = -3;
public static final int BINARY = -2; public static final int LONGVARBINARY = -4;
public static final int VARBINARY = -3; public static final int NULL = 0;
public static final int LONGVARBINARY = -4; public static final int OTHER = 1111;
public static final int NULL = 0; public static final int JAVA_OBJECT = 2000;
public static final int OTHER = 1111; public static final int DISTINCT = 2001;
public static final int JAVA_OBJECT = 2000; public static final int STRUCT = 2002;
public static final int DISTINCT = 2001; public static final int ARRAY = 2003;
public static final int STRUCT = 2002; public static final int BLOB = 2004;
public static final int ARRAY = 2003; public static final int CLOB = 2005;
public static final int BLOB = 2004; public static final int REF = 2006;
public static final int CLOB = 2005; public static final int DATALINK = 70;
public static final int REF = 2006; public static final int BOOLEAN = 16;
// This class can't be instantiated. // This class can't be instantiated.
private Types () private Types()
{ {
} }
}
} // class Types
/* 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;
}
}
/* 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);
}
/* 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;
}
/* 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;
}
/* 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);
}
/* 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);
}
/* 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);
}
}
/* 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;
}
/* 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);
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment