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

public Class EmbedConnection

extends Object
implements EngineConnection
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.EngineConnection, java.sql.Connection, java.lang.AutoCloseable, java.sql.Wrapper
Imports
org.apache.derby.iapi.jdbc.InternalDriver, .AuthenticationService, .EngineConnection, .EngineLOB, .FailedProperties40, org.apache.derby.shared.common.reference.Attribute, .MessageId, .Property, .SQLState, .Limits, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.services.memory.LowMemory, org.apache.derby.iapi.services.monitor.ModuleFactory, .Monitor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.security.DatabasePermission, org.apache.derby.iapi.security.SecurityUtil, org.apache.derby.iapi.db.Database, org.apache.derby.impl.db.SlaveDatabase, org.apache.derby.shared.common.error.ExceptionSeverity, .SQLWarningFactory, .StandardException, org.apache.derby.shared.common.i18n.MessageService, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, .StatementContext, org.apache.derby.iapi.sql.dictionary.DataDictionary, org.apache.derby.iapi.store.access.XATransactionController, .TransactionController, .XATransactionController, org.apache.derby.iapi.store.replication.master.MasterFactory, org.apache.derby.iapi.store.replication.slave.SlaveFactory, java.io.IOException, java.security.Permission, java.sql.Array, .PreparedStatement, .CallableStatement, .Blob, .Clob, .DatabaseMetaData, .NClob, .SQLXML, .Struct, .ResultSet, .SQLClientInfoException, .SQLException, .SQLPermission, .SQLWarning, .Savepoint, .Statement, java.util.Collections, .HashSet, .Map, .WeakHashMap, .HashMap, .Properties, .Iterator, java.util.concurrent.Executor, javax.transaction.xa.XAException, org.apache.derby.iapi.transaction.TransactionControl, org.apache.derby.iapi.util.InterruptStatus, org.apache.derby.impl.jdbc.authentication.NoneAuthenticationServiceImpl

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

See Also
TransactionResourceImpl

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private Connection
applicationConnection

The Connection object the application is using when accessing the database through this connection.

pack-priv boolean
private int
private String
connString

Cached string representation of the connection id

pack-priv DatabaseMetaData
protected static final StandardException
private InternalDriver
factory

Factory for JDBC objects to be created.

private HashSet<LOBFile>
private HashMap<Integer, Object>
private int
private WeakHashMap<Object, Object>
lobReferences

Map to keep track of all the lobs associated with this connection.

public static final LowMemory
memoryState

Low memory state object for connection requests.

pack-priv boolean
public static final SQLException
NO_MEM

Static exception to be thrown when a Connection request can not be fulfilled due to lack of memory.

private static final int
private static final int
private static final int
private static final int
private static final int
private int
resultSetId

An increasing counter to assign to a ResultSet on its creation.

pack-priv final EmbedConnection
private SQLWarning
pack-priv TransactionResourceImpl
private boolean

Constructor Summary

AccessConstructor and Description
public
public
EmbedConnection(EmbedConnection
the input connection
inputConnection
)

Create a new connection based off of the connection passed in. Initializes state based on input connection, and copies appropriate object pointers.

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.

pack-priv void
addLobFile(LOBFile
LOBFile to add
lobFile
)

Add a temporary lob file to the lobFiles set.

public int

Returns:

an integer that represents the locator that has been allocated to this LOB.
addLOBMapping
(Object
The object which contains the LOB object that that is added to the HashMap.
LOBReference
)

Add the locator and the corresponding LOB object into the HashMap

pack-priv void
addLOBReference(Object
LOB Object
lobReference
)

Adds an entry of the lob in WeakHashMap.

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

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

Add a warning to the current list of warnings, to follow this note from Connection.getWarnings.

protected void
beginAborting()

Begin aborting the connection

private boolean

Returns:

false iff the monitor cannot handle a service of the type indicated by the protocol within the name. If that's the case then we are the wrong driver.
bootDatabase
(Properties
boot properties
info
,
boolean
If true, don't fail soft upgrade due to missing features (phase one of two phased hard upgrade boot).
softAuthenticationBoot
)

Boot database.

public void
cancelRunningStatement()

Cancels the current running statement.

private void
checkConflictingCryptoAttributes(Properties
boot properties (for instance URL connection attributes)
p
)

Examines the boot properties looking for conflicting cryptographic options and commands.

private void
checkDatabaseBooted(Database
The database that should have been booted
database
,
String
The operation that requires that the database has already been booted, used in the exception message if not booted
operation
,
String
The name of the database that should have been booted, used in the exception message if not booted
dbname
)

Check that a database has already been booted.

private void
checkDatabaseCreatePrivileges(String
The user to be checked for database create privileges
user
,
String
the name of the database to create
dbname
)

Checks that a user has the system privileges to create a database.

public void
checkForTransactionInProgress()

Check if the transaction is active so that we cannot close down the connection.

protected final void
checkIfClosed()

Raises an exception if the connection is closed.

private void
checkIsDBOwner(int
attempted operation which needs database owner powers
operation
)

Check if actual authenticationId is equal to the database owner's.

private void
checkUserCredentials(boolean creatingDatabase, String dbname, Properties userInfo)

private void
checkUserIsNotARole()

If applicable, check that we don't connect with a user name that equals a role.

private void
clearLOBMapping()

Clear the HashMap of all entries.

public final synchronized void
clearWarnings()

Implements java.sql.Connection.clearWarnings.

After this call, getWarnings returns null until a new warning is reported for this Connection.

public void
close()

Implements java.sql.Connection.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.

protected void
public void
commit()

Implements java.sql.Connection.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.

protected void
commitIfNeeded()

if a commit is needed, perform it.

private Savepoint

Returns:

The new Savepoint object
commonSetSavepointCode
(String
A String containing the name of the savepoint. Will be null if this is an unnamed savepoint
name
,
boolean
If true means it's a named user defined savepoint.
userSuppliedSavepointName
)

Creates a savepoint with the given name (if it is a named savepoint else we will generate a name because Derby only supports named savepoints internally) in the current transaction and returns the new Savepoint object that represents it.

private boolean
compareDatabaseNames(String leftDBName, String rightDBName)

Compare two user-specified database names to see if they identify the same database.

public 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 Blob

Returns:

An object that implements the Blob interface
createBlob
()

Implements java.sql.Connection.createBlob.

Constructs an object that implements the Blob interface.

private boolean

Returns:

true iff the attribute create=true is provided. This means create a standard database. In other cases, returns false.
createBoot
(Properties
the attribute set.
p
)

Examine the attributes set provided for illegal boot combinations and determine if this is a create boot.

public Clob

Returns:

An object that implements the Clob interface
createClob
()

Implements java.sql.Connection.createClob.

Constructs an object that implements the Clob interface.

private Database

Returns:

Database The newly created database or null.
createDatabase
(String
the database name
dbname
,
Properties
the properties
info
)

Create a new database.

public NClob
createNClob()

Implements java.sql.Connection.createNClob.

Constructs an object that implements the NClob interface.

private static Object
createPersistentService(final String factoryInterface, final String serviceName, final Properties properties)

Must be private so that user code can't call this entry point.

public SQLXML
createSQLXML()

Implements java.sql.Connection.createSQLXML.

Constructs an object that implements the SQLXML interface.

public final Statement

Returns:

a new Statement object
createStatement
()

Implements java.sql.Connection.createStatement.

SQL statements without parameters are normally executed using Statement objects.

public final Statement

Returns:

a new Statement object
createStatement
(int
a result set type, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
resultSetConcurrency
)

Implements java.sql.Connection.createStatement.

JDBC 2.0 Same as createStatement() above, but allows the default result set type and result set concurrency type to be overridden.

public final Statement

Returns:

a new Statement object
createStatement
(int
a result set type, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
resultSetConcurrency
,
int
a holdability type, ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.createStatement.

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.

public 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.

private boolean
emptyCredential(String credential)

Forbid empty or null usernames and passwords.

private Properties

Returns:

a new Properties set copied from the parameter but with no derby.* properties.
filterProperties
(Properties inputSet)

Filter out properties from the passed in set of JDBC attributes to remove any derby.* properties.

protected void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

private static Object
findService(final String factoryInterface, final String serviceName)

Must be private so that user code can't call this entry point.

public final Connection
public boolean

Returns:

Current state of auto-commit mode.
getAutoCommit
()

Implements java.sql.Connection.getAutoCommit.

Get the current auto-commit state.

public String

Returns:

the current catalog name or null
getCatalog
()

Implements java.sql.Connection.getCatalog.

Return the Connection's current catalog name.

public String

Returns:

a null String value
getClientInfo
(String
a String value
name
)

Implements java.sql.Connection.getClientInfo.

getClientInfo always returns a null String since Derby doesn't support ClientInfoProperties.

public Properties

Returns:

an empty Properties object
getClientInfo
()

Implements java.sql.Connection.getClientInfo.

getClientInfo always returns an empty Properties object since Derby doesn't support ClientInfoProperties.

protected final Object
public final ContextManager
getContextManager()

Return the context manager for this connection.

public String

Returns:

the current schema name
getCurrentSchemaName
()

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

Obtain the name of the current schema.

protected Database
public String

Returns:

String The dbname for this connection.
getDBName
()

Return the dbname for this connection.

public int

Returns:

0 if there is no database, the engine type otherwise. @see org.apache.derby.shared.common.reference.EngineType
getEngineType
()

Gets the EngineType of the connected database.

public final int

Returns:

The holdability, one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
getHoldability
()

Implements java.sql.Connection.getHoldability.

JDBC 3.0 Retrieves the current holdability of ResultSet objects created using this Connection object.

private int

Returns:

an integer that represents the most recent locator value.
getIncLOBKey
()

Return the current locator value/ 0x800x values are not valid values as they are used to indicate the BLOB is being sent by value, so we skip those values (DERBY-3243)

public final LanguageConnectionContext
private HashMap<Integer, Object>

Returns:

the HashMap that contains the locator to LOB object mapping
getlobHMObj
()

Return the Hash Map in the root connection

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 InternalDriver
public DatabaseMetaData

Returns:

a DatabaseMetaData object for this Connection
getMetaData
()

Implements java.sql.Connection.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. This information is made available through a DatabaseMetaData object.

pack-priv static ModuleFactory
getMonitor()

Must be package private so that user code can't call this entry point.

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 int
private String
pack-priv final int
getResultSetOrderId()

Return a unique order number for a result set.

public String
getSchema()

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

Get the name of the current schema.

protected final TransactionResourceImpl
public final int

Returns:

the current TRANSACTION_* mode value
getTransactionIsolation
()

Implements java.sql.Connection.getTransactionIsolation.

Get this Connection's current transaction isolation mode.

public final Map<String, Class<?>>

Returns:

type map for this connection
getTypeMap
()

Implements java.sql.Connection.getTypeMap.

Returns the type map for this connection.

public final synchronized SQLWarning

Returns:

the first SQLWarning or null Synchronization note: Warnings are synchronized on nesting level
getWarnings
()

Implements java.sql.Connection.getWarnings.

The first warning reported by calls on this Connection is returned.

private void
pack-priv SQLException
handleException(Throwable thrownException)

pack-priv final SQLException
handleException(Throwable
the exception
thrownException
,
boolean
rollback the xact on if autocommit is on, otherwise rollback stmt but leave xact open (and continue to hold on to locks). Most of the time, this will be true, excepting operations on result sets, like getInt().
rollbackOnAutoCommit
)

Handle any type of Exception.

private void
handleFailoverMaster(TransactionResourceImpl
an instance of TransactionResourceImpl Links the connection to the database.
tr
)

Used to authorize and verify the privileges of the user and initiate failover.

private void
handleFailoverSlave(Database
The database the failover operation will be performed on
database
)

Used to perform failover on a database in slave replication mode.

private void
private void
private void
handleStopReplicationSlave(Database
The database the stop slave operation will be performed on
database
,
Properties
The Attribute set.
p
)

Stop replication slave when called from a client.

private void
internalStopReplicationSlave(Database
The database the internal stop slave operation will be performed on
database
,
Properties
The Attribute set.
p
)

Stop replication slave when called from SlaveDatabase.

public boolean
isAborting()

Return true if the connection is aborting

public final boolean

Returns:

true if the connection is closed; false if it's still open
isClosed
()

Implements java.sql.Connection.isClosed.

Tests to see if a Connection is closed.

private boolean

Returns:

true if a boot will perform a cryptographic operation on the database.
isCryptoBoot
(Properties
the attribute set
p
)

Examines boot properties and determines if a boot with the given attributes would entail a cryptographic operation on the database.

private boolean

Returns:

true if the drop database operation is requested, false if not.
isDropDatabase
(Properties
the attribute set
p
)

Examines the boot properties and determines if the given attributes would entail dropping the database.

private boolean

Returns:

true if a boot will hard upgrade the database
isHardUpgradeBoot
(Properties
the attribute set
p
)

Examine boot properties and determine if a boot with the given attributes would entail a hard upgrade.

public boolean
private boolean

Returns:

true if the shutdownslave attribute has been set, false otherwise.
isInternalShutdownSlaveDatabase
(Properties
The attribute set.
p
)

Examine the boot properties and determine if a boot with the given attributes should stop slave replication mode.

public final boolean

Returns:

true if connection is read-only
isReadOnly
()

Implements java.sql.Connection.isReadOnly.

Tests to see if the connection is in read-only mode.

private boolean

Returns:

true if the failover attribute has been set. false otherwise.
isReplicationFailover
(Properties
The attribute set.
p
)

used to verify if the failover attribute has been set.

private static boolean
isSet(Properties p, String attribute)

Tells if the attribute/property has been set.

private boolean
private boolean
private boolean
private boolean

Returns:

true if the stopSlave attribute has been set, false otherwise.
isStopReplicationSlaveBoot
(Properties
The attribute set.
p
)

Examine the boot properties and determine if a boot with the given attributes should stop slave replication mode.

private static boolean
isTrue(Properties p, String attribute)

Tells if the attribute/property has the value true.

public boolean

Returns:

true if the connection is valid, false otherwise
isValid
(int
This should be the time in seconds to wait for the database operation used to validate the connection to complete (according to the JDBC4 JavaDoc). This is currently not supported/used.
timeout
)

Implements java.sql.Connection.isValid.

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

public boolean

Returns:

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

Implements java.sql.Wrapper.isWrapperFor.

Returns false unless interfaces is implemented

public String

Returns:

the native form of this statement
nativeSQL
(String
a SQL statement that may contain one or more '?' parameter placeholders
sql
)

Implements java.sql.Connection.nativeSQL.

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.

pack-priv static SQLException
newSQLException(String messageId, Object... args)

public final CallableStatement

Returns:

a new CallableStatement object containing the pre-compiled SQL statement
prepareCall
(String
a SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string.
sql
)

Implements java.sql.Connection.prepareCall.

A SQL stored procedure call statement is handled by creating a CallableStatement for it.

public final CallableStatement

Returns:

a new CallableStatement object containing the pre-compiled SQL statement
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, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
resultSetConcurrency
)

Implements java.sql.Connection.prepareCall.

JDBC 2.0 Same as prepareCall() above, but allows the default result set type and result set concurrency type to be overridden.

public final CallableStatement

Returns:

a new CallableStatement object containing the pre-compiled SQL statement
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, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
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.

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.

pack-priv PreparedStatement
public final PreparedStatement

Returns:

a new PreparedStatement object containing the pre-compiled statement
prepareStatement
(String
a SQL statement that may contain one or more '?' IN parameter placeholders
sql
)

Implements java.sql.Connection.prepareStatement.

A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object.

public final PreparedStatement

Returns:

a new PreparedStatement object containing the pre-compiled SQL statement
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, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
resultSetConcurrency
)

Implements java.sql.Connection.prepareStatement.

JDBC 2.0 Same as prepareStatement() above, but allows the default result set type and result set concurrency type to be overridden.

public final PreparedStatement

Returns:

a new PreparedStatement object containing the pre-compiled SQL statement
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, see ResultSet.TYPE_XXX
resultSetType
,
int
a concurrency type, see ResultSet.CONCUR_XXX
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.

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.

public final PreparedStatement

Returns:

A new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys designated by the given array of column indexes
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

Returns:

A new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys designated by the given array of column names
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

Returns:

A new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys
prepareStatement
(String
A SQL statement that may contain one or more ? IN parameter placeholders
sql
,
int
A flag indicating whether auto-generated keys should be returned
autoGeneratedKeys
)

Implements java.sql.Connection.prepareStatement.

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

private PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, int[] columnIndexes, String[] columnNames)

private LanguageConnectionContext
privilegedGetLCC()

Private lookup of the lcc..

private EmbedConnectionContext
public void
releaseSavepoint(Savepoint
The Savepoint object to be removed
savepoint
)

Implements java.sql.Connection.releaseSavepoint.

Removes the given Savepoint object from the current transaction.

pack-priv void
removeLobFile(LOBFile
LOBFile to remove.
lobFile
)

Remove LOBFile from the lobFiles set.

public void
removeLOBMapping(int
an integer that represents the locator that needs to be removed from the table.
key
)

Remove the key(LOCATOR) from the hash table.

private static void
removePersistentService(final String name)

Must be private so that user code can't call this entry point.

private Properties

Returns:

clone sans encryption properties
removePhaseTwoProps
(Properties
the attribute set
p
)

Remove any encryption or upgarde properties from the given properties

public void
resetFromPool()

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

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

protected final void
public void
rollback()

Implements java.sql.Connection.rollback.

Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection.

public void
rollback(Savepoint
The Savepoint object to rollback to
savepoint
)

Implements java.sql.Connection.rollback.

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

public final void
setApplicationConnection(Connection applicationConnection)

public void
setAutoCommit(boolean
true enables auto-commit; false disables auto-commit.
autoCommit
)

Implements java.sql.Connection.setAutoCommit.

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
the name of a catalog (subspace in this Connection object's database) in which to work
catalog
)

Implements java.sql.Connection.setCatalog.

A sub-space of this Connection's database may be selected by setting a catalog name.

public void
setClientInfo(String
a property key String
name
,
String
a property value String
value
)

Implements java.sql.Connection.setClientInfo.

setClientInfo will always throw a SQLClientInfoException since Derby does not support any properties.

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

Implements java.sql.Connection.setClientInfo.

setClientInfo will throw a SQLClientInfoException unless the properties parameter is empty, since Derby does not support any properties.

public void
setDrdaID(String
The DRDA identifier
drdaID
)

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

Set the DRDA identifier 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.

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

public final void
setInactive()

Close the connection when processing errors, or when closing a nested connection.

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 void
setPrepareIsolation(int
Isolation level to change to. level is the DB2 level specified in the package names which happen to correspond to our internal levels. If level == TransactionControl.UNSPECIFIED_ISOLATION, the statement won't be prepared with an isolation level.
level
)

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

Set the transaction isolation level that will be used for the next prepare.

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

Implements java.sql.Connection.setReadOnly.

You can put a connection in read-only mode as a hint to enable database optimizations.

private int
setResultSetType(int resultSetType)

public Savepoint

Returns:

The new Savepoint object
setSavepoint
()

Implements java.sql.Connection.setSavepoint.

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

public Savepoint

Returns:

The new Savepoint object
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
setTransactionIsolation(int
one of the TRANSACTION_* isolation values with the exception of TRANSACTION_NONE; some databases may not support other values
level
)

Implements java.sql.Connection.setTransactionIsolation.

You can call this method to try to change the transaction isolation level using one of the TRANSACTION_* values.

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

Implements java.sql.Connection.setTypeMap.

Install a type-map object as the default type-map for this connection.

protected final void
setupContextStack()

Install the context manager for this thread.

private static void
sleep(long
milliseconds to sleep
millis
)

Puts the current thread to sleep.

private static boolean
startPersistentService(final String serviceName, final Properties properties)

Must be private so that user code can't call this entry point.

public static String

Returns:

the database name without any sub-sub-protocol prefixes
stripSubSubProtocolPrefix
(String
a database name
dbname
)

Strips any sub-sub-protocol prefix from a database name.

public String

Returns:

a string representation for this connection
toString
()

Overrides java.lang.Object.toString.

Get a String representation that uniquely identifies this connection.

public final boolean
transactionIsIdle()

returns false if there is an underlying transaction and that transaction has done work.

public <T> T

Returns:

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

Implements java.sql.Wrapper.unwrap.

Returns this if this class implements the interface

private void
private void
private static boolean
vetTrue(Properties p, String attribute)

Returns true if the attribute exists and is set to true.

public final void
xa_commit(boolean onePhase)

Do not use this method directly use XATransactionState.xa_commit instead because it also maintains/cancels the timout task which is scheduled to cancel/rollback the global transaction.

public final int
xa_prepare()

Do not use this method directly use XATransactionState.xa_prepare instead because it also maintains/cancels the timeout task which is scheduled to cancel/rollback the global transaction.

public final void
xa_rollback()

Do not use this method directly use XATransactionState.xa_rollback instead because it also maintains/cancels the timout task which is scheduled to cancel/rollback the global transaction.

Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAllwaitwaitwait