| java.lang.Object org.apache.derby.impl.jdbc.EmbedConnection
All known Subclasses: org.apache.derby.impl.jdbc.EmbedConnection30,
EmbedConnection | public class EmbedConnection implements EngineConnection(Code) | | Local implementation of Connection for a JDBC driver in
the same process as the database.
There is always a single root (parent) connection. The
initial JDBC connection is the root connection. A
call to getCurrentConnection() or with the URL
jdbc:default:connection yields a nested connection that shares
the same root connection as the parent. A nested connection
is implemented using this class. The nested connection copies the
state of the parent connection and shares some of the same
objects (e.g. ContextManager) that are shared across all
nesting levels. The proxy also maintains its own
state that is distinct from its parent connection (e.g.
autocommit or warnings).
SYNCHRONIZATION: Just about all JDBC actions are
synchronized across all connections stemming from the
same root connection. The synchronization is upon
the a synchronized object return by the rootConnection.
Supports
author: djd See Also: TransactionResourceImpl |
Method Summary | |
final public synchronized void | addWarning(SQLWarning newWarning) Add a warning to the current list of warnings, to follow
this note from Connection.getWarnings.
Note: Subsequent warnings will be chained to this SQLWarning. | final protected void | checkIfClosed() Raises an exception if the connection is closed. | final public synchronized void | clearWarnings() After this call, getWarnings returns null until a new warning is
reported for this Connection. | public void | close() In some cases, it is desirable to immediately release a
Connection's database and JDBC resources instead of waiting for
them to be automatically released; the close method provides this
immediate release. | public void | commit() Commit makes all changes made since the previous
commit/rollback permanent and releases any database locks
currently held by the Connection. | protected void | commitIfAutoCommit() If in autocommit, then commit.
Used to force a commit after a result set closes in autocommit mode.
The needCommit mechanism does not work correctly as there are times
with cursors (like a commit, followed by a next, followed by a close)
where the system does not think it needs a commit but we need to
force the commit on close. | protected void | commitIfNeeded() if a commit is needed, perform it. | final public Statement | createStatement() SQL statements without parameters are normally
executed using Statement objects. | final public Statement | createStatement(int resultSetType, int resultSetConcurrency) JDBC 2.0
Same as createStatement() above, but allows the default result set
type and result set concurrency type to be overridden. | final public Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) JDBC 3.0
Same as createStatement() above, but allows the default result set
type, result set concurrency type and result set holdability type to
be overridden. | protected void | finalize() | final public java.sql.Connection | getApplicationConnection() | public boolean | getAutoCommit() Get the current auto-commit state. | public String | getCatalog() Return the Connection's current catalog name. | final protected Object | getConnectionSynchronization() | final public ContextManager | getContextManager() Return the context manager for this connection. | public String | getDBName() Return the dbname for this connection. | protected Database | getDatabase() | public int | getEngineType() Gets the EngineType of the connected database.
0 if there is no database, the engine type otherwise. | final public int | getHoldability() JDBC 3.0
Retrieves the current holdability of ResultSet objects created using this
Connection object. | final public LanguageConnectionContext | getLanguageConnection() | final public InternalDriver | getLocalDriver() | public DatabaseMetaData | getMetaData() A Connection's database is able to provide information
describing its tables, its supported SQL grammar, its stored
procedures, the capabilities of this connection, etc. | public int | getPrepareIsolation() | final int | getResultSetOrderId() Return a unique order number for a result set. | final protected TransactionResourceImpl | getTR() | final public int | getTransactionIsolation() Get this Connection's current transaction isolation mode. | public java.util.Map | getTypeMap() Get the type-map object associated with this connection. | final public synchronized SQLWarning | getWarnings() The first warning reported by calls on this Connection is
returned. | SQLException | handleException(Throwable thrownException) | final SQLException | handleException(Throwable thrownException, boolean rollbackOnAutoCommit) Handle any type of Exception.
- Inform the contexts of the error
- Throw an Util based upon the thrown exception.
REMIND: now that we know all the exceptions from our driver
are Utils, would it make sense to shut down the system
for unknown SQLExceptions? At present, we do not.
Because this is the last stop for exceptions,
it will catch anything that occurs in it and try
to cleanup before re-throwing them.
Parameters: thrownException - the exception Parameters: rollbackOnAutoCommit - rollback the xact on if autocommit ison, otherwise rollback stmt but leave xact open (andcontinue to hold on to locks). | final public boolean | isClosed() Tests to see if a Connection is closed. | final public boolean | isReadOnly() Tests to see if the connection is in read-only mode. | public String | nativeSQL(String sql) A driver may convert the JDBC sql grammar into its system's
native SQL grammar prior to sending it; nativeSQL returns the
native form of the statement that the driver would have sent. | protected void | needCommit() if auto commit is on, remember that we need to commit
the current statement. | protected SQLException | newSQLException(String messageId) | protected SQLException | newSQLException(String messageId, Object arg1) | protected SQLException | newSQLException(String messageId, Object arg1, Object arg2) | final public CallableStatement | prepareCall(String sql) A SQL stored procedure call statement is handled by creating a
CallableStatement for it. | final public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency) JDBC 2.0
Same as prepareCall() above, but allows the default result set
type and result set concurrency type to be overridden. | final public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) JDBC 3.0
Same as prepareCall() above, but allows the default result set
type, result set concurrency type and result set holdability
to be overridden. | PreparedStatement | prepareMetaDataStatement(String sql) | final public PreparedStatement | prepareStatement(String sql) A SQL statement with or without IN parameters can be
pre-compiled and stored in a PreparedStatement object. | final public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) JDBC 2.0
Same as prepareStatement() above, but allows the default result set
type and result set concurrency type to be overridden. | final public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) JDBC 3.0
Same as prepareStatement() above, but allows the default result set
type, result set concurrency type and result set holdability
to be overridden. | final public PreparedStatement | prepareStatement(String sql, int[] columnIndexes) Creates a default PreparedStatement object capable of returning
the auto-generated keys designated by the given array. | final public PreparedStatement | prepareStatement(String sql, String[] columnNames) Creates a default PreparedStatement object capable of returning
the auto-generated keys designated by the given array. | final public PreparedStatement | prepareStatement(String sql, int autoGeneratedKeys) Creates a default PreparedStatement object that has the capability to
retieve auto-generated keys. | public void | resetFromPool() Reset the connection before it is returned from a PooledConnection
to a new application request (wrapped by a BrokeredConnection). | final protected void | restoreContextStack() | public void | rollback() Rollback drops all changes made since the previous
commit/rollback and releases any database locks currently held
by the Connection. | final public void | setApplicationConnection(java.sql.Connection applicationConnection) | public void | setAutoCommit(boolean autoCommit) If a connection is in auto-commit mode, then all its SQL
statements will be executed and committed as individual
transactions. | public void | setCatalog(String catalog) A sub-space of this Connection's database may be selected by setting a
catalog name. | public void | setDrdaID(String drdaID) | final public void | setHoldability(int holdability) JDBC 3.0
Changes the holdability of ResultSet objects created using this
Connection object to the given holdability. | final public void | setInactive() Close the connection when processing errors, or when
closing a nested connection. | public void | setPrepareIsolation(int level) Set the transaction isolation level that will be used for the
next prepare. | final public void | setReadOnly(boolean readOnly) You can put a connection in read-only mode as a hint to enable
database optimizations.
Note: setReadOnly cannot be called while in the
middle of a transaction.
Parameters: readOnly - true enables read-only mode; false disablesread-only mode. | public void | setTransactionIsolation(int level) You can call this method to try to change the transaction
isolation level using one of the TRANSACTION_* values. | final public void | setTypeMap(java.util.Map map) Install a type-map object as the default type-map for
this connection. | final protected void | setupContextStack() Install the context manager for this thread. | public String | toString() Get a String representation that uniquely identifies
this connection. | final public boolean | transactionIsIdle() returns false if there is an underlying transaction and that transaction
has done work. | final public void | xa_commit(boolean onePhase) | final public int | xa_prepare() | final public void | xa_rollback() |
NO_MEM | final public static SQLException NO_MEM(Code) | | Static exception to be thrown when a Connection request can not
be fulfilled due to lack of memory. A static exception as the lack
of memory would most likely cause another OutOfMemoryException and
if there is not enough memory to create the OOME exception then something
like the VM dying could occur. Simpler just to throw a static.
|
autoCommit | boolean autoCommit(Code) | | |
memoryState | final public static LowMemory memoryState(Code) | | Low memory state object for connection requests.
|
needCommit | boolean needCommit(Code) | | |
EmbedConnection | public EmbedConnection(EmbedConnection inputConnection)(Code) | | Create a new connection based off of the
connection passed in. Initializes state
based on input connection, and copies
appropriate object pointers. This is only used
for nested connections.
Parameters: inputConnection - the input connection |
addWarning | final public synchronized void addWarning(SQLWarning newWarning)(Code) | | Add a warning to the current list of warnings, to follow
this note from Connection.getWarnings.
Note: Subsequent warnings will be chained to this SQLWarning.
See Also: java.sql.Connection.getWarnings |
checkIfClosed | final protected void checkIfClosed() throws SQLException(Code) | | Raises an exception if the connection is closed.
exception: SQLException - if the connection is closed |
clearWarnings | final public synchronized void clearWarnings() throws SQLException(Code) | | After this call, getWarnings returns null until a new warning is
reported for this Connection.
Synchronization node: Warnings are synchonized
on nesting level
|
close | public void close() throws SQLException(Code) | | In some cases, it is desirable to immediately release a
Connection's database and JDBC resources instead of waiting for
them to be automatically released; the close method provides this
immediate release.
Note: A Connection is automatically closed when it is
garbage collected. Certain fatal errors also result in a closed
Connection.
exception: SQLException - if a database-access error occurs. |
commit | public void commit() throws SQLException(Code) | | Commit makes all changes made since the previous
commit/rollback permanent and releases any database locks
currently held by the Connection. This method should only be
used when auto commit has been disabled.
exception: SQLException - if a database-access error occurs. See Also: EmbedConnection.setAutoCommit See Also: |
commitIfAutoCommit | protected void commitIfAutoCommit() throws SQLException(Code) | | If in autocommit, then commit.
Used to force a commit after a result set closes in autocommit mode.
The needCommit mechanism does not work correctly as there are times
with cursors (like a commit, followed by a next, followed by a close)
where the system does not think it needs a commit but we need to
force the commit on close. It seemed safer to just force a commit
on close rather than count on keeping the needCommit flag correct for
all cursor cases.
Must have connection synchonization and context set up already.
exception: SQLException - if commit returns error |
commitIfNeeded | protected void commitIfNeeded() throws SQLException(Code) | | if a commit is needed, perform it.
Must have connection synchonization and context set up already.
exception: SQLException - if commit returns error |
createStatement | final public Statement createStatement() throws SQLException(Code) | | SQL statements without parameters are normally
executed using Statement objects. If the same SQL statement
is executed many times, it is more efficient to use a
PreparedStatement
JDBC 2.0
Result sets created using the returned Statement will have
forward-only type, and read-only concurrency, by default.
a new Statement object exception: SQLException - if a database-access error occurs. |
createStatement | final public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0
Same as createStatement() above, but allows the default result set
type and result set concurrency type to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new Statement object exception: SQLException - if a database-access error occurs. |
createStatement | final public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | JDBC 3.0
Same as createStatement() above, but allows the default result set
type, result set concurrency type and result set holdability type to
be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX Parameters: resultSetHoldability - a holdability type,ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT a new Statement object exception: SQLException - if a database-access error occurs. |
getCatalog | public String getCatalog() throws SQLException(Code) | | Return the Connection's current catalog name.
the current catalog name or null exception: SQLException - if a database-access error occurs. |
getConnectionSynchronization | final protected Object getConnectionSynchronization()(Code) | | |
getContextManager | final public ContextManager getContextManager()(Code) | | Return the context manager for this connection.
|
getDBName | public String getDBName()(Code) | | Return the dbname for this connection.
String The dbname for this connection. |
getEngineType | public int getEngineType()(Code) | | Gets the EngineType of the connected database.
0 if there is no database, the engine type otherwise. @see org.apache.derby.iapi.reference.EngineType |
getHoldability | final public int getHoldability() throws SQLException(Code) | | JDBC 3.0
Retrieves the current holdability of ResultSet objects created using this
Connection object.
The holdability, one of ResultSet.HOLD_CURSORS_OVER_COMMITor ResultSet.CLOSE_CURSORS_AT_COMMIT |
getMetaData | public DatabaseMetaData getMetaData() throws SQLException(Code) | | A Connection's database is able to provide information
describing its tables, its supported SQL grammar, its stored
procedures, the capabilities of this connection, etc. This
information is made available through a DatabaseMetaData
object.
a DatabaseMetaData object for this Connection exception: SQLException - if a database-access error occurs. |
getPrepareIsolation | public int getPrepareIsolation()(Code) | | Return prepare isolation
|
getResultSetOrderId | final int getResultSetOrderId()(Code) | | Return a unique order number for a result set.
A unique value is only needed if the result set is
being created within procedure and thus must be using
a nested connection.
|
getTransactionIsolation | final public int getTransactionIsolation() throws SQLException(Code) | | Get this Connection's current transaction isolation mode.
the current TRANSACTION_* mode value exception: SQLException - if a database-access error occurs. |
getTypeMap | public java.util.Map getTypeMap() throws SQLException(Code) | | Get the type-map object associated with this connection.
By default, the map returned is empty.
JDBC 2.0 - java.util.Map requires JDK 1
|
getWarnings | final public synchronized SQLWarning getWarnings() throws SQLException(Code) | | The first warning reported by calls on this Connection is
returned.
Note: Subsequent warnings will be chained to this
SQLWarning.
the first SQLWarning or null Synchronization note: Warnings are synchronized on nesting level |
handleException | final SQLException handleException(Throwable thrownException, boolean rollbackOnAutoCommit) throws SQLException(Code) | | Handle any type of Exception.
- Inform the contexts of the error
- Throw an Util based upon the thrown exception.
REMIND: now that we know all the exceptions from our driver
are Utils, would it make sense to shut down the system
for unknown SQLExceptions? At present, we do not.
Because this is the last stop for exceptions,
it will catch anything that occurs in it and try
to cleanup before re-throwing them.
Parameters: thrownException - the exception Parameters: rollbackOnAutoCommit - rollback the xact on if autocommit ison, otherwise rollback stmt but leave xact open (andcontinue to hold on to locks). Most of the time, thiswill be true, excepting operations on result sets, likegetInt(). |
isClosed | final public boolean isClosed()(Code) | | Tests to see if a Connection is closed.
true if the connection is closed; false if it's still open |
isReadOnly | final public boolean isReadOnly() throws SQLException(Code) | | Tests to see if the connection is in read-only mode.
true if connection is read-only exception: SQLException - if a database-access error occurs. |
nativeSQL | public String nativeSQL(String sql) throws SQLException(Code) | | A driver may convert the JDBC sql grammar into its system's
native SQL grammar prior to sending it; nativeSQL returns the
native form of the statement that the driver would have sent.
Parameters: sql - a SQL statement that may contain one or more '?'parameter placeholders the native form of this statement |
needCommit | protected void needCommit()(Code) | | if auto commit is on, remember that we need to commit
the current statement.
|
prepareCall | final public CallableStatement prepareCall(String sql) throws SQLException(Code) | | A SQL stored procedure call statement is handled by creating a
CallableStatement for it. The CallableStatement provides
methods for setting up its IN and OUT parameters, and
methods for executing it.
Note: This method is optimized for handling stored
procedure call statements. Some drivers may send the call
statement to the database when the prepareCall is done; others
may wait until the CallableStatement is executed. This has no
direct affect on users; however, it does affect which method
throws certain SQLExceptions.
JDBC 2.0
Result sets created using the returned CallableStatement will have
forward-only type, and read-only concurrency, by default.
Parameters: sql - a SQL statement that may contain one or more '?'parameter placeholders. Typically this statement is a JDBCfunction call escape string. a new CallableStatement object containing thepre-compiled SQL statement exception: SQLException - if a database-access error occurs. |
prepareCall | final public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0
Same as prepareCall() above, but allows the default result set
type and result set concurrency type to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new CallableStatement object containing thepre-compiled SQL statement exception: SQLException - if a database-access error occurs. |
prepareCall | final public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | JDBC 3.0
Same as prepareCall() above, but allows the default result set
type, result set concurrency type and result set holdability
to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX Parameters: resultSetHoldability - - one of the following ResultSet constants:ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT a new CallableStatement object containing thepre-compiled SQL statement exception: SQLException - if a database-access error occurs. |
prepareStatement | final public PreparedStatement prepareStatement(String sql) throws SQLException(Code) | | A SQL statement with or without IN parameters can be
pre-compiled and stored in a PreparedStatement object. This
object can then be used to efficiently execute this statement
multiple times.
Note: This method is optimized for handling
parametric SQL statements that benefit from precompilation. If
the driver supports precompilation, prepareStatement will send
the statement to the database for precompilation. Some drivers
may not support precompilation. In this case, the statement may
not be sent to the database until the PreparedStatement is
executed. This has no direct affect on users; however, it does
affect which method throws certain SQLExceptions.
JDBC 2.0
Result sets created using the returned PreparedStatement will have
forward-only type, and read-only concurrency, by default.
Parameters: sql - a SQL statement that may contain one or more '?' INparameter placeholders a new PreparedStatement object containing thepre-compiled statement exception: SQLException - if a database-access error occurs. |
prepareStatement | final public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0
Same as prepareStatement() above, but allows the default result set
type and result set concurrency type to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new PreparedStatement object containing thepre-compiled SQL statement exception: SQLException - if a database-access error occurs. |
prepareStatement | final public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | JDBC 3.0
Same as prepareStatement() above, but allows the default result set
type, result set concurrency type and result set holdability
to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX Parameters: resultSetHoldability - - one of the following ResultSet constants:ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT a new PreparedStatement object containing thepre-compiled SQL statement exception: SQLException - if a database-access error occurs. |
prepareStatement | final public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code) | | Creates a default PreparedStatement object capable of returning
the auto-generated keys designated by the given array. This array contains
the indexes of the columns in the target table that contain the auto-generated
keys that should be made available. This array is ignored if the SQL statement
is not an INSERT statement
JDBC 3.0
Parameters: sql - An SQL statement that may contain one or more ? IN parameter placeholders Parameters: columnIndexes - An array of column indexes indicating the columnsthat should be returned from the inserted row or rows A new PreparedStatement object, containing the pre-compiledSQL statement, that will have the capability of returning auto-generated keysdesignated by the given array of column indexes exception: SQLException - Feature not implemented for now. |
prepareStatement | final public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code) | | Creates a default PreparedStatement object capable of returning
the auto-generated keys designated by the given array. This array contains
the names of the columns in the target table that contain the auto-generated
keys that should be returned. This array is ignored if the SQL statement
is not an INSERT statement
JDBC 3.0
Parameters: sql - An SQL statement that may contain one or more ? IN parameter placeholders Parameters: columnNames - An array of column names indicating the columnsthat should be returned from the inserted row or rows A new PreparedStatement object, containing the pre-compiledSQL statement, that will have the capability of returning auto-generated keysdesignated by the given array of column names exception: SQLException - Feature not implemented for now. |
prepareStatement | final public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code) | | Creates a default PreparedStatement object that has the capability to
retieve auto-generated keys. The given constant tells the driver
whether it should make auto-generated keys available for retrieval.
This parameter is ignored if the SQL statement is not an INSERT statement.
JDBC 3.0
Parameters: sql - A SQL statement that may contain one or more ? IN parameter placeholders Parameters: autoGeneratedKeys - A flag indicating whether auto-generated keysshould be returned A new PreparedStatement object, containing the pre-compiledSQL statement, that will have the capability of returning auto-generated keys exception: SQLException - Feature not implemented for now. |
resetFromPool | public void resetFromPool() throws SQLException(Code) | | Reset the connection before it is returned from a PooledConnection
to a new application request (wrapped by a BrokeredConnection).
Examples of reset covered here is dropping session temporary tables
and reseting IDENTITY_VAL_LOCAL.
Most JDBC level reset is handled by calling standard java.sql.Connection
methods from EmbedPooledConnection.
|
rollback | public void rollback() throws SQLException(Code) | | Rollback drops all changes made since the previous
commit/rollback and releases any database locks currently held
by the Connection. This method should only be used when auto
commit has been disabled.
exception: SQLException - if a database-access error occurs. See Also: EmbedConnection.setAutoCommit See Also: |
setAutoCommit | public void setAutoCommit(boolean autoCommit) throws SQLException(Code) | | If a connection is in auto-commit mode, then all its SQL
statements will be executed and committed as individual
transactions. Otherwise, its SQL statements are grouped into
transactions that are terminated by either commit() or
rollback(). By default, new connections are in auto-commit
mode.
The commit occurs when the statement completes or the next
execute occurs, whichever comes first. In the case of
statements returning a ResultSet, the statement completes when
the last row of the ResultSet has been retrieved or the
ResultSet has been closed. In advanced cases, a single
statement may return multiple results as well as output
parameter values. Here the commit occurs when all results and
output param values have been retrieved.
Parameters: autoCommit - true enables auto-commit; false disablesauto-commit. exception: SQLException - if a database-access error occurs. |
setCatalog | public void setCatalog(String catalog) throws SQLException(Code) | | A sub-space of this Connection's database may be selected by setting a
catalog name. If the driver does not support catalogs it will
silently ignore this request.
exception: SQLException - if a database-access error occurs. |
setHoldability | final public void setHoldability(int holdability) throws SQLException(Code) | | JDBC 3.0
Changes the holdability of ResultSet objects created using this
Connection object to the given holdability.
Parameters: holdability - A ResultSet holdability constant, one of ResultSet.HOLD_CURSORS_OVER_COMMITor ResultSet.CLOSE_CURSORS_AT_COMMIT |
setInactive | final public void setInactive()(Code) | | Close the connection when processing errors, or when
closing a nested connection.
This only marks it as closed and frees up its resources;
any closing of the underlying connection or commit work
is assumed to be done elsewhere.
Called from EmbedConnectionContext's cleanup routine,
and by proxy.close().
|
setPrepareIsolation | public void setPrepareIsolation(int level) throws SQLException(Code) | | Set the transaction isolation level that will be used for the
next prepare. Used by network server to implement DB2 style
isolation levels.
Parameters: level - Isolation level to change to. level is the DB2 levelspecified in the package names which happen to correspondto our internal levels. If level == ExecutionContext.UNSPECIFIED_ISOLATION,the statement won't be prepared with an isolation level. |
setReadOnly | final public void setReadOnly(boolean readOnly) throws SQLException(Code) | | You can put a connection in read-only mode as a hint to enable
database optimizations.
Note: setReadOnly cannot be called while in the
middle of a transaction.
Parameters: readOnly - true enables read-only mode; false disablesread-only mode. exception: SQLException - if a database-access error occurs. |
setTransactionIsolation | public void setTransactionIsolation(int level) throws SQLException(Code) | | You can call this method to try to change the transaction
isolation level using one of the TRANSACTION_* values.
Note: setTransactionIsolation causes the current
transaction to commit
Parameters: level - one of the TRANSACTION_* isolation values with theexception of TRANSACTION_NONE; some databases may not supportother values exception: SQLException - if a database-access error occurs. See Also: DatabaseMetaData.supportsTransactionIsolationLevel See Also: |
setTypeMap | final public void setTypeMap(java.util.Map map) throws SQLException(Code) | | Install a type-map object as the default type-map for
this connection.
JDBC 2.0 - java.util.Map requires JDK 1
exception: SQLException - Feature not implemented for now. |
setupContextStack | final protected void setupContextStack() throws SQLException(Code) | | Install the context manager for this thread. Check connection status here.
exception: SQLException - if fails |
toString | public String toString()(Code) | | Get a String representation that uniquely identifies
this connection. Include the same information that is
printed in the log for various trace and error messages.
In Derby the "physical" connection is a LanguageConnectionContext,
or LCC.
The JDBC Connection is an JDBC-specific layer on top of this. Rather
than create a new id here, we simply use the id of the underlying LCC.
Note that this is a big aid in debugging, because much of the
engine trace and log code prints the LCC id.
a string representation for this connection |
transactionIsIdle | final public boolean transactionIsIdle()(Code) | | returns false if there is an underlying transaction and that transaction
has done work. True if there is no underlying transaction or that
underlying transaction is idle
|
|
|