com.pivotal.gemfirexd.internal.client.net

## Class ClientJDBCObjectFactoryImpl40

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.net.ClientJDBCObjectFactoryImpl40

All Implemented Interfaces:
  ClientJDBCObjectFactory

    public class ClientJDBCObjectFactoryImpl40
    extends Object
    implements ClientJDBCObjectFactory

Implements the ClientJDBCObjectFactory interface and returns the JDBC4.0 specific classes

### Constructor Summary

Constructors
Constructor and Description
`ClientJDBCObjectFactoryImpl40()` Sets SQLExceptionFactpry40 om SqlException to make sure jdbc40 exception and sub classes are thrown when running with jdbc4.0 support

### Method Summary

Methods
`ResultSet` `getSingleHopResultSet(NetResultSet nrs0, PreparedStatement[] psarray, NetConnection.DSConnectionInfo dsConnInfo)`
`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, String sql, int type, int concurrency, int holdability, ClientPooledConnection cpc)` Returns an instance of com.pivotal.gemfirexd.internal.client.am.CallableStatement.
`ClientPooledConnection` `newClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, String user, String password)` Returns an instance of com.pivotal.gemfirexd.internal.client.ClientPooledConnection40
`ClientPooledConnection` `newClientPooledConnection(ClientBaseDataSource ds, LogWriter logWriter, String user, String password, int rmId)` Returns an instance of com.pivotal.gemfirexd.internal.client.ClientPooledConnection40
`ClientXAConnection` `newClientXAConnection(ClientBaseDataSource ds, LogWriter logWriter, String user, String password)` Returns an instance of com.pivotal.gemfirexd.internal.client.ClientXAConnection40
`ColumnMetaData` `newColumnMetaData(Agent agent)` Returns an instanceof ColumnMetaData
`ColumnMetaData` `newColumnMetaData(Agent agent, int upperBound)` Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use
`LogicalCallableStatement` `newLogicalCallableStatement(Agent agent, CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)` Returns a new logical callable statement object.
`LogicalConnection` `newLogicalConnection(Connection physicalConnection, ClientPooledConnection pooledConnection)` Returns an instance of LogicalConnection.
`LogicalPreparedStatement` `newLogicalPreparedStatement(Agent agent, PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)` Returns a new logcial prepared statement object.
`Connection` `newNetConnection(LogWriter netLogWriter, ClientBaseDataSource clientDataSource, String user, String password)` returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40
`Connection` `newNetConnection(LogWriter netLogWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties)` returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40
`Connection` `newNetConnection(LogWriter netLogWriter, String ipaddr, int portNumber, ClientBaseDataSource dataSource, boolean isXAConn)` returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40
`Connection` `newNetConnection(LogWriter netLogWriter, String databaseName, Properties properties)` returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40
`Connection` `newNetConnection(LogWriter netLogWriter, String user, String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn)` returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40
`Connection` `newNetConnection(LogWriter netLogWriter, String user, String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)` Returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection.
`DatabaseMetaData` `newNetDatabaseMetaData(Agent netAgent, Connection netConnection)` returns an instance of com.pivotal.gemfirexd.internal.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 com.pivotal.gemfirexd.internal.client.net.NetResultSet
`ParameterMetaData` `newParameterMetaData(ColumnMetaData columnMetaData)` returns an instance of ParameterMetaData40
`PreparedStatement` `newPreparedStatement(Agent agent, Connection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc)` This method returns an instance of PreparedStatement which implements java.sql.PreparedStatement.
`PreparedStatement` `newPreparedStatement(Agent agent, Connection connection, String sql, Section section, ClientPooledConnection cpc)` Returns an instance of com.pivotal.gemfirexd.internal.client.am.CallableStatement40
`Statement` `newStatement(Agent agent, Connection connection)` This method provides an instance of Statement40
`Statement` `newStatement(Agent agent, Connection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes)` This method provides an instance of Statement40

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClientJDBCObjectFactoryImpl40

    public ClientJDBCObjectFactoryImpl40()

Sets SQLExceptionFactpry40 om SqlException to make sure jdbc40 exception and sub classes are thrown when running with jdbc4.0 support

### Method Detail

#### newClientPooledConnection

    public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
                                                   LogWriter logWriter,
                                                   String user,
                                                   String password)
                                                     throws SQLException

Returns an instance of com.pivotal.gemfirexd.internal.client.ClientPooledConnection40

Specified by:
  `newClientPooledConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SQLException`

#### newClientPooledConnection

    public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
                                                   LogWriter logWriter,
                                                   String user,
                                                   String password,
                                                   int rmId)
                                                     throws SQLException

Returns an instance of com.pivotal.gemfirexd.internal.client.ClientPooledConnection40

Specified by:
  `newClientPooledConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SQLException`

#### newClientXAConnection

    public ClientXAConnection newClientXAConnection(ClientBaseDataSource ds,
                                           LogWriter logWriter,
                                           String user,
                                           String password)
                                             throws SQLException

Returns an instance of com.pivotal.gemfirexd.internal.client.ClientXAConnection40

Specified by:
  `newClientXAConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SQLException`

#### newCallableStatement

    public CallableStatement newCallableStatement(Agent agent,
                                         Connection connection,
                                         String sql,
                                         int type,
                                         int concurrency,
                                         int holdability,
                                         ClientPooledConnection cpc)
                                           throws SqlException

Returns an instance of com.pivotal.gemfirexd.internal.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 LogicalConnection. This method returns an instance of LogicalConnection (or LogicalConnection40) which implements java.sql.Connection.

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,
                                         String sql,
                                         Section section,
                                         ClientPooledConnection cpc)
                                           throws SqlException

Returns an instance of com.pivotal.gemfirexd.internal.client.am.CallableStatement40

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,
                                         String sql,
                                         int type,
                                         int concurrency,
                                         int holdability,
                                         int autoGeneratedKeys,
                                         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.
  `columnIndexes` - an array of column indexes indicating the columns that should be returned from 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 PreparedStatement object
Throws:
  `SqlException`

#### newLogicalPreparedStatement

    public LogicalPreparedStatement newLogicalPreparedStatement(Agent agent,
                                                       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(Agent agent,
                                                       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,
                              String databaseName,
                              Properties properties)
                                throws SqlException

returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40

Specified by:
  `newNetConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetConnection

    public Connection newNetConnection(LogWriter netLogWriter,
                              ClientBaseDataSource clientDataSource,
                              String user,
                              String password)
                                throws SqlException

returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40

Specified by:
  `newNetConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetConnection

    public Connection newNetConnection(LogWriter netLogWriter,
                              int driverManagerLoginTimeout,
                              String serverName,
                              int portNumber,
                              String databaseName,
                              Properties properties)
                                throws SqlException

returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40

Specified by:
  `newNetConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetConnection

    public Connection newNetConnection(LogWriter netLogWriter,
                              String user,
                              String password,
                              ClientBaseDataSource dataSource,
                              int rmId,
                              boolean isXAConn)
                                throws SqlException

returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40

Specified by:
  `newNetConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetConnection

    public Connection newNetConnection(LogWriter netLogWriter,
                              String ipaddr,
                              int portNumber,
                              ClientBaseDataSource dataSource,
                              boolean isXAConn)
                                throws SqlException

returns an instance of com.pivotal.gemfirexd.internal.client.net.NetConnection40

Specified by:
  `newNetConnection` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetConnection

    public Connection newNetConnection(LogWriter netLogWriter,
                              String user,
                              String password,
                              ClientBaseDataSource dataSource,
                              int rmId,
                              boolean isXAConn,
                              ClientPooledConnection cpc)
                                throws SqlException

Returns an instance of com.pivotal.gemfirexd.internal.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 com.pivotal.gemfirexd.internal.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 com.pivotal.gemfirexd.internal.client.net.NetResultSet

Specified by:
  `newNetResultSet` in interface `ClientJDBCObjectFactory`
Throws:
  `SqlException`

#### newNetDatabaseMetaData

    public DatabaseMetaData newNetDatabaseMetaData(Agent netAgent,
                                          Connection netConnection)

returns an instance of com.pivotal.gemfirexd.internal.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 Statement40

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,
                         String[] columnNames,
                         int[] columnIndexes)
                           throws SqlException

This method provides an instance of Statement40

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(Agent agent)

Returns an instanceof ColumnMetaData

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

#### newColumnMetaData

    public ColumnMetaData newColumnMetaData(Agent agent,
                                   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 ParameterMetaData40

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

#### getSingleHopResultSet

    public ResultSet getSingleHopResultSet(NetResultSet nrs0,
                                  PreparedStatement[] psarray,
                                  NetConnection.DSConnectionInfo dsConnInfo)

Specified by:
  `getSingleHopResultSet` in interface `ClientJDBCObjectFactory`