harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r386087 [40/45] - in /incubator/harmony/enhanced/classlib/trunk: make/ make/patternsets/ modules/jndi/ modules/jndi/META-INF/ modules/jndi/make/ modules/jndi/make/common/ modules/jndi/src/ modules/jndi/src/main/ modules/jndi/src/main/java/ ...
Date Wed, 15 Mar 2006 14:57:17 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionEventListener.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionEventListener.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionEventListener.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionEventListener.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,53 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.util.EventListener;
+
+/**
+ * An interface used to receive events generated by a <code>PooledConnection</code>.
+ * <p>
+ * This interface would typically be implemented by a component which implements Connection
+ * Pooling (a Connection Pool Manager).  A Connection will signal events to a ConnectionEventListener
+ * either when the application closes a Connection it has been using or when a significant error
+ * occurs while the Connection is being used, where the Connection should not be used again.
+ * <p>
+ * The Connection Pool Manager can return closed Connections to the Pool for later reuse.
+ * Connections experiencing an error should be discarded.
+ * 
+ */
+public interface ConnectionEventListener extends EventListener {
+
+	/**
+	 * Notifies the ConnectionEventListener that an application has called the <code>close</code>
+	 * method on a pooled Connection.
+	 * @param theEvent a ConnectionEvent containing detail about the source of the event.
+	 */
+	public void connectionClosed(ConnectionEvent theEvent);
+	
+	/**
+	 * Notifies the ConnectionEventListener that an error has occurred while a PooledConnection
+	 * was being used and that the PooledConnection can no longer be used for work.  This notification
+	 * is done just before the SQLException passed in the event message is thrown to the application.
+	 * @param theEvent a ConnectionEvent containing detail about the source of the event and the
+	 * SQLException that has occurred.
+	 */
+	public void connectionErrorOccurred(ConnectionEvent theEvent);
+	
+} // end interface ConnectionEventListener
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,98 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.io.PrintWriter;
+
+/**
+ * An interface for the creation of PooledConnection objects.  Used internally within the package.
+ * <p>
+ * A class which implements the ConnectionPoolDataSource interface is typically registered with a JNDI
+ * naming service directory and is retrieved from there by name.
+ * 
+ */
+public interface ConnectionPoolDataSource {
+	
+	/**
+	 * Gets the Login Timeout value for this ConnectionPoolDataSource.  The Login Timeout is the maximum time
+	 * in seconds that the ConnectionPoolDataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @return the Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public int getLoginTimeout() throws SQLException;
+	
+	/**
+	 * Gets the Log Writer for this ConnectionPoolDataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * ConnectionPoolDataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an ConnectionPoolDataSource is created is null.
+	 * Note that the Log Writer for an ConnectionPoolDataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @return a PrintWriter which is the Log Writer for this ConnectionPoolDataSource. Can be null, in which
+	 * case log writing is disabled for this ConnectionPoolDataSource.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public PrintWriter getLogWriter() throws SQLException;
+	
+	/**
+	 * Create a connection to a database which can then be used as a pooled connection.
+	 * @return a PooledConnection which represents the connection to the database 
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public PooledConnection getPooledConnection() throws SQLException;
+	
+	/**
+	 * Create a connection to a database, using a supplied Username and Password, which can then 
+	 * be used as a pooled connection.
+	 * @param theUser a String containing a User Name for the database
+	 * @param thePassword a String containing the Password for the user identified by 
+	 * <code>theUser</code>
+	 * @return a PooledConnection which represents the connection to the database 
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public PooledConnection getPooledConnection(String theUser, String thePassword) throws SQLException;
+	
+	/**
+	 * Sets the Login Timeout value for this ConnectionPoolDataSource. The Login Timeout is the maximum time
+	 * in seconds that the ConnectionPoolDataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @param theTimeout the new Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLoginTimeout(int theTimeout) throws SQLException;
+	
+	/**
+	 * Sets the Log Writer for this ConnectionPoolDataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * ConnectionPoolDataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an ConnectionPoolDataSource is created is null.
+	 * Note that the Log Writer for an ConnectionPoolDataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @param theWriter a PrintWriter to use as the Log Writer for this ConnectionPoolDataSource.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLogWriter(PrintWriter theWriter) throws SQLException;
+
+} // end interface ConnectionPoolDataSource
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/DataSource.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/DataSource.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/DataSource.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/DataSource.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,118 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.io.PrintWriter;
+
+/**
+ * An interface for the creation of Connection objects which represent a connection to a
+ * database.  This interface is an alternative to the <code>java.sql.DriverManager</code>.
+ * <p>
+ * A class which implements the DataSource interface is typically registered with a JNDI
+ * naming service directory and is retrieved from there by name.
+ * <p>
+ * The DataSource interface is typically implemented by the writer of a JDBC driver.  There
+ * are three variants of the DataSource interface, which produce Connections with differing
+ * characteristics:
+ * <ol>
+ * <li>Standard DataSource, which produces standard Connection objects with no special features.</li>
+ * <li>Connection Pool DataSource, which produces PooledConnection objects which are able to
+ * participate in connection pooling, typically involving a connection pooling manager as an
+ * intermediary between applications and the database.</li>
+ * <li>Distributed transaction DataSource ("XADataSource"), which produces XAConnection objects
+ * which can be used to handle distributed transactions and which typically involve a transaction
+ * manager component in the system.  XAConnection objects also typically provide connection
+ * pooling capabilities as well as distributed transaction capabilities. </li>
+ * </ol>
+ * <p>
+ * Note that a JDBC driver which is accessed via the DataSource interface is loaded via a JNDI
+ * lookup process.  A driver loaded in this way does not register itself with the 
+ * <code>DriverManager</code>.
+ * 
+ */
+public interface DataSource {
+	
+	/**
+	 * Creates a connection to the database represented by this DataSource. 
+	 * @return a Connection object which is a connection to the database.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public Connection getConnection() throws SQLException;
+	
+	/**
+	 * Creates a connection to the database represented by this DataSource, using a supplied 
+	 * Username and Password,. 
+	 * @param theUsername a String containing a User Name for the database
+	 * @param thePassword  a String containing the Password for the user identified by 
+	 * <code>theUsername</code>
+	 * @return a Connection object which is a connection to the database.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public Connection getConnection(String theUsername, String thePassword) throws SQLException;
+
+	/**
+	 * Gets the Login Timeout value for this DataSource.  The Login Timeout is the maximum time
+	 * in seconds that the DataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @return the Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public int getLoginTimeout() throws SQLException;
+	
+	/**
+	 * Gets the Log Writer for this DataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * DataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an DataSource is created is null.
+	 * Note that the Log Writer for an DataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @return a PrintWriter which is the Log Writer for this DataSource. Can be null, in which
+	 * case log writing is disabled for this DataSource.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public PrintWriter getLogWriter() throws SQLException;
+	
+	/**
+	 * Sets the Login Timeout value for this DataSource. The Login Timeout is the maximum time
+	 * in seconds that the DataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @param theTimeout the new Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLoginTimeout( int theTimeout ) throws SQLException;
+	
+	/**
+	 * Sets the Log Writer for this DataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * DataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an DataSource is created is null.
+	 * Note that the Log Writer for an DataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @param theWriter a PrintWriter to use as the Log Writer for this DataSource.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLogWriter(PrintWriter theWriter) throws SQLException;
+	
+} // end interface DataSource
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/PooledConnection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/PooledConnection.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/PooledConnection.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/PooledConnection.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,94 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.sql.Connection;
+
+/**
+ * An interface which provides facilities for handling connections to a database which are pooled.
+ * <p>
+ * Typically, a PooledConnection is recycled when it is no longer required by an application, 
+ * rather than being closed and discarded.  The reason for treating connections in this way is that
+ * it can be an expensive process both to establish a connection to a database and to destroy
+ * the connection.  Reusing connections through a pool is a way of improving system performance
+ * and reducing overhead.
+ * <p>
+ * It is not intended that an application use the PooledConnection interface directly.  The 
+ * PooledConnection interface is intended for use by a component called a Connection Pool
+ * Manager, typically part of the infrastructure that supports use of the database by applications.
+ * <p>
+ * Applications obtain connections to the database by calling the <code>DataSource.getConnection</code> 
+ * method.  Under the covers, the Connection Pool Manager will get a PooledConnection object from
+ * its connection pool and passes back a Connection object that wraps or references the 
+ * PooledConnection object.  A new PooledConnection object will only be created if the pool is
+ * empty.
+ * <p>
+ * When the application is finished using a PooledConnection, the application calls the 
+ * <code>Connection.close</code> method. The Connection Pool Manager is notified via a
+ * ConnectionEvent from the Connection that this has happened (the Pool Manager registers itself
+ * with the Connection before the Connection is given to the application). The Pool Manager
+ * removes the underlying PooledConnection object from the Connection and returns it to the pool
+ * for reuse - the PooledConnection is thus recycled rather than being destroyed.
+ * <p>
+ * The connection to the database represented by the PooledConnection is kept open until the
+ * PooledConnection object itself is deactivated by the Connection Pool Manager, which calls the
+ * <code>PooledConnection.close</code> method.  This is typically done if there are too many
+ * inactive connections in the pool, if the PooledConnection encounters a problem that makes it
+ * unusable or if the whole system is being shut down. 
+ * 
+ */
+public interface PooledConnection {
+
+	/**
+	 * Registers the supplied ConnectionEventListener with this PooledConnection.  Once registered,
+	 * the ConnectionEventListener will receive ConnectionEvent events when they occur in the 
+	 * PooledConnection.
+	 * @param theListener an object which implements the ConnectionEventListener interface.
+	 */
+	public void addConnectionEventListener(ConnectionEventListener theListener);
+	
+	/**
+	 * Closes the connection to the database held by this PooledConnection. This method should not
+	 * be called directly by application code - it is intended for use by the Connection Pool
+	 * manager component.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void close() throws SQLException;
+	
+	/**
+	 * Creates a connection to the database.  This method is typically called by the Connectio
+	 * Pool manager when an application invokes the method <code>DataSource.getConnection</code>
+	 * and there are no PooledConnection objects available in the connection pool.
+	 * @return a Connection object that is a handle to this PooledConnection object.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public Connection getConnection() throws SQLException;
+	
+	/**
+	 * Deregister the supplied ConnectionEventListener from this PooledConnection.  Once
+	 * deregistered, the ConnectionEventListener will not longer receive events ocurring in the
+	 * PooledConnection. 
+	 * @param theListener an object which implements the ConnectionEventListener interface. This
+	 * object should have previously been registered with the PooledConnection using the 
+	 * <code>addConnectionEventListener</code> method.
+	 */
+	public void removeConnectionEventListener(ConnectionEventListener theListener);
+	
+} // end interface PooledConnection
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSet.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSet.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSet.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSet.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,591 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.Ref;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Map;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Calendar;
+import java.math.BigDecimal;
+
+/**
+ * A RowSet is an interface which provides access to data being sent from/to a database and
+ * which extends the functionality of ResultSet into a form that can be used as a JavaBeans
+ * component, perhaps being used in a visual programming environment.
+ * <p>
+ * Facilities are provided for get/set of propoerties relating to the Database and the SQL Command
+ * and for getting/setting data within the Rows represented by the RowSet. The RowSet supports
+ * JavaBeans events so that other components in an application can be informed when various
+ * changes happen to the RowSet, such as changes in data values.
+ * <p>
+ * RowSet is implemented as a layer on top of the remainder of the JDBC API.  A RowSet may be 
+ * <i>connected</i> where it maintains a connection to the database throughout its lifecycle.
+ * A RowSet may be <i>disconnected</i> where it establishes a connection to the database, gets
+ * data and then closes the connection.  Updates to a disconnected RowSet can be made and later
+ * send back the changes to the database, but this requires the RowSet to first reconnect to 
+ * the database before the changes are sent back.
+ * <p>
+ * Disconnected RowSets may make use of RowSetReaders to populate the RowSet with data, possibly 
+ * from a non-relational database source.  Disconnected RowSets may also use RowSetWriters to
+ * send data back to the underlying data store.  There is considerable freedom in the way that
+ * RowSetReaders and RowSetWriters are implemented to get and store data. 
+ * 
+ */
+public interface RowSet extends ResultSet {
+	
+	/**
+	 * Registers a supplied RowSetListener with this RowSet.  Once registered, the RowSetListener
+	 * is notified of events generated by the RowSet.
+	 * @param theListener an object which implements the <code>rowSetListener</code> interface.
+	 */
+	public void addRowSetListener(RowSetListener theListener);
+	
+	/**
+	 * Clears the parameters previously set for this RowSet.
+	 * <p>
+	 * Parameter values apply to repeated use of a RowSet object.  Setting a new value for a 
+	 * parameter clears its previous value.  <code>clearParameters</code> clears the values for
+	 * all parameters with one method call.
+	 * @throws SQLException if a problem occurs accessing the database
+	 */
+	public void	clearParameters() throws SQLException;
+	
+	/**
+	 * Fetches data for this RowSet. If successful, any existing data for the RowSet is discarded
+	 * and the metadata for the rowset is set.
+	 * <p>
+	 * Data is retrieved connects to the database and executes a Command.  This requires some or
+	 * all of the following properties to be set: url, data source name, user name, password, 
+	 * transaction isolation, type map ; plus some or all of the properties: command, read only, 
+	 * maximum field size, maximum rows, escape processing, and query timeout.  
+	 * <p>
+	 * The RowSet may use a RowSetReader to access the database - in this case a reader must be 
+	 * registered with the RowSet and the RowSet will then invoke the <code>readData</code> method
+	 * on the reader to fetch the data.
+	 * @throws SQLException if a problem occurs accessing the database or if the properties needed
+	 * to access the database have not been set
+	 */
+	public void	execute() throws SQLException;
+	
+	/**
+	 * Gets the RowSet's Command property.
+	 * @return a string containing the RowSet's Command property - this is an SQL Query which can
+	 * be executed to fetch data into the RowSet.
+	 */
+	public String getCommand();
+	
+	/**
+	 * Gets the name of the datasource for this RowSet. 
+	 * @return a String containing the name of the datasource.
+	 */
+	public String getDataSourceName();
+	
+	/**
+	 * Reports if escape processing is enabled for this RowSet.
+	 * <p>
+	 * If <code>true</code> (the default) the driver will automatically
+	 * perform escape code processing on SQL statements prior to them being sent
+	 * to the database.
+	 * 
+	 * @return true if escape processing is enabled, false otherwise.
+	 * @throws SQLException
+	 *             if a problem occurs accessing the database
+	 */
+	public boolean getEscapeProcessing() throws SQLException;
+	
+	/**
+	 * Gets the maximum number of bytes that can be returned for column values which are of types
+	 * BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR, or LONGVARCHAR. 
+	 * Excess data is silently discarded if the number is exceeded.
+	 * @return the current maximum size in bytes. 0 means no limit
+	 * @throws SQLException if a problem occurs accessing the database
+	 */
+	public int getMaxFieldSize() throws SQLException;
+	
+	/**
+	 * Gets the maximum number of rows for this RowSet. Excess rows are discarded silently if
+	 * the limit is exceeded.
+	 * @return the previous maximum number of rows. 0 implies no limit.
+	 * @throws SQLException if a problem occurs accessing the database
+	 */
+	public int getMaxRows() throws SQLException;
+	
+	/**
+	 * Gets the value of the password propoerty for this RowSet. This property is used when making
+	 * a connection to the database and should be set before invoking the <code>execute</code> method. 
+	 * @return a String containing the value of the password property.
+	 */
+	public String getPassword();
+	
+	/**
+	 * Gets the Timeout for the driver when executing a Query operation.
+	 * <p>
+	 * If a Query takes longer than the Timeout, an exception is thrown.
+	 * @return the Timeout value in seconds.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public int getQueryTimeout() throws SQLException;
+	
+	/**
+	 * Gets the transaction isolation property setting for this RowSet. 
+	 * @return an integer holding the current transaction isolation setting. One of:
+	 * one of Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, 
+	 * Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE
+	 */
+	public int getTransactionIsolation();
+	
+	/**
+	 * Gets the custom mapping of SQL types for this RowSet, if any.
+	 * @return a Map olding the custom mappings of SQL types to Java classes for this RowSet.  
+	 * By default, the Map is empty.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public Map getTypeMap() throws SQLException;
+	
+	/**
+	 * Gets the URL property value for this RowSet.  If there is no DataSource object specified, the
+	 * RowSet uses the URL to establish a connection to the database.  The default value for the
+	 * URL is null.
+	 * @return a String holding the value of the URL property.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public String getUrl() throws SQLException;
+	
+	/**
+	 * Gets the value of the Username property for this RowSet.  The Username is used when 
+	 * establishing a connection to the database and should be set before the <code>execute</code>
+	 * method is invoked.
+	 * @return a String holing the value of the Username property.
+	 */
+	public String getUsername();
+	
+	/**
+	 * Reports if this RowSet is read only. 
+	 * @return true if this RowSet is read only, false if it is updateable.
+	 */
+	public boolean isReadOnly(); 
+	
+	/**
+	 * Removes a specified RowSetListener object from the set of listeners which will be 
+	 * notified of events by this RowSet.
+	 * @param theListener the RowSetListener to remove from the set of listeners for this RowSet.
+	 */
+	public void removeRowSetListener(RowSetListener theListener);
+	
+	/**
+	 * Sets the specified ARRAY parameter in the RowSet command with the supplied java.sql.Array value.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theArray the java.sql.Array value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setArray( int parameterIndex, Array theArray ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the ASCII data in 
+	 * the supplied java.io.InputStream value. Data is read from the InputStream until end-of-file 
+	 * is reached.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theInputStream an InputStream containing the ASCII data to set into the parameter value
+	 * @param length the length of the data in bytes
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setAsciiStream( int parameterIndex, InputStream theInputStream, int length ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified SQL NUMERIC parameter in the RowSet command with the data in 
+	 * the supplied java.math.BigDecimal value.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theBigDecimal the BigDecimal containing the value
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setBigDecimal( int parameterIndex, BigDecimal theBigDecimal ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the binary data in 
+	 * the supplied java.io.InputStream value. Data is read from the InputStream until end-of-file 
+	 * is reached.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theInputStream an InputStream containing the binary data to set into the parameter value
+	 * @param length the length of the data in bytes
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setBinaryStream( int parameterIndex, InputStream theInputStream, int length ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the value of a
+	 * supplied java.sql.Blob.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theBlob the Blob value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setBlob( int parameterIndex, Blob theBlob ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to the supplied boolean.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theBoolean the boolean value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setBoolean( int parameterIndex, boolean theBoolean ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to the supplied byte value.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theByte the byte value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setByte( int parameterIndex, byte theByte ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to the supplied byte array value.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theByteArray the array of bytes to set into the parameter.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setBytes( int parameterIndex, byte[] theByteArray ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to the sequence of Unicode
+	 * characters carried by the supplied java.io.Reader. 
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theReader the Reader which contains the Unicode data to set into the parameter
+	 * @param length the length of the data in the Reader in characters
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setCharacterStream(int parameterIndex, Reader theReader, int length) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the value of a
+	 * supplied java.sql.Clob.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theClob the Clob value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setClob(int parameterIndex, Clob theClob ) throws SQLException;
+	
+	/**
+	 * Sets the Command property for this RowSet - the command is an SQL Query which runs when the
+	 * <code>execute</code> method is invoked. This property is optional for datasources that
+	 * do not support commands. 
+	 * @param cmd a String containing the SQL Query.  Can be null.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setCommand(String cmd) throws SQLException;
+	
+	/**
+	 * Sets the concurrency property of this RowSet.  The default value is 
+	 * ResultSet.CONCUR_READ_ONLY.
+	 * @param concurrency the new concurrency value - one of: ResultSet.CONCUR_READ_ONLY 
+	 * or ResultSet.CONCUR_UPDATABLE
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setConcurrency(int concurrency) throws SQLException;
+     
+	/**
+	 * Sets the Data Source Name property for the RowSet. 
+	 * <p>
+	 * The Data Source Name can be used to find a <code>DataSource</code> which has been registered
+	 * with a naming service - the DataSource can then be used to create a connection to the 
+	 * database. 
+	 * @param name a String with the new Data Source Name.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setDataSourceName(String name) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the value of a
+	 * supplied java.sql.Date.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theDate the Date to use
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setDate( int parameterIndex, Date theDate ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the value of a
+	 * supplied java.sql.Date, where the conversion of the Date to an SQL DATE value is calculated
+	 * using a supplied Calendar.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theDate the Date to use
+	 * @param theCalendar the Calendar to use in coverting the Date to an SQL DATE value
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setDate( int parameterIndex, Date theDate, Calendar theCalendar ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the supplied
+	 * double.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theDouble the double value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setDouble( int parameterIndex, double theDouble ) throws SQLException;
+     
+	/**
+	 * Sets the Escape Processing status for this RowSet. If escape processing is on, the driver
+	 * performs escape substitution before sending an SQL command to the database.  The default
+	 * value for escape processing is on.
+	 * @param enable true to enable Escape Processing, false to turn it off.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setEscapeProcessing( boolean enable ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the supplied
+	 * float.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theFloat the float value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setFloat( int parameterIndex, float theFloat ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the supplied
+	 * integer.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theInteger the integer value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setInt( int parameterIndex, int theInteger ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command with the supplied
+	 * long.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theLong the long value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setLong( int parameterIndex, long theLong ) throws SQLException;
+     
+	/**
+	 * Sets the maximum number of bytes which can be returned for a column value where the column
+	 * type BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR, or LONGVARCHAR.  Data which
+	 * exceeds this limit is silently discarded.  For portability, a value greater than 256 is
+	 * recommended.
+	 * @param max the maximum size of the returned column value in bytes. 0 means unlimited.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setMaxFieldSize(int max) throws SQLException;
+     
+	/**
+	 * Sets the maximum number of rows which can be held by the RowSet. Any additional rows are
+	 * silently discarded.
+	 * @param max the maximum number of rows which can be held in the RowSet. 0 means no limit.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setMaxRows(int max) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to SQL NULL.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param sqlType the type of the parameter, as defined by java.sql.Types.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setNull( int parameterIndex, int sqlType ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to SQL NULL.  This form
+	 * of the <code>setNull</code> method should be used for User Defined Types and REF parameters.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param sqlType the type of the parameter, as defined by java.sql.Types.
+	 * @param typeName the fully qualified name of an SQL User Defined Type or the name of the
+	 * SQL structured type referenced by a REF type. Ignored if the sqlType is not a UDT or REF
+	 * type.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setNull( int parameterIndex, int sqlType, String typeName ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied Java
+	 * object.
+	 * <p>
+	 * The JDBC specification provides a standard mapping for Java objects to SQL data types.
+	 * Database specific types can be mapped by JDBC driver specific Java types.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theObject the Java object containing the data value.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setObject(int parameterIndex, Object theObject ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied Java
+	 * object.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theObject the Java object containing the data value.
+	 * @param targetSqlType the SQL type to send to the database, as defined in java.sql.Types.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setObject(int parameterIndex, Object theObject, int targetSqlType) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied Java
+	 * object.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theObject the Java object containing the data value.
+	 * @param targetSqlType the SQL type to send to the database, as defined in java.sql.Types.
+	 * @param scale the number of digits after the decimal point, for java.sql.Types.DECIMAL and
+	 * java.sql.Types.NUMERIC types. Ignored for all other types.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) throws SQLException;
+     
+	/**
+	 * Sets the database Password for this RowSet.
+	 * @param password a string holding the new password
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setPassword( String password ) throws SQLException;
+     
+	/**
+	 * Sets the Timeout value for this RowSet.  The timeout is the maximum time that the driver
+	 * will wait while executing a command - after this time, an SQLException is thrown.
+	 * @param seconds the number of seconds for the Timeout.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setQueryTimeout( int seconds ) throws SQLException;
+     
+	/**
+	 * Sets whether the RowSet is read only or is updateable.
+	 * @param readOnly true to set the RowSet to readonly state, false to allow updates.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setReadOnly( boolean readOnly ) throws SQLException;
+     
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Ref.
+	 * This is sent to the database as an SQL REF value.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theRef the Ref value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setRef( int parameterIndex, Ref theRef ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied short
+	 * integer.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theShort the short value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setShort( int parameterIndex, short theShort ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied String.
+	 * The String is placed into the database as a VARCHAR or LONGVARCHAR SQL value, depending
+	 * on the database limits for the length of VARCHAR values.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theString
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setString( int parameterIndex, String theString ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Time,
+	 * converting to an SQL TIME value using the system default Calendar. 
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theTime the Time value to set
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setTime( int parameterIndex, Time theTime ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Time,
+	 * converting to an SQL TIME value using a supplied Calendar. 
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theTime the Time value to set
+	 * @param theCalendar the Calendar to use in the conversion operation
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setTime( int parameterIndex, Time theTime, Calendar theCalendar ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Timestamp,
+	 * converting to an SQL TIMESTAMP value using the system default Calendar.
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theTimestamp
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setTimestamp( int parameterIndex, Timestamp theTimestamp ) throws SQLException;
+	
+	/**
+	 * Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Timestamp
+	 * converting to an SQL TIMESTAMP value using a supplied Calendar. 
+	 * @param parameterIndex index of the parameter to set, where the first parameter has index = 1.
+	 * @param theTimestamp
+	 * @param theCalendar the Calendar to use in the conversion operation
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setTimestamp( int parameterIndex, Timestamp theTimestamp, Calendar theCalendar ) throws SQLException;
+	
+	/**
+	 * Updates the target instance's transaction isolation level to one of a
+	 * discrete set of possible values.
+	 * 
+	 * @param level
+	 *            the new transaction isolation level. One of:
+	 *            Connection.TRANSACTION_READ_UNCOMMITTED,
+	 *            Connection.TRANSACTION_READ_COMMITTED,
+	 *            Connection.TRANSACTION_REPEATABLE_READ, or
+	 *            Connection.TRANSACTION_SERIALIZABLE
+	 * @throws SQLException
+	 *             if an error occurs accessing the database.
+	 */
+	public void setTransactionIsolation(int level) throws SQLException;
+	
+	/**
+	 * Sets the type of this RowSet.  By default, the type is non-scollable.
+	 * @param type the new type for the RowSet.  One of: ResultSet.TYPE_FORWARD_ONLY, 
+	 * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setType(int type) throws SQLException;
+	
+	/**
+	 * Sets the Map used to map SQL User Defined Types to Java classes. 
+	 * @param theTypeMap a Map which defines the names of SQL UDTs and the Java classes to
+	 * which they are mapped.
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setTypeMap( Map theTypeMap ) throws SQLException;
+	
+	/**
+	 * Sets the URL used by this RowSet to access the database via a <code>DriverManager</code>.
+	 * The URL is optional - an alternative is to use a Data Source Name to create a connection.
+	 * @param theURL a String containing the URL for the database. Can be null. 
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setUrl( String theURL ) throws SQLException;
+	
+	/**
+	 * Sets the Username property for the RowSet, used to authenticate a connection to the
+	 * database.
+	 * @param theUsername a String containing the User Name
+	 * @throws SQLException if an error occurs accessing the database.
+	 */
+	public void setUsername( String theUsername ) throws SQLException;
+
+} // end interface RowSet
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetEvent.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetEvent.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetEvent.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetEvent.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,51 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.util.EventObject;
+import java.io.Serializable;
+
+/**
+ * An event which is sent when specific events happen to a RowSet object.  The events are sent
+ * to inform registered listeners that changes have occurred to the RowSet.  The events covered
+ * are:
+ * <ol>
+ * <li>A single row in the RowSet changes</li>
+ * <li>The whole set of data in the RowSet changes</li>
+ * <li>The RowSet cursor position changes</li>
+ * </ol>
+ * The event contains a reference to the RowSet object which generated the message so that
+ * the listeners can extract whatever information they need from that reference.
+ * 
+ */
+public class RowSetEvent extends EventObject implements Serializable {
+	
+	private static final long serialVersionUID = -1875450876546332005L;
+
+	/**
+	 * Creates a RowSetEvent object containing a reference to the RowSet object that generated
+	 * the event.  Information about the changes that have occurred to the RowSet can be extracted
+	 * from the RowSet using one or more of the query methods available on the RowSet.
+	 * @param theSource the RowSet which generated the event
+	 */
+	public RowSetEvent(RowSet theSource) {
+		super( theSource );
+	} // end method RowSetEvent( RowSet )
+	
+} // end class RowSetEvent
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetInternal.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetInternal.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetInternal.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetInternal.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,72 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.sql.ResultSet;
+
+/**
+ * An interface provided by a RowSet object to either a RowSetReader or a RowSetWriter, providing
+ * facilities to read and update the internal state of the RowSet.
+ * 
+ */
+public interface RowSetInternal {
+
+	/**
+	 * Gets the Connection associated with this RowSet object.
+	 * @return the Connection
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public Connection getConnection() throws SQLException;
+	
+	/**
+	 * Gets the ResultSet that was the original (unmodified) content of the RowSet.
+	 * <p>
+	 * The ResultSet cursor is positioned before the first row of data
+	 * @return the ResultSet that contained the original data value of the RowSet
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public ResultSet getOriginal() throws SQLException;
+	
+	/**
+	 * Gets the original value of the current row only.  If the current row did not have an
+	 * original value, then an empty value is returned.
+	 * @return a ResultSet containing the value of the current row only.
+	 * @throws SQLException if there is a problem accessing the database, or if the cursor is not
+	 * on a valid row (before first, after last or pointing to the insert row).
+	 */
+	public ResultSet getOriginalRow() throws SQLException;
+	
+	/**
+	 * Gets the parameter values that have been set for this RowSet's command.
+	 * @return an Object array containing the values of parameters that have been set.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public Object[] getParams() throws SQLException;
+	
+	/**
+	 * Sets RowSetMetaData for this RowSet.  The RowSetMetaData is used by a RowSetReader to
+	 * set values giving information about the RowSet's columns.
+	 * @param theMetaData a RowSetMetaData holding the metadata about the RowSet's columns.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setMetaData( RowSetMetaData theMetaData ) throws SQLException;
+	
+} // end interface RowSetInternal
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetListener.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetListener.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetListener.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetListener.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,57 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.util.EventListener;
+
+/**
+ * An interface used to send notification of events occurring in a RowSet.  To receive the
+ * notification events, an object must implement the RowSetListener interface and then register
+ * itself with the RowSet of interest using the <code>RowSet.addRowSetListener</code> method.
+ * 
+ */
+public interface RowSetListener extends EventListener {
+	
+	/**
+	 * Notifies the listener that one of the RowSet's rows has changed.
+	 * @param theEvent a RowSetEvent that contains information about the RowSet involved.
+	 * This information can be used to retrieve information about the change, such as the new
+	 * cursor position.
+	 */
+	public void cursorMoved(RowSetEvent theEvent);
+	
+	/**
+	 * Notifies the listener that the RowSet's cursor has moved.
+	 * @param theEvent theEvent a RowSetEvent that contains information about the RowSet involved.
+	 * This information can be used to retrieve information about the change, such as the updated
+	 * data values.
+	 */
+	public void rowChanged(RowSetEvent theEvent);
+	
+	/**
+	 * Notifies the listener that the RowSet's entire contents have been updated (an example is
+	 * the execution of a command which retrieves new data from the database).
+	 * @param theEvent theEvent a RowSetEvent that contains information about the RowSet involved.
+	 * This information can be used to retrieve information about the change, such as the updated
+	 * rows of data.
+	 */
+	public void rowSetChanged(RowSetEvent theEvent);
+	
+
+} // end interface RowSetListener
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,191 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+
+/**
+ * An interface which provides facilities for getting information about the
+ * columns in a RowSet.
+ * <p>
+ * RowSetMetaData extends ResultSetMetaData, adding new operations for carrying
+ * out value sets.
+ * <p>
+ * Application code would not mormally call this interface directly. It would be
+ * called internally when <code>RowSet.execute</code> is called.
+ * 
+ */
+public interface RowSetMetaData extends ResultSetMetaData {
+
+	/**
+	 * Sets automatic numbering for a specified column in the RowSet.  If automatic numbering is
+	 * on, the column is read only.  The default value is for automatice numbering to be off.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param autoIncrement true to set automatic numbering on, false to turn it off. 
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setAutoIncrement( int columnIndex, boolean autoIncrement ) throws SQLException;
+	
+	/**
+	 * Sets the case sensitive property for a specified column in the RowSet.  The default is that
+	 * the column is not case sensitive. 
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param caseSensitive true to make the column case sensitive, false to make it not case
+	 * sensitive.
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setCaseSensitive( int columnIndex, boolean caseSensitive ) throws SQLException;
+	
+	/**
+	 * Sets the Catalog Name for a specified column in the RowSet.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param catalogName a string containing the new Catalog Name
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setCatalogName( int columnIndex, String catalogName ) throws SQLException;
+	
+	/**
+	 * Sets the number of columns in the Row Set.
+	 * @param columnCount an integer containing the number of columns in the RowSet.
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnCount(int columnCount) throws SQLException;
+	
+	/**
+	 * Sets the normal maximum width in characters for a specified column in the RowSet.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param displaySize an integer with the normal maximum column width in characters
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnDisplaySize( int columnIndex, int displaySize ) throws SQLException;
+	
+	/**
+	 * 
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theLabel
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnLabel(int columnIndex, String theLabel) throws SQLException;
+	
+	/**
+	 * Sets the suggested column label for a specified column in the RowSet.  This label is
+	 * typically used in displaying or printing the column.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theColumnName a string containing the column label
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnName(int columnIndex, String theColumnName) throws SQLException;
+	
+	/**
+	 * Sets the SQL type for a specified column in the RowSet
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theSQLType an integer containing the SQL Type, as defined by java.sql.Types.
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnType(int columnIndex, int theSQLType) throws SQLException;
+	
+	/**
+	 * Sets the Type Name for a specified column in the RowSet, where the data type is 
+	 * specific to the datasource.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theTypeName a string containing the Type Name for the colunm
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setColumnTypeName(int columnIndex, String theTypeName) throws SQLException;
+	
+	/**
+	 * Sets whether a specified column is a currency value.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param isCurrency true if the column should be treated as a currency value, false if it
+	 * should not be treated as a currency value.
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setCurrency( int columnIndex, boolean isCurrency ) throws SQLException;
+	
+	/**
+	 * Sets whether a specified column can contain SQL NULL values.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param nullability an integer which is one of the following values: 
+	 * ResultSetMetaData.columnNoNulls, ResultSetMetaData.columnNullable, or 
+	 * ResultSetMetaData.columnNullableUnknown
+	 * <p>
+	 * The default value is ResultSetMetaData.columnNullableUnknown
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setNullable( int columnIndex, int nullability ) throws SQLException;
+	
+	/**
+	 * Sets the number of decimal digits for a specified column in the RowSet.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param thePrecision an integer containoing the number of decimal digits
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setPrecision( int columnIndex, int thePrecision ) throws SQLException;
+	
+	/**
+	 * For the column specified by <code>columnIndex</code> declares how many
+	 * digits there should be after a decimal point.
+	 * 
+	 * @param columnIndex
+	 *            the index number for the column, where the first column has
+	 *            index 1.
+	 * @param theScale
+	 *            an integer containing the number of digits after the decimal
+	 *            point
+	 * @throws SQLException
+	 *             if a problem occurs accessing the database
+	 */
+	public void setScale( int columnIndex, int theScale ) throws SQLException;
+	
+	/**
+	 * Sets the Schema Name for a specified column in the RowSet
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theSchemaName a String containing the schema name
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setSchemaName( int columnIndex, String theSchemaName) throws SQLException;
+	
+	/**
+	 * Sets whether a specified column can be used in a search involving a WHERE clause. The
+	 * default value is false.
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param isSearchable true of the column can be used in a WHERE clause search, false otherwise.
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setSearchable( int columnIndex, boolean isSearchable ) throws SQLException;
+	
+	/**
+	 * Sets if a specified column can contain signed numbers
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param isSigned true if the column can contain signed numbers, false otherwise
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setSigned( int columnIndex, boolean isSigned ) throws SQLException;
+	
+	/**
+	 * Sets the Table Name for a specified column in the RowSet
+	 * @param columnIndex the index number for the column, where the first column has index 1.
+	 * @param theTableName a String containing the Table Name for the column
+	 * @throws SQLException if a problem occurs accessing the database 
+	 */
+	public void setTableName( int columnIndex, String theTableName ) throws SQLException;
+	
+	
+} // end interface RowSetMetaData
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,48 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+
+/**
+ * An interface which provides functionality for a disconnected RowSet to get data from a data source
+ * into its rows.  The RowSet calls the RowSetReader interface when the RowSet's execute method is
+ * invoked - a RowSetReader must firat be registered with the RowSet for this to work.
+ * 
+ */
+public interface RowSetReader {
+
+	/**
+	 * Reads new data into the RowSet.  The calling RowSet object must itself implement the 
+	 * RowSetInternal interface and the RowSetReader must be registered as a Reader on the
+	 * RowSet.
+	 * <p>
+	 * This method adds rows into the calling RowSet.  The Reader may invoke any of the RowSet's
+	 * methods except for the <code>execute</code> method (calling execute will cause an
+	 * SQLException to be thrown).  However, when the Reader calls the RowSet's methods, no
+	 * events are sent to listeners - any listeners are informed by the calling RowSet's
+	 * execute method once the Reader returns from the readData method.
+	 * @param theCaller must be the calling RowSet object, which must have implemented the
+	 * RowSetInternal interface.
+	 * @throws SQLException if a problem occurs accessing the database or if the Reader calls
+	 * the RowSet.execute method. 
+	 */
+	public void readData(RowSetInternal theCaller) throws SQLException;
+	
+} // end interface RowSetReader
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,49 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+
+/**
+ * An interface which provides functionality for a disconnected RowSet to put data updates back to
+ * the data source from which the RowSet was originally populated.  An object implementing this 
+ * interface is called a Writer.
+ * <p>
+ * The Writer must establish a connection to the RowSet's data source before writing the data.
+ * The RowSet calling this interface must implement the RowSetInternal interface.
+ * <p>
+ * The Writer may encounter a situation where the updated data being written back to the 
+ * data source has already been updated in the data source.  How a conflict of this kind is
+ * handled is determined by the implementation of the Writer. 
+ * 
+ */
+public interface RowSetWriter {
+	
+	/**
+	 * Writes changes in the RowSet associated with this RowSetWriter back to its data source.
+	 * @param theRowSet the RowSet object.  This RowSet must a) Implement the RowSetInternal interface
+	 * and b) have have this RowSetWriter registered with it and c) must call this method
+	 * internally
+	 * @return true if the modified data was written, false otherwise (which typically implies 
+	 * some form of conflict)
+	 * @throws SQLException if a problem occurs accessing the database
+	 */
+	public boolean writeData(RowSetInternal theRowSet) throws SQLException;
+
+} // end interface RowSetWriter
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,42 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import javax.transaction.xa.XAResource;
+
+/**
+ * An interface that is used to support the participation of a database connection in distributed
+ * transactions.  An XAConnection returns an XAResource object which can be used by a Transaction
+ * Manager to manage the XAConnection as part of a distributed transaction.
+ * <p>
+ * It is not intended that this interface is used directly by application code.   It is designed for
+ * use by system components which implement distributed transaction support.
+ * 
+ */
+public interface XAConnection extends PooledConnection {
+
+	/**
+	 * Gets an XAResource which a transaction manager can use to manage the participation of this
+	 * XAConnection in a distributed transaction.
+	 * @return an XAResource object
+	 * @throws SQLException if an error occurs in accessing the database.
+	 */
+	public XAResource getXAResource() throws SQLException;
+	
+} // end interface XAConnection
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,101 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.io.PrintWriter;
+
+/**
+ * An interface for the creation of XAConnection objects.  Used internally within the package.
+ * <p>
+ * A class which implements the XADataSource interface is typically registered with a JNDI
+ * naming service directory and is retrieved from there by name.
+ * 
+ */
+public interface XADataSource {
+	
+	/**
+	 * Gets the Login Timeout value for this XADataSource.  The Login Timeout is the maximum time
+	 * in seconds that the XADataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @return the Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public int getLoginTimeout() throws SQLException;
+	
+	/**
+	 * Sets the Login Timeout value for this XADataSource. The Login Timeout is the maximum time
+	 * in seconds that the XADataSource will wait when opening a connection to a database. A Timeout
+	 * value of 0 implies either the system default timeout value (if there is one) or that there
+	 * is no timeout.  The default value for the Login Timeout is 0.
+	 * @param theTimeout the new Login Timeout value in seconds.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLoginTimeout( int theTimeout ) throws SQLException;
+	
+	/**
+	 * Gets the Log Writer for this XADataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * XADataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an XADataSource is created is null.
+	 * Note that the Log Writer for an XADataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @return a PrintWriter which is the Log Writer for this XADataSource. Can be null, in which
+	 * case log writing is disabled for this XADataSource.
+	 * @throws SQLException
+	 */
+	public PrintWriter getLogWriter() throws SQLException;
+	
+	/**
+	 * Create a connection to a database which can then be used in a distributed transaction.
+	 * @return an XAConnection object representing the connection to the database, which can then
+	 * be used in a distributed transaction.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public XAConnection getXAConnection() throws SQLException;
+	
+	/**
+	 * Create a connection to a database, using a supplied Username and Password, which can then be
+	 * used in a distributed transaction.
+	 * @param theUser a String containing a User Name for the database
+	 * @param thePassword a String containing the Password for the user identified by 
+	 * <code>theUser</code>
+	 * @return an XAConnection object representing the connection to the database, which can then
+	 * be used in a distributed transaction.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public XAConnection getXAConnection(String theUser, String thePassword) throws SQLException;
+	
+	/**
+	 * Sets the Log Writer for this XADataSource.
+	 * <p>
+	 * The Log Writer is a stream to which all log and trace messages are sent from this
+	 * XADataSource. The Log Writer can be null, in which case, log and trace capture is
+	 * disabled.  The default value for the Log Writer when an XADataSource is created is null.
+	 * Note that the Log Writer for an XADataSource is not the same as the Log Writer used by
+	 * a <code>DriverManager</code>.
+	 * @param theWriter a PrintWriter to use as the Log Writer for this XADataSource.
+	 * @throws SQLException if there is a problem accessing the database.
+	 */
+	public void setLogWriter( PrintWriter theWriter ) throws SQLException;
+	
+
+} // end interface XADataSource
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,48 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown when a request contains invalid transaction context information.
+ * 
+ */
+public class InvalidTransactionException extends RemoteException implements Serializable {
+	
+	private static final long serialVersionUID = 3597320220337691496L;
+	
+	/**
+	 * Creates an InvalidTransactionException with no error message
+	 *
+	 */
+	public InvalidTransactionException() {
+		super();
+	} // end method InvalidTransactionException()
+	
+	/**
+	 * Creates an InvalidTransactionException with a specified error message
+	 * @param msg a string containing the error message
+	 */
+	public InvalidTransactionException(String msg) {
+		super( msg );
+	} // end method InvalidTransactionException( String )
+
+} // end class InvalidTransactionException
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,49 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown when a request is made which supplied a null transaction
+ * context in a situation where an active transaction is required.
+ * 
+ */
+public class TransactionRequiredException extends RemoteException implements Serializable {
+
+	private static final long serialVersionUID = -1898806419937446439L;
+	
+	/**
+	 * Creates a TransactionRequiredException with no error message.
+	 *
+	 */
+	public TransactionRequiredException() {
+		super();
+	} // end method TransactionRequiredException()
+	
+	/**
+	 * Creates a TransactionRequiredException with a specified error message.
+	 * @param msg a String holding the error message
+	 */
+	public TransactionRequiredException(String msg) {
+		super( msg );
+	} // end method TransactionRequiredException(String msg)
+	
+} // end class TransactionRequiredException
+
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,49 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown to indicate that the transaction associated with a request
+ * has been rolled back or marked for rollback. So the requested operation cannot be completed.
+ * 
+ */
+public class TransactionRolledbackException extends RemoteException implements Serializable {
+	
+	private static final long serialVersionUID = -3142798139623020577L;
+
+	/**
+	 * Creates a TransactionRolledbackException with no error message
+	 *
+	 */
+	public TransactionRolledbackException() {
+		super();
+	} // end method TransactionRolledbackException()
+	
+	/**
+	 * Creates a TransactionRolledbackException with a specified error message
+	 * @param msg a String containing the error message
+	 */
+	public TransactionRolledbackException(String msg) {
+		super( msg );
+	} // end method TransactionRolledbackException( String )
+	
+} // end class TransactionRolledbackException
+
+



Mime
View raw message