Package org.apache.derby.client.net
Class ClientJDBCObjectFactoryImpl
- java.lang.Object
-
- org.apache.derby.client.net.ClientJDBCObjectFactoryImpl
-
- All Implemented Interfaces:
ClientJDBCObjectFactory
- Direct Known Subclasses:
ClientJDBCObjectFactoryImpl42
public class ClientJDBCObjectFactoryImpl extends java.lang.Object implements ClientJDBCObjectFactory
Implements the the ClientJDBCObjectFactory interface and returns the classes that implement the JDBC3.0/2.0 interfaces For example, newCallableStatement would return ClientCallableStatement
-
-
Field Summary
Fields Modifier and Type Field Description private static MessageUtilmsgutil_The message utility instance we use to find messages It's primed with the name of the client message bundle so that it knows to look there if the message isn't found in the shared message bundle.
-
Constructor Summary
Constructors Constructor Description ClientJDBCObjectFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.sql.BatchUpdateExceptionnewBatchUpdateException(java.lang.String message, java.lang.String sqlState, int errorCode, long[] updateCounts, SqlException cause)This method is overridden on JVM 8java.sql.BatchUpdateExceptionnewBatchUpdateException(LogWriter logWriter, ClientMessageId msgid, java.lang.Object[] args, long[] updateCounts, SqlException cause)Creates a BatchUpdateException depending on the JVM level.LogicalConnectionnewCachingLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache)Returns an instance of aCachingLogicalConnection, which provides caching of prepared statements.ClientCallableStatementnewCallableStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc)Returns an instance of ClientCallableStatement.ClientPooledConnectionnewClientPooledConnection(BasicClientDataSource40 ds, LogWriter logWriter, java.lang.String user, java.lang.String password)This method is used to return an instance of theClientPooledConnectionclass which implementsjavax.sql.PooledConnection.ClientXAConnectionnewClientXAConnection(BasicClientDataSource40 ds, LogWriter logWriter, java.lang.String user, java.lang.String password)This method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implementsjavax.sql.XAConnection.ColumnMetaDatanewColumnMetaData(LogWriter logWriter)Returns an instance of ColumnMetaDataColumnMetaDatanewColumnMetaData(LogWriter logWriter, int upperBound)Returns an instance of ColumnMetaData or ColumnMetaData40 depending on the JDK version under useLogicalCallableStatementnewLogicalCallableStatement(java.sql.CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)Returns a new logical callable statement object.LogicalConnectionnewLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection)Returns an instance of LogicalConnection.LogicalPreparedStatementnewLogicalPreparedStatement(java.sql.PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)Returns a new logical prepared statement object.ClientConnectionnewNetConnection(LogWriter logWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties)This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection this implements the java.sql.Connection interfaceClientConnectionnewNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn)This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection.ClientConnectionnewNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)Returns an instance of NetConnection.ClientDatabaseMetaDatanewNetDatabaseMetaData(Agent netAgent, ClientConnection netConnection)This method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implementsjava.sql.DatabaseMetaData.ClientResultSetnewNetResultSet(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.ClientParameterMetaDatanewParameterMetaData(ColumnMetaData columnMetaData)returns an instance of ParameterMetaDataClientPreparedStatementnewPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc)This method returns an instance of ClientPreparedStatement which implementsjava.sql.PreparedStatement.ClientPreparedStatementnewPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, Section section, ClientPooledConnection cpc)This method returns an instance of ClientPreparedStatement which implements java.sql.PreparedStatement.ClientStatementnewStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)This method provides an instance of Statement
-
-
-
Field Detail
-
msgutil_
private static final MessageUtil msgutil_
The message utility instance we use to find messages It's primed with the name of the client message bundle so that it knows to look there if the message isn't found in the shared message bundle.
-
-
Method Detail
-
newClientPooledConnection
public ClientPooledConnection newClientPooledConnection(BasicClientDataSource40 ds, LogWriter logWriter, java.lang.String user, java.lang.String password) throws java.sql.SQLException
Description copied from interface:ClientJDBCObjectFactoryThis method is used to return an instance of theClientPooledConnectionclass which implementsjavax.sql.PooledConnection.- Specified by:
newClientPooledConnectionin interfaceClientJDBCObjectFactory- Returns:
- an instance of
ClientPooledConnection - Throws:
java.sql.SQLException
-
newClientXAConnection
public ClientXAConnection newClientXAConnection(BasicClientDataSource40 ds, LogWriter logWriter, java.lang.String user, java.lang.String password) throws java.sql.SQLException
Description copied from interface:ClientJDBCObjectFactoryThis method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implementsjavax.sql.XAConnection.- Specified by:
newClientXAConnectionin interfaceClientJDBCObjectFactory- Returns:
- an instance of
ClientXAConnection - Throws:
java.sql.SQLException
-
newCallableStatement
public ClientCallableStatement newCallableStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc) throws SqlException
Returns an instance of ClientCallableStatement.- Specified by:
newCallableStatementin interfaceClientJDBCObjectFactory- Parameters:
agent- The instance of NetAgent associated with thisClientCallableStatementobject.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
ClientCallableStatementobject - Throws:
SqlException
-
newLogicalConnection
public LogicalConnection newLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection) throws SqlException
Description copied from interface:ClientJDBCObjectFactoryReturns an instance of LogicalConnection. This method returns an instance of LogicalConnection (or LogicalConnection40) which implementsjava.sql.Connection.- Specified by:
newLogicalConnectionin interfaceClientJDBCObjectFactory- Returns:
- an instance of
LogicalConnection - Throws:
SqlException
-
newCachingLogicalConnection
public LogicalConnection newCachingLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache) throws SqlException
Returns an instance of aCachingLogicalConnection, which provides caching of prepared statements.- Specified by:
newCachingLogicalConnectionin interfaceClientJDBCObjectFactory- 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
public ClientPreparedStatement newPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, Section section, ClientPooledConnection cpc) throws SqlException
This method returns an instance of ClientPreparedStatement which implements java.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.- Specified by:
newPreparedStatementin interfaceClientJDBCObjectFactory- Parameters:
agent- The instance of NetAgent associated with thisClientCallableStatementobject.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
public ClientPreparedStatement newPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException
This method returns an instance of ClientPreparedStatement which implementsjava.sql.PreparedStatement. It has theClientPooledConnectionas one of its parameters this is used to raise the Statement Events when the prepared statement is closed.- Specified by:
newPreparedStatementin interfaceClientJDBCObjectFactory- Parameters:
agent- The instance of NetAgent associated with thisClientCallableStatementobject.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.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.columnIndexes- an array of column indexes indicating the columns that should be returned form the inserted row.- Returns:
- a PreparedStatement object
- Throws:
SqlException
-
newLogicalPreparedStatement
public LogicalPreparedStatement newLogicalPreparedStatement(java.sql.PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)
Returns a new logical prepared statement object.- Specified by:
newLogicalPreparedStatementin interfaceClientJDBCObjectFactory- Parameters:
ps- underlying physical prepared statementstmtKey- key for the underlying physical prepared statementcacheInteractor- the statement cache interactor- Returns:
- A logical prepared statement.
-
newLogicalCallableStatement
public LogicalCallableStatement newLogicalCallableStatement(java.sql.CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)
Returns a new logical callable statement object.- Specified by:
newLogicalCallableStatementin interfaceClientJDBCObjectFactory- Parameters:
cs- underlying physical callable statementstmtKey- key for the underlying physical callable statementcacheInteractor- the statement cache interactor- Returns:
- A logical callable statement.
-
newNetConnection
public ClientConnection newNetConnection(LogWriter logWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties) throws SqlException
Description copied from interface:ClientJDBCObjectFactoryThis method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection this implements the java.sql.Connection interface- Specified by:
newNetConnectionin interfaceClientJDBCObjectFactory- Returns:
- an instance of
NetConnection - Throws:
SqlException
-
newNetConnection
public ClientConnection newNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn) throws SqlException
Description copied from interface:ClientJDBCObjectFactoryThis method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection. This implements thejava.sql.Connectioninterface.- Specified by:
newNetConnectionin interfaceClientJDBCObjectFactory- Returns:
- an instance of
NetConnection - Throws:
SqlException
-
newNetConnection
public ClientConnection newNetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException
Returns an instance of NetConnection.- Specified by:
newNetConnectionin interfaceClientJDBCObjectFactory- Parameters:
logWriter- LogWriter object associated with this connection.user- user id for this connection.password- password for this connection.dataSource- The DataSource object passed from the PooledConnection object from which this constructor was called.rmId- 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.- Returns:
- a
ClientConnectionobject - Throws:
SqlException
-
newNetResultSet
public 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
Description copied from interface:ClientJDBCObjectFactoryThis method returns an instance of NetResultSet(or NetResultSet40) which extends from ClientResultSet which implementsjava.sql.ResultSet.- Specified by:
newNetResultSetin interfaceClientJDBCObjectFactory- Returns:
- an instance of
NetResultSet - Throws:
SqlException
-
newNetDatabaseMetaData
public ClientDatabaseMetaData newNetDatabaseMetaData(Agent netAgent, ClientConnection netConnection)
Description copied from interface:ClientJDBCObjectFactoryThis method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implementsjava.sql.DatabaseMetaData.- Specified by:
newNetDatabaseMetaDatain interfaceClientJDBCObjectFactory- Returns:
- an instance of
NetDatabaseMetaData
-
newStatement
public ClientStatement newStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
This method provides an instance of Statement- Specified by:
newStatementin interfaceClientJDBCObjectFactory- Parameters:
agent- Agentconnection- Connectiontype- intconcurrency- intholdability- intautoGeneratedKeys- intcolumnNames- String[]columnIndexes- int[]- Returns:
- a ClientStatement implementation
- Throws:
SqlException
-
newColumnMetaData
public ColumnMetaData newColumnMetaData(LogWriter logWriter)
Returns an instance of ColumnMetaData- Specified by:
newColumnMetaDatain interfaceClientJDBCObjectFactory- Parameters:
logWriter- LogWriter- Returns:
- a ColumnMetaData implementation
-
newColumnMetaData
public ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound)
Returns an instance of ColumnMetaData or ColumnMetaData40 depending on the JDK version under use- Specified by:
newColumnMetaDatain interfaceClientJDBCObjectFactory- Parameters:
logWriter- LogWriterupperBound- int- Returns:
- a ColumnMetaData implementation
-
newParameterMetaData
public ClientParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData)
returns an instance of ParameterMetaData- Specified by:
newParameterMetaDatain interfaceClientJDBCObjectFactory- Parameters:
columnMetaData- ColumnMetaData- Returns:
- a ParameterMetaData implementation
-
newBatchUpdateException
public java.sql.BatchUpdateException newBatchUpdateException(LogWriter logWriter, ClientMessageId msgid, java.lang.Object[] args, long[] updateCounts, SqlException cause)
Creates a BatchUpdateException depending on the JVM level.- Specified by:
newBatchUpdateExceptionin interfaceClientJDBCObjectFactory
-
newBatchUpdateException
protected java.sql.BatchUpdateException newBatchUpdateException(java.lang.String message, java.lang.String sqlState, int errorCode, long[] updateCounts, SqlException cause)This method is overridden on JVM 8
-
-