org.apache.derby.client.net
Class ClientJDBCObjectFactoryImpl

java.lang.Object
  extended by org.apache.derby.client.net.ClientJDBCObjectFactoryImpl
All Implemented Interfaces:
ClientJDBCObjectFactory

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 Eg. newCallableStatement would return org.apache.derby.client.am.CallableStatement


Constructor Summary
ClientJDBCObjectFactoryImpl()
           
 
Method Summary
 LogicalConnection newCachingLogicalConnection(Connection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache)
          Returns an instance of a CachingLogicalConnection, which provides caching of prepared statements.
 CallableStatement newCallableStatement(Agent agent, Connection connection, java.lang.String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc)
          Returns an instance of org.apache.derby.client.am.CallableStatement.
 ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, java.lang.String user, java.lang.String password)
          Returns an instance of org.apache.derby.client.ClientPooledConnection
 ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, java.lang.String user, java.lang.String password, int rmId)
          Returns an instance of org.apache.derby.client.ClientPooledConnection
 ClientXAConnection newClientXAConnection(ClientBaseDataSource ds, LogWriter logWriter, java.lang.String user, java.lang.String password)
          Returns an instance of org.apache.derby.client.ClientXAConnection
 ColumnMetaData newColumnMetaData(LogWriter logWriter)
          Returns an instanceof ColumnMetaData
 ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound)
          Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use
 LogicalCallableStatement newLogicalCallableStatement(java.sql.CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)
          Returns a new logical callable statement object.
 LogicalConnection newLogicalConnection(Connection physicalConnection, ClientPooledConnection pooledConnection)
          Returns an instance of org.apache.derby.client.am.LogicalConnection
 LogicalPreparedStatement newLogicalPreparedStatement(java.sql.PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)
          Returns a new logcial prepared statement object.
 Connection newNetConnection(LogWriter netLogWriter, ClientBaseDataSource clientDataSource, java.lang.String user, java.lang.String password)
          returns an instance of org.apache.derby.client.net.NetConnection
 Connection newNetConnection(LogWriter netLogWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties)
          returns an instance of org.apache.derby.client.net.NetConnection
 Connection newNetConnection(LogWriter netLogWriter, java.lang.String ipaddr, int portNumber, ClientBaseDataSource dataSource, boolean isXAConn)
          returns an instance of org.apache.derby.client.net.NetConnection
 Connection newNetConnection(LogWriter netLogWriter, java.lang.String databaseName, java.util.Properties properties)
          returns an instance of org.apache.derby.client.net.NetConnection
 Connection newNetConnection(LogWriter netLogWriter, java.lang.String user, java.lang.String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn)
          returns an instance of org.apache.derby.client.net.NetConnection
 Connection newNetConnection(LogWriter netLogWriter, java.lang.String user, java.lang.String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)
          Returns an instance of org.apache.derby.client.net.NetConnection.
 DatabaseMetaData newNetDatabaseMetaData(Agent netAgent, Connection netConnection)
          returns an instance of org.apache.derby.client.net.NetDatabaseMetaData
 ResultSet 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)
          returns an instance of org.apache.derby.client.net.NetResultSet
 ParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData)
          returns an instance of ParameterMetaData
 PreparedStatement newPreparedStatement(Agent agent, Connection 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 PreparedStatement which implements java.sql.PreparedStatement.
 PreparedStatement newPreparedStatement(Agent agent, Connection connection, java.lang.String sql, Section section, ClientPooledConnection cpc)
          This method returns an instance of PreparedStatement which implements java.sql.PreparedStatement.
 Statement newStatement(Agent agent, Connection connection)
          This method provides an instance of Statement
 Statement newStatement(Agent agent, Connection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)
          This method provides an instance of Statement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientJDBCObjectFactoryImpl

public ClientJDBCObjectFactoryImpl()
Method Detail

newClientPooledConnection

public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
                                                        LogWriter logWriter,
                                                        java.lang.String user,
                                                        java.lang.String password)
                                                 throws java.sql.SQLException
Returns an instance of org.apache.derby.client.ClientPooledConnection

Specified by:
newClientPooledConnection in interface ClientJDBCObjectFactory
Throws:
java.sql.SQLException

newClientPooledConnection

public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
                                                        LogWriter logWriter,
                                                        java.lang.String user,
                                                        java.lang.String password,
                                                        int rmId)
                                                 throws java.sql.SQLException
Returns an instance of org.apache.derby.client.ClientPooledConnection

Specified by:
newClientPooledConnection in interface ClientJDBCObjectFactory
Throws:
java.sql.SQLException

newClientXAConnection

public ClientXAConnection newClientXAConnection(ClientBaseDataSource ds,
                                                LogWriter logWriter,
                                                java.lang.String user,
                                                java.lang.String password)
                                         throws java.sql.SQLException
Returns an instance of org.apache.derby.client.ClientXAConnection

Specified by:
newClientXAConnection in interface ClientJDBCObjectFactory
Throws:
java.sql.SQLException

newCallableStatement

public CallableStatement newCallableStatement(Agent agent,
                                              Connection connection,
                                              java.lang.String sql,
                                              int type,
                                              int concurrency,
                                              int holdability,
                                              ClientPooledConnection cpc)
                                       throws SqlException
Returns an instance of org.apache.derby.client.am.CallableStatement.

Specified by:
newCallableStatement in interface ClientJDBCObjectFactory
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
cpc - 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

public LogicalConnection newLogicalConnection(Connection physicalConnection,
                                              ClientPooledConnection pooledConnection)
                                       throws SqlException
Returns an instance of org.apache.derby.client.am.LogicalConnection

Specified by:
newLogicalConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newCachingLogicalConnection

public LogicalConnection newCachingLogicalConnection(Connection physicalConnection,
                                                     ClientPooledConnection pooledConnection,
                                                     JDBCStatementCache stmtCache)
                                              throws SqlException
Returns an instance of a CachingLogicalConnection, which provides caching of prepared statements.

Specified by:
newCachingLogicalConnection in interface ClientJDBCObjectFactory
Parameters:
physicalConnection - the underlying physical connection
pooledConnection - the pooled connection
stmtCache - statement cache
Returns:
A logical connection with statement caching capabilities.
Throws:
SqlException - if creation of the logical connection fails

newPreparedStatement

public PreparedStatement newPreparedStatement(Agent agent,
                                              Connection connection,
                                              java.lang.String sql,
                                              Section section,
                                              ClientPooledConnection cpc)
                                       throws SqlException
This method returns an instance of PreparedStatement 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:
newPreparedStatement in interface ClientJDBCObjectFactory
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 - Section
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 PreparedStatement object
Throws:
SqlException

newPreparedStatement

public PreparedStatement newPreparedStatement(Agent agent,
                                              Connection 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 PreparedStatement 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:
newPreparedStatement in interface ClientJDBCObjectFactory
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.
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 logcial prepared statement object.

Specified by:
newLogicalPreparedStatement in interface ClientJDBCObjectFactory
Parameters:
ps - underlying physical prepared statement
stmtKey - key for the underlying physical prepared statement
cacheInteractor - 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:
newLogicalCallableStatement in interface ClientJDBCObjectFactory
Parameters:
cs - underlying physical callable statement
stmtKey - key for the underlying physical callable statement
cacheInteractor - the statement cache interactor
Returns:
A logical callable statement.

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   java.lang.String databaseName,
                                   java.util.Properties properties)
                            throws SqlException
returns an instance of org.apache.derby.client.net.NetConnection

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   ClientBaseDataSource clientDataSource,
                                   java.lang.String user,
                                   java.lang.String password)
                            throws SqlException
returns an instance of org.apache.derby.client.net.NetConnection

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   int driverManagerLoginTimeout,
                                   java.lang.String serverName,
                                   int portNumber,
                                   java.lang.String databaseName,
                                   java.util.Properties properties)
                            throws SqlException
returns an instance of org.apache.derby.client.net.NetConnection

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   java.lang.String user,
                                   java.lang.String password,
                                   ClientBaseDataSource dataSource,
                                   int rmId,
                                   boolean isXAConn)
                            throws SqlException
returns an instance of org.apache.derby.client.net.NetConnection

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   java.lang.String ipaddr,
                                   int portNumber,
                                   ClientBaseDataSource dataSource,
                                   boolean isXAConn)
                            throws SqlException
returns an instance of org.apache.derby.client.net.NetConnection

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetConnection

public Connection newNetConnection(LogWriter netLogWriter,
                                   java.lang.String user,
                                   java.lang.String password,
                                   ClientBaseDataSource dataSource,
                                   int rmId,
                                   boolean isXAConn,
                                   ClientPooledConnection cpc)
                            throws SqlException
Returns an instance of org.apache.derby.client.net.NetConnection.

Specified by:
newNetConnection in interface ClientJDBCObjectFactory
Parameters:
netLogWriter - Placeholder for NetLogWriter 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 Connections
isXAConn - true if this is a XA connection
cpc - The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object.
Returns:
a org.apache.derby.client.am.Connection object
Throws:
SqlException

newNetResultSet

public ResultSet 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
returns an instance of org.apache.derby.client.net.NetResultSet

Specified by:
newNetResultSet in interface ClientJDBCObjectFactory
Throws:
SqlException

newNetDatabaseMetaData

public DatabaseMetaData newNetDatabaseMetaData(Agent netAgent,
                                               Connection netConnection)
returns an instance of org.apache.derby.client.net.NetDatabaseMetaData

Specified by:
newNetDatabaseMetaData in interface ClientJDBCObjectFactory

newStatement

public Statement newStatement(Agent agent,
                              Connection connection)
                       throws SqlException
This method provides an instance of Statement

Specified by:
newStatement in interface ClientJDBCObjectFactory
Parameters:
agent - Agent
connection - Connection
Returns:
a java.sql.Statement implementation
Throws:
SqlException

newStatement

public Statement newStatement(Agent agent,
                              Connection 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:
newStatement in interface ClientJDBCObjectFactory
Parameters:
agent - Agent
connection - Connection
type - int
concurrency - int
holdability - int
autoGeneratedKeys - int
columnNames - String[]
columnIndexes - int[]
Returns:
a java.sql.Statement implementation
Throws:
SqlException

newColumnMetaData

public ColumnMetaData newColumnMetaData(LogWriter logWriter)
Returns an instanceof ColumnMetaData

Specified by:
newColumnMetaData in interface ClientJDBCObjectFactory
Parameters:
logWriter - LogWriter
Returns:
a ColumnMetaData implementation

newColumnMetaData

public ColumnMetaData newColumnMetaData(LogWriter logWriter,
                                        int upperBound)
Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use

Specified by:
newColumnMetaData in interface ClientJDBCObjectFactory
Parameters:
logWriter - LogWriter
upperBound - int
Returns:
a ColumnMetaData implementation

newParameterMetaData

public ParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData)
returns an instance of ParameterMetaData

Specified by:
newParameterMetaData in interface ClientJDBCObjectFactory
Parameters:
columnMetaData - ColumnMetaData
Returns:
a ParameterMetaData implementation

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.