Top Description Fields Constructors Methods
org.apache.derby.iapi.jdbc

public Class BrokeredConnection

extends Object
implements EngineConnection
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.EngineConnection, java.sql.Connection, java.lang.AutoCloseable, java.sql.Wrapper
Known Direct Subclasses
org.apache.derby.iapi.jdbc.BrokeredConnection42
Imports
java.sql.Array, .Blob, .CallableStatement, .Clob, .Connection, .DatabaseMetaData, .NClob, .PreparedStatement, .ResultSet, .SQLClientInfoException, .SQLException, .SQLWarning, .SQLXML, .Savepoint, .Statement, .Struct, java.util.Properties, java.util.concurrent.Executor, org.apache.derby.shared.common.error.SQLWarningFactory, .ExceptionFactory, org.apache.derby.shared.common.reference.SQLState

This is a rudimentary connection that delegates EVERYTHING to Connection.

Field Summary

Modifier and TypeField and Description
private String
pack-priv final BrokeredConnectionControl
protected boolean
private boolean
pack-priv int
private int
stateIsolationLevel

Maintain state as seen by this Connection handle, not the state of the underlying Connection it is attached to.

private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
abort(Executor
The Executor implementation which will be used by abort.
executor
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.abort.

Terminates an open connection.

public final void
addWarning(SQLWarning
Warning to be added, will be chained to any existing warnings.
w
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.addWarning.

Add a SQLWarning to this Connection object.

public final void
clearWarnings()

Implements java.sql.Connection.clearWarnings.

Clears all warnings reported for this Connection object.

public final void
close()

Implements java.sql.Connection.close.

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

public final void
commit()

Implements java.sql.Connection.commit.

Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.

public final Array
createArrayOf(String
the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned by Array.getBaseTypeName
typeName
,
Object[]
the elements that populate the returned object
elements
)

Implements java.sql.Connection.createArrayOf.

Factory method for creating Array objects.

public final Blob

Returns:

An object that implements the Blob interface
createBlob
()

Implements java.sql.Connection.createBlob.

Constructs an object that implements the Blob interface.

public final Clob

Returns:

An object that implements the Clob interface
createClob
()

Implements java.sql.Connection.createClob.

Constructs an object that implements the Clob interface.

public final NClob
createNClob()

Implements java.sql.Connection.createNClob.

Constructs an object that implements the NClob interface.

public final SQLXML
createSQLXML()

Implements java.sql.Connection.createSQLXML.

Constructs an object that implements the SQLXML interface.

public final Statement
createStatement()

Implements java.sql.Connection.createStatement.

Creates a Statement object for sending SQL statements to the database.

public final Statement
createStatement(int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.

public final Statement
createStatement(int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.

public final Struct
createStruct(String
the SQL type name of the SQL structured type that this Struct object maps to. The typeName is the name of a user-defined type that has been defined for this database. It is the value returned by Struct.getSQLTypeName.
typeName
,
Object[]
the attributes that populate the returned object
attributes
)

Implements java.sql.Connection.createStruct.

Factory method for creating Struct objects.

public final boolean
getAutoCommit()

Implements java.sql.Connection.getAutoCommit.

Retrieves the current auto-commit mode for this Connection object.

public final String
getCatalog()

Implements java.sql.Connection.getCatalog.

Retrieves this Connection object's current catalog name.

public final String

Returns:

a String that is returned from the real connection.
getClientInfo
(String
a String that is the property key to get.
name
)

Implements java.sql.Connection.getClientInfo.

getClientInfo forwards to the real connection.

public final Properties

Returns:

a Properties object from the real connection.
getClientInfo
()

Implements java.sql.Connection.getClientInfo.

getClientInfo forwards to the real connection.

public String

Returns:

the current schema name
getCurrentSchemaName
()

Implements org.apache.derby.iapi.jdbc.EngineConnection.getCurrentSchemaName.

Obtain the name of the current schema.

public final int
getHoldability()

Implements java.sql.Connection.getHoldability.

Get the holdability for statements created by this connection when holdability is not passed in.

public void
getIsolationUptoDate()

Isolation level state in BrokeredConnection can get out of sync if the isolation is set using SQL rather than JDBC.

public Object

Returns:

the LOB Object corresponding to this locator.
getLOBMapping
(int
the integer that represents the LOB locator value.
key
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.getLOBMapping.

Get the LOB reference corresponding to the locator.

public final DatabaseMetaData
getMetaData()

Implements java.sql.Connection.getMetaData.

Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection.

public int
getNetworkTimeout()

Implements org.apache.derby.iapi.jdbc.EngineConnection.getNetworkTimeout.

Retrieves the number of milliseconds the driver will wait for a database request to complete.

public final int

Returns:

current prepare isolation level
getPrepareIsolation
()

Implements org.apache.derby.iapi.jdbc.EngineConnection.getPrepareIsolation.

get the isolation level that is currently being used to prepare statements (used for network server)

pack-priv final EngineConnection

Returns:

the current connection
getRealConnection
()

A little indirection for getting the real connection.

public String
getSchema()

Implements org.apache.derby.iapi.jdbc.EngineConnection.getSchema.

Get the name of the current schema.

public final int
getTransactionIsolation()

Implements java.sql.Connection.getTransactionIsolation.

Retrieves this Connection object's current transaction isolation level.

public Map<String, Class<?>>
getTypeMap()

Implements java.sql.Connection.getTypeMap.

Retrieves the Map object associated with this Connection object.

public final SQLWarning
getWarnings()

Implements java.sql.Connection.getWarnings.

Retrieves the first warning reported by calls on this Connection object.

public final boolean
isClosed()

Implements java.sql.Connection.isClosed.

Retrieves whether this Connection object has been closed.

public boolean
public final boolean
isReadOnly()

Implements java.sql.Connection.isReadOnly.

Retrieves whether this Connection object is in read-only mode.

public final boolean

Returns:

true if the connection is valid, false otherwise
isValid
(int
The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.
timeout
)

Implements java.sql.Connection.isValid.

Checks if the connection has not been closed and is still valid.

public final boolean

Returns:

true if this implements the interface or directly or indirectly wraps an object that does.
isWrapperFor
(Class<?>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns false unless iface is implemented.

public final String
nativeSQL(String
an SQL statement that may contain one or more '?' parameter placeholders
sql
)

Implements java.sql.Connection.nativeSQL.

Converts the given SQL statement into the system's native SQL grammar.

public final BrokeredStatement
public BrokeredPreparedStatement
newBrokeredStatement(BrokeredStatementControl statementControl, String sql, Object generatedKeys)

public BrokeredCallableStatement
pack-priv final SQLException

Returns:

a no-current-connection exception
noCurrentConnection
()

Generate an exception reporting that there is no current connection.

pack-priv final void
public final CallableStatement
prepareCall(String
an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is specified using JDBC call escape syntax.
sql
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object for calling database stored procedures.

public final CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.

public final CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.

public final PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
)

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object for sending parameterized SQL statements to the database.

public final PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.

public final PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int
a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
autoGeneratedKeys
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.

public final PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int[]
an array of column indexes indicating the columns that should be returned from the inserted row or rows
columnIndexes
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.

public final PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
String[]
an array of column names indicating the columns that should be returned from the inserted row or rows
columnNames
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.

public final PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.prepareStatement.

Prepare statement with explicit holdability.

public final void
releaseSavepoint(Savepoint
the Savepoint object to be removed
savepoint
)

Implements java.sql.Connection.releaseSavepoint.

Removes the specified Savepoint and subsequent Savepoint objects from the current transaction.

public void
resetFromPool()

Implements org.apache.derby.iapi.jdbc.EngineConnection.resetFromPool.

Resets the connection before it is returned from a PooledConnection to a new application request (wrapped by a BrokeredConnection).

public final void
rollback()

Implements java.sql.Connection.rollback.

Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.

public final void
rollback(Savepoint
the Savepoint object to roll back to
savepoint
)

Implements java.sql.Connection.rollback.

Undoes all changes made after the given Savepoint object was set.

public final void
setAutoCommit(boolean
true to enable auto-commit mode; false to disable it
autoCommit
)

Implements java.sql.Connection.setAutoCommit.

Sets this connection's auto-commit mode to the given state.

public final void
setCatalog(String
the name of a catalog (subspace in this Connection object's database) in which to work
catalog
)

Implements java.sql.Connection.setCatalog.

Sets the given catalog name in order to select a subspace of this Connection object's database in which to work.

public final void
setClientInfo(String
the property key String
name
,
String
the property value String
value
)

Implements java.sql.Connection.setClientInfo.

setClientInfo forwards to the real connection.

public final void
setClientInfo(Properties
a Properties object with the properties to set.
properties
)

Implements java.sql.Connection.setClientInfo.

setClientInfo forwards to the real connection.

public final void
setDrdaID(String
drdaID to be used for this connection
drdaID
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.setDrdaID.

set the DrdaId for this connection.

public final void
setHoldability(int
a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
holdability
)

Implements java.sql.Connection.setHoldability.

Changes the default holdability of ResultSet objects created using this Connection object to the given holdability.

public void
setNetworkTimeout(Executor
The Executor implementation which will be used by setNetworkTimeout.
executor
,
int
The time in milliseconds to wait for the database operation to complete. If the JDBC driver does not support milliseconds, the JDBC driver will round the value up to the nearest second. If the timeout period expires before the operation completes, a SQLException will be thrown. A value of 0 indicates that there is not timeout for database operations.
milliseconds
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.setNetworkTimeout.

Sets the maximum period a Connection or objects created from the Connection will wait for the database to reply to any one request.

public final void
setPrepareIsolation(int
- internal isolation level
level
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.setPrepareIsolation.

Set the internal isolation level to use for preparing statements.

public final void
setReadOnly(boolean
true enables read-only mode; false disables it
readOnly
)

Implements java.sql.Connection.setReadOnly.

Puts this connection in read-only mode as a hint to the driver to enable database optimizations.

public final Savepoint
setSavepoint()

Implements java.sql.Connection.setSavepoint.

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.

public final Savepoint
setSavepoint(String
a String containing the name of the savepoint
name
)

Implements java.sql.Connection.setSavepoint.

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.

public void
setSchema(String
The new default schema
schemaName
)

Implements org.apache.derby.iapi.jdbc.EngineConnection.setSchema.

Set the default schema for the Connection.

public void
setState(boolean
If true set the complete state of the underlying Connection, otherwise set only the Connection related state (ie. the non-transaction specific state).
complete
)

Set the state of the underlying connection according to the state of this connection's view of state.

public final void
setTransactionIsolation(int
one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE. (Note that Connection.TRANSACTION_NONE cannot be used because it specifies that transactions are not supported.)
level
)

Implements java.sql.Connection.setTransactionIsolation.

Attempts to change the transaction isolation level for this Connection object to the one given.

public final void
setTypeMap(Map<String, Class<?>>
the java.util.Map object to install as the replacement for this Connection object's default type map
map
)

Implements java.sql.Connection.setTypeMap.

Installs the given TypeMap object as the type map for this Connection object.

pack-priv final int
statementHoldabilityCheck(int resultSetHoldability)

Check the result set holdability when creating a statement object.

public void
syncState()

Sync up the state of the underlying connection with the state of this new handle.

public String

Returns:

unique string representation for this connection
toString
()

Overrides java.lang.Object.toString.

Get the string representation for this connection.

public final <T> T

Returns:

an object that implements the interface
unwrap
(Class<T>
a Class defining an interface
iface
)

Implements java.sql.Wrapper.unwrap.

Returns this if this class implements the interface.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait