|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.application.container.spi.sql.DatabaseConnection
public class DatabaseConnection
DatabaseConnection
| Field Summary |
|---|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
DatabaseConnection()
|
|
| Method Summary | |
|---|---|
void |
clearWarnings()
Clears all warnings reported for this Connection object. |
void |
close()
Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released. |
void |
commit()
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. |
Statement |
createStatement()
Creates a Statement object for sending SQL statements to the database. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
boolean |
getAutoCommit()
Retrieves the current auto-commit mode for this Connection object. |
String |
getCatalog()
Retrieves this Connection object's current catalog name. |
int |
getHoldability()
|
DatabaseMetaData |
getMetaData()
Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection. |
int |
getTransactionIsolation()
Retrieves this Connection object's current transaction isolation level |
Map |
getTypeMap()
|
SQLWarning |
getWarnings()
|
boolean |
isClosed()
Retrieves whether this Connection object has been closed. |
boolean |
isReadOnly()
Retrieves whether this Connection object is in read-only mode. |
String |
nativeSQL(String sql)
Converts the given SQL statement into the system's native SQL grammar. |
CallableStatement |
prepareCall(String sql)
Creates a CallableStatement object for calling database stored procedures. |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
|
void |
releaseSavepoint(Savepoint savepoint)
|
void |
rollback()
Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. |
void |
rollback(Savepoint savepoint)
|
void |
setAutoCommit(boolean autoCommit)
Sets this connection's auto-commit mode to the given state. |
void |
setCatalog(String catalog)
Sets the given catalog name in order to select a subspace of this Connection object's database in which to work. |
protected void |
setDelegate(CloseCallback managedConnection,
Connection connection)
Set the delegate |
void |
setHoldability(int holdability)
|
void |
setReadOnly(boolean readOnly)
Puts this connection in read-only mode as a hint to the driver to enable database optimizations. |
Savepoint |
setSavepoint()
|
Savepoint |
setSavepoint(String name)
|
void |
setTransactionIsolation(int level)
Attempts to change the transaction isolation level for this Connection object to the one given. |
void |
setTypeMap(Map map)
Installs the given TypeMap object as the type map for this Connection object. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.sql.Connection |
|---|
createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, isValid, setClientInfo, setClientInfo |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Constructor Detail |
|---|
public DatabaseConnection()
| Method Detail |
|---|
protected void setDelegate(CloseCallback managedConnection,
Connection connection)
managedConnnection - the JCA managed connectionconnnection - the SQL connection
public void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLException - if a database access error occurs
public void close()
throws SQLException
close in interface ConnectionSQLException - if a database access error occurs
public void commit()
throws SQLException
commit in interface ConnectionSQLException - if a database access error occurs or this Connection object is in
auto-commit mode
public Statement createStatement()
throws SQLException
Result sets created using the returned Statement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.
createStatement in interface ConnectionSQLException - if a database access error occurs
public Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLException
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.
createStatement in interface ConnectionresultSetType - resultSetConcurrency -
SQLException - if a database access error occurs
public boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLException - if a database access error occurs
public String getCatalog()
throws SQLException
getCatalog in interface ConnectionSQLException - if a database access error occurs
public DatabaseMetaData getMetaData()
throws SQLException
getMetaData in interface ConnectionSQLException - if a database access error occurs
public int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLException - if a database access error occurs
public Map getTypeMap()
throws SQLException
getTypeMap in interface ConnectionSQLException
public SQLWarning getWarnings()
throws SQLException
getWarnings in interface ConnectionSQLException
public boolean isClosed()
throws SQLException
This method generally cannot be called to determine whether a connection to a database is valid or invalid. A typical client can determine that a connection is invalid by catching any exceptions that might be thrown when an operation is attempted.
isClosed in interface ConnectionSQLException - if a database access error occurs
public boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLException - if a database access error occurs
public String nativeSQL(String sql)
throws SQLException
nativeSQL in interface Connectionsql - an SQL statement that may contain one or more '?' parameter
placeholders
SQLException - if a database access error occurs
public CallableStatement prepareCall(String sql)
throws SQLException
prepareCall in interface Connectionsql - an SQL statement that may contain one or more '?' parameter
placeholders. Typically this statement is a JDBC function call escape s
tring.
SQLException - if a database access error occurs
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
prepareCall in interface Connectionsql - resultSetType - resultSetConcurrency -
SQLException - if a database access error occurs
public PreparedStatement prepareStatement(String sql)
throws SQLException
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.
prepareStatement in interface Connectionsql - an SQL statement that may contain one or more '?' IN
parameter placeholders
SQLException - if a database access error occurs
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
prepareStatement in interface Connectionsql - resultSetType - resultSetConcurrency -
SQLException - if a database access error occurs
public void rollback()
throws SQLException
rollback in interface ConnectionSQLException - if a database access error occurs or this
Connection object is in auto-commit mode
public void setAutoCommit(boolean autoCommit)
throws SQLException
The commit occurs when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a ResultSet object, the statement completes when the last row of the ResultSet object has been retrieved or the ResultSet object has been closed. In advanced cases, a single statement may return multiple results as well as output parameter values. In these cases, the commit occurs when all results and output parameter values have been retrieved.
setAutoCommit in interface ConnectionautoCommit -
SQLException - if a database access error occurs
public void setCatalog(String catalog)
throws SQLException
If the driver does not support catalogs, it will silently ignore this request.
setCatalog in interface Connectioncatalog -
SQLException - if a database access error occurs
public void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface ConnectionreadOnly -
SQLException - if a database access error occurs
public void setTransactionIsolation(int level)
throws SQLException
setTransactionIsolation in interface Connectionlevel -
SQLException - if a database access error occurs
public void setTypeMap(Map map)
throws SQLException
setTypeMap in interface Connectionmap -
SQLException - if a database access error occurspublic String toString()
toString in class Object
public Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
createStatement in interface ConnectionresultSetType - resultSetConcurrency - resultSetHoldability -
SQLException
public int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLException
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
prepareCall in interface Connectionsql - resultSetType - resultSetConcurrency - resultSetHoldability -
SQLException
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys)
throws SQLException
prepareStatement in interface Connectionsql - autoGeneratedKeys -
SQLException
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
prepareStatement in interface Connectionsql - resultSetType - resultSetConcurrency - resultSetHoldability -
SQLException
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes)
throws SQLException
prepareStatement in interface Connectionsql - columnIndexes -
SQLException
public PreparedStatement prepareStatement(String sql,
String[] columnNames)
throws SQLException
prepareStatement in interface Connectionsql - columnNames -
SQLException
public void releaseSavepoint(Savepoint savepoint)
throws SQLException
releaseSavepoint in interface Connectionsavepoint -
SQLException
public void rollback(Savepoint savepoint)
throws SQLException
rollback in interface Connectionsavepoint -
SQLException
public void setHoldability(int holdability)
throws SQLException
setHoldability in interface Connectionholdability -
SQLException
public Savepoint setSavepoint()
throws SQLException
setSavepoint in interface ConnectionSQLException
public Savepoint setSavepoint(String name)
throws SQLException
setSavepoint in interface Connectionname -
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||