Package de.hybris.platform.jdbcwrapper
Class ConnectionImpl
java.lang.Object
de.hybris.platform.jdbcwrapper.WrapperRelease<Statement>
de.hybris.platform.jdbcwrapper.ConnectionImpl
- All Implemented Interfaces:
ParsedStatement,AutoCloseable,Connection,Wrapper
- Direct Known Subclasses:
JUnitConnectionImpl
public class ConnectionImpl
extends WrapperRelease<Statement>
implements Connection, ParsedStatement
Wrapper for the jdbc Connection class CAUTION: Please be aware that this file will be compiled by using jdk
1.6 and jdk 1.7,
for being successful in both cases we have to suppress the generation of the @override annotation. So please DONT OPEN/SAVE this file by using eclipse !!!!
for being successful in both cases we have to suppress the generation of the @override annotation. So please DONT OPEN/SAVE this file by using eclipse !!!!
-
Nested Class Summary
Nested Classes -
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 TypeMethodDescriptionvoidprotected voidprotected voidvoidvoidclose()if this connection is not TX bound, it is returned to the JDBC Connection pool If it is TX bound, we do nothing, because the next DataSourceImpl.getConnection() will return exactly this connection.voidvoidcommit()protected voidcreateArrayOf(String arg0, Object[] arg1) createStatement(int resultSetType, int resultSetConcurrency) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) createStruct(String arg0, Object[] arg1) booleangetClientInfo(String arg0) intreturns the connection ID which is a unique ID which is counted up after each creation of a new connectionprotected Stringintlongintintreturns the underlying physical java.sql.Connectionprotected booleangotError()protected booleanvoidbooleanisClosed()protected booleanisFlexibleSyntax(String query) logic for recognizing if 'query has' flexible search syntax if { or } happends to ba after from else in first 20 signs of the query - less reliablebooleanbooleanbooleanbooleanbooleanisValid(int timeout) booleanisWrapperFor(Class<?> arg0) protected voidlogError(SQLException e, String message) voidmarkValid(long errorCounter) protected voidnotifyError(SQLException cause) protected voidparseQuery(String queryIn) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) voidprepareStatement(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) protected voidprotectReadOnly(String sql) protected voidreleaseResourceImpl(Statement resource) voidreleaseSavepoint(Savepoint savepoint) voidvoidprotected voidprotected voidvoidrollback()voidprotected voidvoidsetAutoCommit(boolean autoCommit) voidsetCatalog(String catalog) voidsetClientInfo(String arg0, String arg1) voidsetClientInfo(Properties arg0) voidsetErrorHandler(ConnectionImpl.ErrorHandler errorHandler) voidsetHoldability(int holdability) voidsetNetworkTimeout(Executor executor, int milliseconds) voidsetReadOnly(boolean readOnly) setSavepoint(String name) voidvoidsetTransactionIsolation(int level) voidvoidsetTxBoundUserTA(Integer isolationLevel) voidsetTypeMap(Map<String, Class<?>> arg0) toString()void<T> Tprotected PreparedStatementwrapPreparedStatement(PreparedStatement pstmt, String sql) returns a wrapped PreparedStatementMethods inherited from class de.hybris.platform.jdbcwrapper.WrapperRelease
addResource, releaseResources, removeResourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
ConnectionImpl
-
-
Method Details
-
gotError
protected boolean gotError() -
hasBeenRollbacked
protected boolean hasBeenRollbacked() -
notifyError
-
logError
-
getConnectionInfo
-
protectReadOnly
- Throws:
SQLException
-
assureWritable
- Throws:
SQLException
-
getDataSource
-
invalidate
public void invalidate() -
unsetTxBound
public void unsetTxBound() -
restoreAutoCommit
protected void restoreAutoCommit() -
restoreTxIsolationLevel
protected void restoreTxIsolationLevel() -
autoRollbackOnUnsetTxBOund
protected void autoRollbackOnUnsetTxBOund() -
setTxBoundNoUserTA
public void setTxBoundNoUserTA() -
setTxBoundUserTA
- Throws:
SQLException
-
isTxBound
public boolean isTxBound() -
isTxBoundUserTA
public boolean isTxBoundUserTA() -
isClosed
- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
prepareForUse
public void prepareForUse() -
restoreAfterUse
- Throws:
SQLException
-
closeUnderlayingConnection
- Throws:
SQLException
-
getUnderlayingConnection
returns the underlying physical java.sql.Connection- Returns:
- the connection
-
getConnectionID
public int getConnectionID()returns the connection ID which is a unique ID which is counted up after each creation of a new connection- Returns:
- the connID
-
wrapPreparedStatement
returns a wrapped PreparedStatement -
isFlexibleSyntax
logic for recognizing if 'query has' flexible search syntax if { or } happends to ba after from else in first 20 signs of the query - less reliable- Specified by:
isFlexibleSyntaxin classWrapperRelease<Statement>- Throws:
SQLException
-
close
if this connection is not TX bound, it is returned to the JDBC Connection pool If it is TX bound, we do nothing, because the next DataSourceImpl.getConnection() will return exactly this connection. It will then be closed if the connection is committed or rollbacked.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException- if the connection was already closed before
-
notifyStatementClosed
-
releaseResourceImpl
- Specified by:
releaseResourceImplin classWrapperRelease<Statement>- Parameters:
resource- abstracts, release mechanism for underlying resource any specific implementation for release resources should add here- Throws:
SQLException
-
parseQuery
- Specified by:
parseQueryin interfaceParsedStatement- Parameters:
queryIn- query to be parsed in flex-mode implementation- Returns:
- parsed query into plain sql for underlying DB to perform on
- Throws:
SQLException- is thrown if during parsing something goes wrong
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
commitInternal
- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
rollbackInternal
- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
markValid
public void markValid(long errorCounter) -
getLastValidationErrorCounter
public long getLastValidationErrorCounter() -
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
isUnderlyingConnectionValid
public boolean isUnderlyingConnectionValid() -
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
resetError
public void resetError() -
toString
-
setErrorHandler
-
setSchema
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException- Since:
- jdk 1.7
-
getSchema
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException- Since:
- jdk 1.7
-
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException- Since:
- jdk 1.7
-
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException- Since:
- jdk 1.7
-
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException- Since:
- jdk 1.7
-