public class ConnectionDelegate extends Object implements Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
ConnectionDelegate(org.hibernate.engine.spi.SessionImplementor sessionImplementor) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
void |
clearWarnings()
Clears all warnings reported for this
Connection object. |
void |
close() |
void |
commit() |
Array |
createArrayOf(String typeName,
Object[] elements) |
Blob |
createBlob() |
Clob |
createClob() |
NClob |
createNClob() |
SQLXML |
createSQLXML() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a
Statement object that will generate ResultSet objects with the given type and concurrency. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Struct |
createStruct(String typeName,
Object[] attributes) |
boolean |
getAutoCommit() |
String |
getCatalog()
Retrieves this
Connection object's current catalog name. |
Properties |
getClientInfo() |
String |
getClientInfo(String name) |
int |
getHoldability() |
DatabaseMetaData |
getMetaData() |
int |
getNetworkTimeout() |
String |
getSchema() |
int |
getTransactionIsolation()
Retrieves this
Connection object's current transaction isolation level. |
Map<String,Class<?>> |
getTypeMap() |
SQLWarning |
getWarnings()
Retrieves the first warning reported by calls on this
Connection object. |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(Class<?> iface) |
String |
nativeSQL(String sql) |
CallableStatement |
prepareCall(String sql) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql) |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
void |
releaseSavepoint(Savepoint savepoint) |
void |
rollback() |
void |
rollback(Savepoint savepoint) |
void |
setAutoCommit(boolean autoCommit) |
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. |
void |
setClientInfo(Properties properties) |
void |
setClientInfo(String name,
String value) |
void |
setHoldability(int holdability) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
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 |
setSchema(String schema) |
void |
setTransactionIsolation(int level)
Attempts to change the transaction isolation level for this
Connection object to the one given. |
void |
setTypeMap(Map<String,Class<?>> map) |
<T> T |
unwrap(Class<T> iface) |
public ConnectionDelegate(org.hibernate.engine.spi.SessionImplementor sessionImplementor)
public Statement createStatement() throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic String nativeSQL(String sql) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic void commit()
throws SQLException
commit in interface ConnectionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface ConnectionSQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
Note: This method cannot be called during a transaction.
setReadOnly in interface ConnectionreadOnly - true enables read-only mode; false disables itSQLException - if a database access error occurs, this method is called on a closed connection or this method is called during a transactionpublic String getCatalog() throws SQLException
Connection object's current catalog name.getCatalog in interface Connectionnull if there is noneSQLException - if a database access error occurs or this method is called on a closed connectionsetCatalog(java.lang.String)public void setCatalog(String catalog) throws SQLException
Connection object's database in which to work.
If the driver does not support catalogs, it will silently ignore this request.
Calling setCatalog has no effect on previously created or prepared Statement objects. It is implementation defined whether a
DBMS prepare operation takes place immediately when the Connection method prepareStatement or prepareCall is invoked.
For maximum portability, setCatalog should be called before a Statement is created or prepared.
setCatalog in interface Connectioncatalog - the name of a catalog (subspace in this Connection object's database) in which to workSQLException - if a database access error occurs or this method is called on a closed connectiongetCatalog()public int getTransactionIsolation()
throws SQLException
Connection object's current transaction isolation level.getTransactionIsolation in interface ConnectionConnection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED,
Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE, or
Connection.TRANSACTION_NONE.SQLException - if a database access error occurs or this method is called on a closed connectionsetTransactionIsolation(int)public void setTransactionIsolation(int level)
throws SQLException
Connection object to the one given. The constants defined in the
interface Connection are the possible transaction isolation levels.
Note: If this method is called during a transaction, the result is implementation-defined.
setTransactionIsolation in interface Connectionlevel - one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED,
Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or
Connection.TRANSACTION_SERIALIZABLE. (Note that Connection.TRANSACTION_NONE cannot be used because it
specifies that transactions are not supported.)SQLException - if a database access error occurs, this method is called on a closed connection or the given parameter is not one of the
Connection constantsDatabaseMetaData.supportsTransactionIsolationLevel(int),
getTransactionIsolation()public SQLWarning getWarnings() throws SQLException
Connection object. If there is more than one warning, subsequent warnings
will be chained to the first one and can be retrieved by calling the method SQLWarning.getNextWarning on the warning that was
retrieved previously.
This method may not be called on a closed connection; doing so will cause an SQLException to be thrown.
Note: Subsequent warnings will be chained to this SQLWarning.
getWarnings in interface ConnectionSQLWarning object or null if there are noneSQLException - if a database access error occurs or this method is called on a closed connectionSQLWarningpublic void clearWarnings()
throws SQLException
Connection object. After a call to this method, the method getWarnings returns
null until a new warning is reported for this Connection object.clearWarnings in interface ConnectionSQLException - SQLException if a database access error occurs or this method is called on a closed connectionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
Statement object that will generate ResultSet objects with the given type and concurrency. This method is
the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden. The
holdability of the created result sets can be determined by calling getHoldability().createStatement in interface ConnectionresultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEStatement object that will generate ResultSet objects with the given type and concurrencySQLException - if a database access error occurs, this method is called on a closed connection or the given parameters are not
ResultSet constants indicating type and concurrencypublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic Map<String,Class<?>> getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLExceptionpublic void setHoldability(int holdability)
throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic void rollback(Savepoint savepoint) throws SQLException
rollback in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic Clob createClob() throws SQLException
createClob in interface ConnectionSQLExceptionpublic Blob createBlob() throws SQLException
createBlob in interface ConnectionSQLExceptionpublic NClob createNClob() throws SQLException
createNClob in interface ConnectionSQLExceptionpublic SQLXML createSQLXML() throws SQLException
createSQLXML in interface ConnectionSQLExceptionpublic boolean isValid(int timeout)
throws SQLException
isValid in interface ConnectionSQLExceptionpublic void setClientInfo(String name, String value) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic String getClientInfo(String name) throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic Properties getClientInfo() throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic void setClientInfo(Properties properties) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf in interface ConnectionSQLExceptionpublic Struct createStruct(String typeName, Object[] attributes) throws SQLException
createStruct in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema in interface ConnectionSQLExceptionpublic void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface ConnectionSQLExceptionpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout in interface ConnectionSQLExceptionpublic int getNetworkTimeout()
throws SQLException
getNetworkTimeout in interface ConnectionSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionCopyright © 2017–2018. All rights reserved.