Top Description Methods
org.apache.derby.client.am

public Interface ClientJDBCObjectFactory

Known Direct Implementers
org.apache.derby.client.net.ClientJDBCObjectFactoryImpl
Imports
java.sql.BatchUpdateException, .CallableStatement, .PreparedStatement, .SQLException, org.apache.derby.client.ClientPooledConnection, .ClientXAConnection, .BasicClientDataSource, java.util.Properties, org.apache.derby.client.am.stmtcache.JDBCStatementCache, .StatementKey

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 TypeMethod and Description
public BatchUpdateException

Returns:

a batch exception
newBatchUpdateException
(LogWriter
Machinery for writing log messages
logWriter
,
ClientMessageId
Client message handle
msgid
,
Object[]
Arguments to be plugged into the message
args
,
long[]
Update counts to include in message
updateCounts
,
SqlException
Original exception
cause
)

Creates a BatchUpdateException depending on the JVM level.

public LogicalConnection

Returns:

A logical connection with statement caching capabilities.
newCachingLogicalConnection
(ClientConnection
the underlying physical connection
physicalConnection
,
ClientPooledConnection
the pooled connection
pooledConnection
,
JDBCStatementCache
statement cache
stmtCache
)

Returns an instance of a CachingLogicalConnection, which provides caching of prepared statements.

public ClientCallableStatement

Returns:

a CallableStatement object
newCallableStatement
(Agent
The instance of NetAgent associated with this CallableStatement object.
agent
,
ClientConnection
The connection object associated with this PreparedStatement Object.
connection
,
String
A String object that is the SQL statement to be sent to the database.
sql
,
int
One of the ResultSet type constants
type
,
int
One of the ResultSet concurrency constants
concurrency
,
int
One of the ResultSet holdability constants
holdability
,
ClientPooledConnection
The PooledConnection object that will be used to notify the PooledConnection reference of the Error Occurred and the Close events.
cpc
)

Returns an instance of ClientCallableStatement, ClientCallableStatement40 or ClientCallableStatement42 which all implement java.sql.CallableStatement.

public ClientPooledConnection

Returns:

a pooled connection
newClientPooledConnection
(BasicClientDataSource
The data source
ds
,
LogWriter
The machinery for writing diagnostic messages
logWriter
,
String
The user name
user
,
String
The corresponding password
password
)

This method is used to return an instance of the org.apache.derby.client.ClientPooledConnection class which implements javax.sql.PooledConnection.

public ClientXAConnection

Returns:

an XA connection
newClientXAConnection
(BasicClientDataSource
The data source
ds
,
LogWriter
The machinery for writing diagnostic messages
logWriter
,
String
The user name
user
,
String
The corresponding password
password
)

This method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implements javax.sql.XAConnection.

public ColumnMetaData

Returns:

a ColumnMetaData implementation
newColumnMetaData
(LogWriter
LogWriter
logWriter
)

Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use

public ColumnMetaData

Returns:

a ColumnMetaData implementation
newColumnMetaData
(LogWriter
LogWriter
logWriter
,
int
int
upperBound
)

Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use

public LogicalCallableStatement

Returns:

A logical callable statement.
newLogicalCallableStatement
(CallableStatement
underlying physical callable statement
cs
,
StatementKey
key for the underlying physical callable statement
stmtKey
,
StatementCacheInteractor
the statement cache interactor
cacheInteractor
)

Returns a new logical callable statement object.

public LogicalConnection

Returns:

a logical connection
newLogicalConnection
(ClientConnection
The physical connection
physicalConnection
,
ClientPooledConnection
The pooled connection
pooledConnection
)

Returns an instance of LogicalConnection.

public LogicalPreparedStatement

Returns:

A logical prepared statement.
newLogicalPreparedStatement
(PreparedStatement
underlying physical prepared statement
ps
,
StatementKey
key for the underlying physical prepared statement
stmtKey
,
StatementCacheInteractor
the statement cache interactor
cacheInteractor
)

Returns a new logical prepared statement object.

public ClientConnection

Returns:

a client connection
newNetConnection
(LogWriter
Machinery for logging diagnostics
logWriter
,
int
Connection timeout
driverManagerLoginTimeout
,
String
Name of server
serverName
,
int
Server port
portNumber
,
String
Name of database
databaseName
,
Properties
Connection properties
properties
)

This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection this implements the java.sql.Connection interface

public ClientConnection

Returns:

a client connection
newNetConnection
(LogWriter
Machinery for logging diagnostics
logWriter
,
String
User name
user
,
String
Corresponding password
password
,
BasicClientDataSource
Data source to connect to
dataSource
,
int
id
rmId
,
boolean
True if an XA connection is needed
isXAConn
)

This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection.

public ClientConnection

Returns:

a client connection
newNetConnection
(LogWriter
LogWriter object associated with this connection
logWriter
,
String
user id for this connection
user
,
String
password for this connection
password
,
BasicClientDataSource
The DataSource object passed from the PooledConnection object from which this constructor was called
dataSource
,
int
The Resource Manager ID for XA Connections
rmId
,
boolean
true if this is a XA connection
isXAConn
,
ClientPooledConnection
The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object
cpc
)

This method returns an instance of NetConnection (or NetConnection40) class which extends Connection.

public ClientDatabaseMetaData

Returns:

database meta data
newNetDatabaseMetaData
(Agent
Wrapped agent
netAgent
,
ClientConnection
Wrapped connection
netConnection
)

This method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implements java.sql.DatabaseMetaData.

public ClientResultSet

Returns:

a result set
newNetResultSet
(Agent
The wrapped agent
netAgent
,
MaterialStatement
The wrapped statement
netStatement
,
Cursor
The wrapped cursor
cursor
,
int
DRDA variable
qryprctyp
,
int
DRDA variable
sqlcsrhld
,
int
DRDA variable
qryattscr
,
int
DRDA variable
qryattsns
,
int
DRDA variable
qryattset
,
long
DRDA variable
qryinsid
,
int
Type of result set
actualResultSetType
,
int
Concurrency level
actualResultSetConcurrency
,
int
Whether results are holdable
actualResultSetHoldability
)

This method returns an instance of NetResultSet(or NetResultSet40) which extends from ClientResultSet which implements java.sql.ResultSet.

public ClientParameterMetaData

Returns:

a ParameterMetaData implementation
newParameterMetaData
(ColumnMetaData
ColumnMetaData
columnMetaData
)

returns an instance of ParameterMetaData or ParameterMetaData40 depending on the jdk version under use

public ClientPreparedStatement

Returns:

a PreparedStatement object
newPreparedStatement
(Agent
The instance of NetAgent associated with this CallableStatement object.
agent
,
ClientConnection
The connection object associated with this PreparedStatement Object.
connection
,
String
A String object that is the SQL statement to be sent to the database.
sql
,
Section
Section
section
,
ClientPooledConnection
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.
cpc
)

This method returns an instance of PreparedStatement (or PreparedStatement40) which implements java.sql.PreparedStatement.

public ClientPreparedStatement

Returns:

a PreparedSatement object
newPreparedStatement
(Agent
The instance of NetAgent associated with this CallableStatement object.
agent
,
ClientConnection
The connection object associated with this PreparedStatement Object.
connection
,
String
A String object that is the SQL statement to be sent to the database.
sql
,
int
One of the ResultSet type constants.
type
,
int
One of the ResultSet concurrency constants.
concurrency
,
int
One of the ResultSet holdability constants.
holdability
,
int
a flag indicating whether auto-generated keys should be returned.
autoGeneratedKeys
,
String[]
an array of column names indicating the columns that should be returned from the inserted row or rows.
columnNames
,
int[]
an array of column indexes indicating the columns that should be returned form the inserted row.
columnIndexes
,
ClientPooledConnection
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.
cpc
)

Returns an instance of PreparedStatement (or PreparedStatement40) which implements java.sql.PreparedStatement.

public ClientStatement

Returns:

a java.sql.Statement implementation
newStatement
(Agent
Agent
agent
,
ClientConnection
Connection
connection
,
int
int
type
,
int
int
concurrency
,
int
int
holdability
,
int
int
autoGeneratedKeys
,
String[]
String[]
columnNames
,
int[]
int[]
columnIndexes
)

This method provides an instance of Statement or Statement40 depending on the jdk version under use

Method Detail

newBatchUpdateExceptionback to summary
public BatchUpdateException newBatchUpdateException(LogWriter logWriter, ClientMessageId msgid, Object[] args, long[] updateCounts, SqlException cause)

Creates a BatchUpdateException depending on the JVM level.

Parameters
logWriter:LogWriter

Machinery for writing log messages

msgid:ClientMessageId

Client message handle

args:Object[]

Arguments to be plugged into the message

updateCounts:long[]

Update counts to include in message

cause:SqlException

Original exception

Returns:BatchUpdateException

a batch exception

newCachingLogicalConnectionback to summary
public LogicalConnection newCachingLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache) throws SqlException

Returns an instance of a CachingLogicalConnection, which provides caching of prepared statements.

Parameters
physicalConnection:ClientConnection

the underlying physical connection

pooledConnection:ClientPooledConnection

the pooled connection

stmtCache:JDBCStatementCache

statement cache

Returns:LogicalConnection

A logical connection with statement caching capabilities.

Exceptions
SqlException:
if creation of the logical connection fails
newCallableStatementback to summary
public 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:Agent

The instance of NetAgent associated with this CallableStatement object.

connection:ClientConnection

The connection object associated with this PreparedStatement Object.

sql:String

A String object that is the SQL statement to be sent to the database.

type:int

One of the ResultSet type constants

concurrency:int

One of the ResultSet concurrency constants

holdability:int

One of the ResultSet holdability constants

cpc:ClientPooledConnection

The PooledConnection object that will be used to notify the PooledConnection reference of the Error Occurred and the Close events.

Returns:ClientCallableStatement

a CallableStatement object

Exceptions
SqlException:
on error
newClientPooledConnectionback to summary
public ClientPooledConnection newClientPooledConnection(BasicClientDataSource ds, LogWriter logWriter, String user, String password) throws SQLException

This method is used to return an instance of the org.apache.derby.client.ClientPooledConnection class which implements javax.sql.PooledConnection.

Parameters
ds:BasicClientDataSource

The data source

logWriter:LogWriter

The machinery for writing diagnostic messages

user:String

The user name

password:String

The corresponding password

Returns:ClientPooledConnection

a pooled connection

Exceptions
SQLException:
on error
newClientXAConnectionback to summary
public ClientXAConnection newClientXAConnection(BasicClientDataSource ds, LogWriter logWriter, String user, String password) throws SQLException

This method is used to return an instance of ClientXAConnection (or ClientXAConnection40) class which implements javax.sql.XAConnection.

Parameters
ds:BasicClientDataSource

The data source

logWriter:LogWriter

The machinery for writing diagnostic messages

user:String

The user name

password:String

The corresponding password

Returns:ClientXAConnection

an XA connection

Exceptions
SQLException:
on error
newColumnMetaDataback to summary
public ColumnMetaData newColumnMetaData(LogWriter logWriter)

Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use

Parameters
logWriter:LogWriter

LogWriter

Returns:ColumnMetaData

a ColumnMetaData implementation

newColumnMetaDataback to summary
public ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound)

Returns an instanceof ColumnMetaData or ColumnMetaData40 depending on the jdk version under use

Parameters
logWriter:LogWriter

LogWriter

upperBound:int

int

Returns:ColumnMetaData

a ColumnMetaData implementation

newLogicalCallableStatementback to summary
public LogicalCallableStatement newLogicalCallableStatement(CallableStatement cs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)

Returns a new logical callable statement object.

Parameters
cs:CallableStatement

underlying physical callable statement

stmtKey:StatementKey

key for the underlying physical callable statement

cacheInteractor:StatementCacheInteractor

the statement cache interactor

Returns:LogicalCallableStatement

A logical callable statement.

newLogicalConnectionback to summary
public LogicalConnection newLogicalConnection(ClientConnection physicalConnection, ClientPooledConnection pooledConnection) throws SqlException

Returns an instance of LogicalConnection. This method returns an instance of LogicalConnection (or LogicalConnection40) which implements java.sql.Connection.

Parameters
physicalConnection:ClientConnection

The physical connection

pooledConnection:ClientPooledConnection

The pooled connection

Returns:LogicalConnection

a logical connection

Exceptions
SqlException:
on error
newLogicalPreparedStatementback to summary
public LogicalPreparedStatement newLogicalPreparedStatement(PreparedStatement ps, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)

Returns a new logical prepared statement object.

Parameters
ps:PreparedStatement

underlying physical prepared statement

stmtKey:StatementKey

key for the underlying physical prepared statement

cacheInteractor:StatementCacheInteractor

the statement cache interactor

Returns:LogicalPreparedStatement

A logical prepared statement.

newNetConnectionback to summary
public 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

Parameters
logWriter:LogWriter

Machinery for logging diagnostics

driverManagerLoginTimeout:int

Connection timeout

serverName:String

Name of server

portNumber:int

Server port

databaseName:String

Name of database

properties:Properties

Connection properties

Returns:ClientConnection

a client connection

Exceptions
SqlException:
on error
newNetConnectionback to summary
public ClientConnection newNetConnection(LogWriter logWriter, String user, String password, BasicClientDataSource dataSource, int rmId, boolean isXAConn) throws SqlException

This method returns an instance of NetConnection (or NetConnection40) class which extends from ClientConnection. This implements the java.sql.Connection interface.

Parameters
logWriter:LogWriter

Machinery for logging diagnostics

user:String

User name

password:String

Corresponding password

dataSource:BasicClientDataSource

Data source to connect to

rmId:int

id

isXAConn:boolean

True if an XA connection is needed

Returns:ClientConnection

a client connection

Exceptions
SqlException:
on error
newNetConnectionback to summary
public ClientConnection newNetConnection(LogWriter logWriter, String user, String password, BasicClientDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException

This method returns an instance of NetConnection (or NetConnection40) class which extends Connection. This implements the java.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

LogWriter object associated with this connection

user:String

user id for this connection

password:String

password for this connection

dataSource:BasicClientDataSource

The DataSource object passed from the PooledConnection object from which this constructor was called

rmId:int

The Resource Manager ID for XA Connections

isXAConn:boolean

true if this is a XA connection

cpc:ClientPooledConnection

The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object

Returns:ClientConnection

a client connection

Exceptions
SqlException:
on error
newNetDatabaseMetaDataback to summary
public ClientDatabaseMetaData newNetDatabaseMetaData(Agent netAgent, ClientConnection netConnection)

This method provides an instance of NetDatabaseMetaData (or NetDatabaseMetaData40) which extends from ClientDatabaseMetaData which implements java.sql.DatabaseMetaData.

Parameters
netAgent:Agent

Wrapped agent

netConnection:ClientConnection

Wrapped connection

Returns:ClientDatabaseMetaData

database meta data

newNetResultSetback to summary
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

This method returns an instance of NetResultSet(or NetResultSet40) which extends from ClientResultSet which implements java.sql.ResultSet.

Parameters
netAgent:Agent

The wrapped agent

netStatement:MaterialStatement

The wrapped statement

cursor:Cursor

The wrapped cursor

qryprctyp:int

DRDA variable

sqlcsrhld:int

DRDA variable

qryattscr:int

DRDA variable

qryattsns:int

DRDA variable

qryattset:int

DRDA variable

qryinsid:long

DRDA variable

actualResultSetType:int

Type of result set

actualResultSetConcurrency:int

Concurrency level

actualResultSetHoldability:int

Whether results are holdable

Returns:ClientResultSet

a result set

Exceptions
SqlException:
on error
newParameterMetaDataback to summary
public ClientParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData)

returns an instance of ParameterMetaData or ParameterMetaData40 depending on the jdk version under use

Parameters
columnMetaData:ColumnMetaData

ColumnMetaData

Returns:ClientParameterMetaData

a ParameterMetaData implementation

newPreparedStatementback to summary
public ClientPreparedStatement newPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section, ClientPooledConnection cpc) throws SqlException

This method returns an instance of PreparedStatement (or PreparedStatement40) 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

Parameters
agent:Agent

The instance of NetAgent associated with this CallableStatement object.

connection:ClientConnection

The connection object associated with this PreparedStatement Object.

sql:String

A String object that is the SQL statement to be sent to the database.

section:Section

Section

cpc:ClientPooledConnection

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:ClientPreparedStatement

a PreparedStatement object

Exceptions
SqlException:
on error
newPreparedStatementback to summary
public 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 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

Parameters
agent:Agent

The instance of NetAgent associated with this CallableStatement object.

connection:ClientConnection

The connection object associated with this PreparedStatement Object.

sql:String

A String object that is the SQL statement to be sent to the database.

type:int

One of the ResultSet type constants.

concurrency:int

One of the ResultSet concurrency constants.

holdability:int

One of the ResultSet holdability constants.

autoGeneratedKeys:int

a flag indicating whether auto-generated keys should be returned.

columnNames:String[]

an array of column names indicating the columns that should be returned from the inserted row or rows.

columnIndexes:int[]

an array of column indexes indicating the columns that should be returned form the inserted row.

cpc:ClientPooledConnection

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:ClientPreparedStatement

a PreparedSatement object

Exceptions
SqlException:
on error
newStatementback to summary
public 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:Agent

Agent

connection:ClientConnection

Connection

type:int

int

concurrency:int

int

holdability:int

int

autoGeneratedKeys:int

int

columnNames:String[]

String[]

columnIndexes:int[]

int[]

Returns:ClientStatement

a java.sql.Statement implementation

Exceptions
SqlException:
on error