public class BrokeredConnection extends java.lang.Object implements EngineConnection
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
connString |
(package private) BrokeredConnectionControl |
control |
private ExceptionFactory |
exceptionFactory
Exception factory for the underlying connection.
|
protected boolean |
isClosed |
private boolean |
stateAutoCommit |
(package private) int |
stateHoldability |
private int |
stateIsolationLevel
Maintain state as seen by this Connection handle, not the state
of the underlying Connection it is attached to.
|
private boolean |
stateReadOnly |
| Constructor and Description |
|---|
BrokeredConnection(BrokeredConnectionControl control) |
| Modifier and Type | Method and Description |
|---|---|
void |
addWarning(java.sql.SQLWarning w)
Add a SQLWarning to this Connection object.
|
void |
clearLOBMapping()
Clear the HashMap of all entries.
|
void |
clearWarnings() |
void |
close() |
void |
commit() |
java.sql.Statement |
createStatement() |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
boolean |
getAutoCommit() |
java.lang.String |
getCatalog() |
java.lang.String |
getCurrentSchemaName()
Obtain the name of the current schema.
|
ExceptionFactory |
getExceptionFactory()
Return the exception factory for the underlying connection.
|
int |
getHoldability()
Get the holdability for statements created by this connection
when holdability is not passed in.
|
void |
getIsolationUptoDate()
Isolation level state in BrokeredConnection can get out of sync
if the isolation is set using SQL rather than JDBC.
|
java.lang.Object |
getLOBMapping(int key)
Get the LOB reference corresponding to the locator.
|
java.sql.DatabaseMetaData |
getMetaData() |
int |
getPrepareIsolation()
get the isolation level that is currently being used to prepare
statements (used for network server)
|
(package private) EngineConnection |
getRealConnection()
A little indirection for getting the real connection.
|
java.lang.String |
getSchema()
Get the name of the current schema.
|
int |
getTransactionIsolation() |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap() |
java.sql.SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isInGlobalTransaction()
Is this a global transaction
|
boolean |
isReadOnly() |
java.lang.String |
nativeSQL(java.lang.String sql) |
BrokeredStatement |
newBrokeredStatement(BrokeredStatementControl statementControl) |
BrokeredCallableStatement |
newBrokeredStatement(BrokeredStatementControl statementControl,
java.lang.String sql) |
BrokeredPreparedStatement |
newBrokeredStatement(BrokeredStatementControl statementControl,
java.lang.String sql,
java.lang.Object generatedKeys) |
(package private) java.sql.SQLException |
noCurrentConnection()
Generate an exception reporting that there is no current connection.
|
(package private) void |
notifyException(java.sql.SQLException sqle) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Prepare statement with explicit holdability.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
void |
releaseSavepoint(java.sql.Savepoint savepoint) |
void |
resetFromPool()
Resets the connection before it is returned from a PooledConnection
to a new application request (wrapped by a BrokeredConnection).
|
void |
rollback() |
void |
rollback(java.sql.Savepoint savepoint) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(java.lang.String catalog) |
void |
setDrdaID(java.lang.String drdaID)
set the DrdaId for this connection.
|
void |
setHoldability(int holdability) |
void |
setPrepareIsolation(int level)
Set the internal isolation level to use for preparing statements.
|
void |
setReadOnly(boolean readOnly) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String name) |
void |
setSchema(java.lang.String schemaName)
Set the default schema for the Connection.
|
void |
setState(boolean complete)
Set the state of the underlying connection according to the
state of this connection's view of state.
|
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) |
(package private) int |
statementHoldabilityCheck(int resultSetHoldability)
Check the result set holdability when creating a statement
object.
|
void |
syncState()
Sync up the state of the underlying connection
with the state of this new handle.
|
java.lang.String |
toString()
Get the string representation for this connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitint stateHoldability
final BrokeredConnectionControl control
protected boolean isClosed
private java.lang.String connString
private final ExceptionFactory exceptionFactory
private int stateIsolationLevel
private boolean stateReadOnly
private boolean stateAutoCommit
public BrokeredConnection(BrokeredConnectionControl control) throws java.sql.SQLException
java.sql.SQLExceptionpublic final void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic final boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionjava.sql.SQLExceptionpublic final boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic final boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic final int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic final void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionfinal java.sql.SQLException noCurrentConnection()
final EngineConnection getRealConnection() throws java.sql.SQLException
java.sql.SQLExceptionfinal void notifyException(java.sql.SQLException sqle)
public void syncState()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void getIsolationUptoDate()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setState(boolean complete)
throws java.sql.SQLException
complete - If true set the complete state of the underlying
Connection, otherwise set only the Connection related state (ie.
the non-transaction specific state).java.sql.SQLExceptionpublic BrokeredStatement newBrokeredStatement(BrokeredStatementControl statementControl) throws java.sql.SQLException
java.sql.SQLExceptionpublic BrokeredPreparedStatement newBrokeredStatement(BrokeredStatementControl statementControl, java.lang.String sql, java.lang.Object generatedKeys) throws java.sql.SQLException
java.sql.SQLExceptionpublic BrokeredCallableStatement newBrokeredStatement(BrokeredStatementControl statementControl, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLExceptionpublic final void setDrdaID(java.lang.String drdaID)
setDrdaID in interface EngineConnectiondrdaID - drdaID to be used for this connectionpublic boolean isInGlobalTransaction()
EngineConnectionisInGlobalTransaction in interface EngineConnectionEngineConnection.isInGlobalTransaction()public final void setPrepareIsolation(int level)
throws java.sql.SQLException
setPrepareIsolation in interface EngineConnectionlevel - - internal isolation leveljava.sql.SQLException - See EmbedConnection#setPrepareIsolationpublic final int getPrepareIsolation()
throws java.sql.SQLException
getPrepareIsolation in interface EngineConnectionjava.sql.SQLExceptionpublic final void addWarning(java.sql.SQLWarning w)
throws java.sql.SQLException
addWarning in interface EngineConnectionw - Warning to be added, will be chained to any
existing warnings.java.sql.SQLExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic final java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic final int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.ConnectiongetHoldability in interface EngineConnectionjava.sql.SQLExceptionfinal int statementHoldabilityCheck(int resultSetHoldability)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void clearLOBMapping()
throws java.sql.SQLException
clearLOBMapping in interface EngineConnectionjava.sql.SQLExceptionpublic java.lang.Object getLOBMapping(int key)
throws java.sql.SQLException
getLOBMapping in interface EngineConnectionkey - the integer that represents the LOB locator value.java.sql.SQLExceptionpublic java.lang.String getCurrentSchemaName()
throws java.sql.SQLException
getCurrentSchemaName in interface EngineConnectionjava.sql.SQLExceptionpublic void resetFromPool()
throws java.sql.SQLException
EngineConnectionNote that resetting the transaction isolation level is not performed as part of this method. Temporary tables, IDENTITY_VAL_LOCAL and current schema are reset.
resetFromPool in interface EngineConnectionjava.sql.SQLExceptionEngineConnectionpublic final ExceptionFactory getExceptionFactory()
getExceptionFactory in interface EngineConnectionpublic java.lang.String getSchema()
throws java.sql.SQLException
getSchema in interface java.sql.ConnectiongetSchema in interface EngineConnectionjava.sql.SQLExceptionpublic void setSchema(java.lang.String schemaName)
throws java.sql.SQLException
setSchema in interface java.sql.ConnectionsetSchema in interface EngineConnectionjava.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.