Package org.apache.torque.util
Class TorqueConnectionImpl
java.lang.Object
org.apache.torque.util.TorqueConnectionImpl
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper,TorqueConnection
Encapsulates connection status tracking and allows AutoClosing within Torque.
- Author:
- Thomas Vandahl
-
Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidclose()voidcommit()createArrayOf(String typeName, Object[] elements) createStatement(int resultSetType, int resultSetConcurrency) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) createStruct(String typeName, Object[] attributes) booleangetClientInfo(String name) intintintbooleanisClosed()booleanHas Transaction.commit() been called successfully on this connection?booleanbooleanHas Transaction.rollback() been called successfully on this connection?booleanisValid(int timeout) booleanisWrapperFor(Class<?> iface) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql) prepareStatement(String sql, int autoGeneratedKeys) prepareStatement(String sql, int[] columnIndexes) prepareStatement(String sql, int resultSetType, int resultSetConcurrency) prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql, String[] columnNames) voidreleaseSavepoint(Savepoint savepoint) voidrollback()voidvoidsetAutoCommit(boolean autoCommit) voidsetCatalog(String catalog) voidsetClientInfo(String name, String value) voidsetClientInfo(Properties properties) voidsetCommitted(boolean committed) Called by TransactionManagerImpl.commit() to track statevoidsetHoldability(int holdability) voidsetNetworkTimeout(Executor executor, int milliseconds) voidsetReadOnly(boolean readOnly) voidsetRolledBack(boolean rolledBack) Called by TransactionManagerImpl.rollback() to track statesetSavepoint(String name) voidvoidsetTransactionIsolation(int level) voidsetTypeMap(Map<String, Class<?>> map) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
TorqueConnectionImpl
Constructor- Parameters:
con- Connection object
-
-
Method Details
-
setCommitted
public void setCommitted(boolean committed) Called by TransactionManagerImpl.commit() to track state- Specified by:
setCommittedin interfaceTorqueConnection- Parameters:
committed- the committed state to set
-
isCommitted
public boolean isCommitted()Has Transaction.commit() been called successfully on this connection?- Specified by:
isCommittedin interfaceTorqueConnection- Returns:
- true, if Transaction.commit() has been called.
-
setRolledBack
public void setRolledBack(boolean rolledBack) Called by TransactionManagerImpl.rollback() to track state- Specified by:
setRolledBackin interfaceTorqueConnection- Parameters:
rolledBack- the rolledBack state to set
-
isRolledBack
public boolean isRolledBack()Has Transaction.rollback() been called successfully on this connection?- Specified by:
isRolledBackin interfaceTorqueConnection- Returns:
- true, if Transaction.rollback() has been called.
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException- See Also:
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException- See Also:
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- See Also:
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException- See Also:
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException- See Also:
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException- See Also:
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException- See Also:
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Specified by:
closein interfaceTorqueConnection- Throws:
TorqueException- See Also:
-
isClosed
- Specified by:
isClosedin interfaceConnection- Throws:
SQLException- See Also:
-
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException- See Also:
-
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException- See Also:
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException- See Also:
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException- See Also:
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException- See Also:
-
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException- See Also:
-
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException- See Also:
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException- See Also:
-
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException- See Also:
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- See Also:
-
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException- See Also:
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException- See Also:
-
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException- See Also:
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException- See Also:
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException- See Also:
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException- See Also:
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- See Also:
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException- See Also:
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- See Also:
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException- See Also:
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException- See Also:
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException- See Also:
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException- See Also:
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException- See Also:
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException- See Also:
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException- See Also:
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException- See Also:
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException- See Also:
-
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException- See Also:
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException- See Also:
-
setSchema
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException- See Also:
-
getSchema
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException- See Also:
-
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException- See Also:
-
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException- See Also:
-
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException- See Also:
-