Package org.apache.derby.client.am
Interface ClientJDBCObjectFactory
- All Known Implementing Classes:
ClientJDBCObjectFactoryImpl
,ClientJDBCObjectFactoryImpl42
public interface ClientJDBCObjectFactory
The methods of this interface are used to return JDBC interface
implementations to the user depending on the JDBC version supported
by the JDK.
-
Method Summary
Modifier and TypeMethodDescriptionnewBatchUpdateException
(LogWriter logWriter, ClientMessageId msgid, Object[] args, long[] updateCounts, SqlException cause) Creates a BatchUpdateException depending on the JVM level.newCachingLogicalConnection
(ClientConnection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache) Returns an instance of aCachingLogicalConnection
, which provides caching of prepared statements.newCallableStatement
(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc) Returns an instance of ClientCallableStatement, ClientCallableStatement40 or ClientCallableStatement42 which all implement java.sql.CallableStatement.newClientPooledConnection
(BasicClientDataSource40 ds, LogWriter logWriter, String user, String password) This method is used to return an instance of theClientPooledConnection
class which implementsjavax.sql.PooledConnection
.newClientXAConnection
(BasicClientDataSource40 ds, LogWriter logWriter, String user, String password) This method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implementsjavax.sql.XAConnection
.newColumnMetaData
(LogWriter logWriter) Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under usenewColumnMetaData
(LogWriter logWriter, int upperBound) Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under usenewLogicalCallableStatement
(CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Returns a new logical callable statement object.newLogicalConnection
(ClientConnection physicalConnection, ClientPooledConnection pooledConnection) Returns an instance of LogicalConnection.newLogicalPreparedStatement
(PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Returns a new logical prepared statement object.newNetConnection
(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties) This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection this implements the java.sql.Connection interfacenewNetConnection
(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn) This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection.newNetConnection
(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) This method returns an instance of NetConnection (or NetConnection40) class which extends Connection.newNetDatabaseMetaData
(Agent netAgent, ClientConnection netConnection) This method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implementsjava.sql.DatabaseMetaData
.newNetResultSet
(Agent netAgent, MaterialStatement netStatement, Cursor cursor, int qryprctyp, int sqlcsrhld, int qryattscr, int qryattsns, int qryattset, long qryinsid, int actualResultSetType, int actualResultSetConcurrency, int actualResultSetHoldability) This method returns an instance of NetResultSet(or NetResultSet40) which extends from ClientResultSet which implementsjava.sql.ResultSet
.newParameterMetaData
(ColumnMetaData columnMetaData) returns an instance of ParameterMetaData or ParameterMetaData40 depending on the jdk version under usenewPreparedStatement
(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) Returns an instance of PreparedStatement (or PreparedStatement40) which implementsjava.sql.PreparedStatement
.newPreparedStatement
(Agent agent, ClientConnection connection, String sql, Section section, ClientPooledConnection cpc) This method returns an instance of PreparedStatement (or PreparedStatement40) which implementsjava.sql.PreparedStatement
.newStatement
(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) This method provides an instance of Statement or Statement40 depending on the jdk version under use
-
Method Details
-
newClientPooledConnection
ClientPooledConnection newClientPooledConnection(BasicClientDataSource40 ds, LogWriter logWriter, String user, String password) throws SQLException This method is used to return an instance of theClientPooledConnection
class which implementsjavax.sql.PooledConnection
.- Throws:
SQLException
-
newClientXAConnection
ClientXAConnection newClientXAConnection(BasicClientDataSource40 ds, LogWriter logWriter, String user, String password) throws SQLException This method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implementsjavax.sql.XAConnection
.- Throws:
SQLException
-
newCallableStatement
ClientCallableStatement newCallableStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc) throws SqlException Returns an instance of ClientCallableStatement, ClientCallableStatement40 or ClientCallableStatement42 which all implement java.sql.CallableStatement.- Parameters:
agent
- The instance of NetAgent associated with this CallableStatement object.connection
- The connection object associated with this PreparedStatement Object.sql
- A String object that is the SQL statement to be sent to the database.type
- One of the ResultSet type constantsconcurrency
- One of the ResultSet concurrency constantsholdability
- One of the ResultSet holdability constantscpc
- The PooledConnection object that will be used to notify the PooledConnection reference of the Error Occurred and the Close events.- Returns:
- a CallableStatement object
- Throws:
SqlException
-
newLogicalConnection
LogicalConnection newLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection) throws SqlException Returns an instance of LogicalConnection. This method returns an instance of LogicalConnection (or LogicalConnection40) which implementsjava.sql.Connection
.- Throws:
SqlException
-
newCachingLogicalConnection
LogicalConnection newCachingLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache) throws SqlException Returns an instance of aCachingLogicalConnection
, which provides caching of prepared statements.- Parameters:
physicalConnection
- the underlying physical connectionpooledConnection
- the pooled connectionstmtCache
- statement cache- Returns:
- A logical connection with statement caching capabilities.
- Throws:
SqlException
- if creation of the logical connection fails
-
newPreparedStatement
ClientPreparedStatement newPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section, ClientPooledConnection cpc) throws SqlException This method returns an instance of PreparedStatement (or PreparedStatement40) which implementsjava.sql.PreparedStatement
. It has theClientPooledConnection
as one of its parameters this is used to raise the Statement Events when the prepared statement is closed- Parameters:
agent
- The instance of NetAgent associated with this CallableStatement object.connection
- The connection object associated with this PreparedStatement Object.sql
- A String object that is the SQL statement to be sent to the database.section
- Sectioncpc
- The ClientPooledConnection wraps the underlying physical connection associated with this prepared statement. It is used to pass the Statement closed and the Statement error occurred events that occur back to the ClientPooledConnection.- Returns:
- a PreparedStatement object
- Throws:
SqlException
-
newPreparedStatement
ClientPreparedStatement newPreparedStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException Returns an instance of PreparedStatement (or PreparedStatement40) which implementsjava.sql.PreparedStatement
. It has the ClientPooledConnection as one of its parameters this is used to raise the Statement Events when the prepared statement is closed- Parameters:
agent
- The instance of NetAgent associated with this CallableStatement object.connection
- The connection object associated with this PreparedStatement Object.sql
- A String object that is the SQL statement to be sent to the database.type
- One of the ResultSet type constants.concurrency
- One of the ResultSet concurrency constants.holdability
- One of the ResultSet holdability constants.autoGeneratedKeys
- a flag indicating whether auto-generated keys should be returned.columnNames
- an array of column names indicating the columns that should be returned from the inserted row or rows.columnIndexes
- an array of column indexes indicating the columns that should be returned form the inserted row.cpc
- The ClientPooledConnection wraps the underlying physical connection associated with this prepared statement it is used to pass the Statement closed and the Statement error occurred events that occur back to the ClientPooledConnection.- Returns:
- a PreparedSatement object
- Throws:
SqlException
-
newLogicalPreparedStatement
LogicalPreparedStatement newLogicalPreparedStatement(PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Returns a new logical prepared statement object.- Parameters:
ps
- underlying physical prepared statementstmtKey
- key for the underlying physical prepared statementcacheInteractor
- the statement cache interactor- Returns:
- A logical prepared statement.
-
newLogicalCallableStatement
LogicalCallableStatement newLogicalCallableStatement(CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Returns a new logical callable statement object.- Parameters:
cs
- underlying physical callable statementstmtKey
- key for the underlying physical callable statementcacheInteractor
- the statement cache interactor- Returns:
- A logical callable statement.
-
newNetConnection
ClientConnection newNetConnection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties) throws SqlException This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection this implements the java.sql.Connection interface- Throws:
SqlException
-
newNetConnection
ClientConnection newNetConnection(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn) throws SqlException This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection. This implements thejava.sql.Connection
interface.- Throws:
SqlException
-
newNetConnection
ClientConnection newNetConnection(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException This method returns an instance of NetConnection (or NetConnection40) class which extends Connection. This implements thejava.sql.Connection
interface. This method is used to pass the ClientPooledConnection object to the NetConnection object which can then be used to pass the statement events back to the user- Parameters:
logWriter
- LogWriter object associated with this connectionuser
- user id for this connectionpassword
- password for this connectiondataSource
- The DataSource object passed from the PooledConnection object from which this constructor was calledrmId
- The Resource Manager ID for XA ConnectionsisXAConn
- true if this is a XA connectioncpc
- The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object- Throws:
SqlException
-
newNetResultSet
ClientResultSet newNetResultSet(Agent netAgent, MaterialStatement netStatement, Cursor cursor, int qryprctyp, int sqlcsrhld, int qryattscr, int qryattsns, int qryattset, long qryinsid, int actualResultSetType, int actualResultSetConcurrency, int actualResultSetHoldability) throws SqlException This method returns an instance of NetResultSet(or NetResultSet40) which extends from ClientResultSet which implementsjava.sql.ResultSet
.- Throws:
SqlException
-
newNetDatabaseMetaData
This method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implementsjava.sql.DatabaseMetaData
. -
newStatement
ClientStatement newStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) throws SqlException This method provides an instance of Statement or Statement40 depending on the jdk version under use- Parameters:
agent
- Agentconnection
- Connectiontype
- intconcurrency
- intholdability
- intautoGeneratedKeys
- intcolumnNames
- String[]columnIndexes
- int[]- Returns:
- a
java.sql.Statement
implementation - Throws:
SqlException
-
newColumnMetaData
Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use- Parameters:
logWriter
- LogWriter- Returns:
- a ColumnMetaData implementation
-
newColumnMetaData
Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use- Parameters:
logWriter
- LogWriterupperBound
- int- Returns:
- a ColumnMetaData implementation
-
newParameterMetaData
returns an instance of ParameterMetaData or ParameterMetaData40 depending on the jdk version under use- Parameters:
columnMetaData
- ColumnMetaData- Returns:
- a ParameterMetaData implementation
-
newBatchUpdateException
BatchUpdateException newBatchUpdateException(LogWriter logWriter, ClientMessageId msgid, Object[] args, long[] updateCounts, SqlException cause) Creates a BatchUpdateException depending on the JVM level.
-