public class ConnectionImpl extends WrapperRelease<Statement> implements Connection, ParsedStatement
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
ConnectionImpl(HybrisDataSource dataSource,
Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
protected void |
assureWritable() |
protected void |
autoRollbackOnUnsetTxBOund() |
void |
clearWarnings() |
void |
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.
|
void |
closeUnderlayingConnection() |
void |
commit() |
protected void |
commitInternal() |
Array |
createArrayOf(String arg0,
Object[] arg1) |
Blob |
createBlob() |
Clob |
createClob() |
NClob |
createNClob() |
SQLXML |
createSQLXML() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Struct |
createStruct(String arg0,
Object[] arg1) |
boolean |
getAutoCommit() |
String |
getCatalog() |
Properties |
getClientInfo() |
String |
getClientInfo(String arg0) |
int |
getConnectionID()
returns the connection ID which is a unique ID which is counted up after each creation of a new connection
|
protected String |
getConnectionInfo() |
HybrisDataSource |
getDataSource() |
int |
getHoldability() |
DatabaseMetaData |
getMetaData() |
int |
getNetworkTimeout() |
String |
getSchema() |
int |
getTransactionIsolation() |
Map |
getTypeMap() |
Connection |
getUnderlayingConnection()
returns the underlying physical java.sql.Connection
|
SQLWarning |
getWarnings() |
protected boolean |
gotError() |
protected boolean |
hasBeenRollbacked() |
void |
invalidate() |
boolean |
isClosed() |
protected boolean |
isFlexibleSyntax(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 reliable
|
boolean |
isReadOnly() |
boolean |
isTxBound() |
boolean |
isTxBoundUserTA() |
boolean |
isValid(int arg0) |
boolean |
isWrapperFor(Class<?> arg0) |
protected void |
logError(SQLException e,
String message) |
String |
nativeSQL(String sql) |
protected void |
notifyError(SQLException cause) |
protected void |
notifyStatementClosed(StatementImpl stmt) |
String |
parseQuery(String queryIn) |
CallableStatement |
prepareCall(String sql) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
void |
prepareForUse() |
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) |
protected void |
protectReadOnly(String sql) |
protected void |
releaseResourceImpl(Statement resource) |
void |
releaseSavepoint(Savepoint savepoint) |
void |
resetError() |
void |
restoreAfterUse() |
protected void |
restoreAutoCommit() |
protected void |
restoreTxIsolationLevel() |
void |
rollback() |
void |
rollback(Savepoint savePoint) |
protected void |
rollbackInternal() |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(String catalog) |
void |
setClientInfo(Properties arg0) |
void |
setClientInfo(String arg0,
String arg1) |
void |
setHoldability(int holdability) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
void |
setReadOnly(boolean readOnly) |
Savepoint |
setSavepoint() |
Savepoint |
setSavepoint(String name) |
void |
setSchema(String schema) |
void |
setTransactionIsolation(int level) |
void |
setTxBoundNoUserTA() |
void |
setTxBoundUserTA(Integer isolationLevel) |
void |
setTypeMap(Map<String,Class<?>> arg0) |
String |
toString() |
void |
unsetTxBound() |
<T> T |
unwrap(Class<T> arg0) |
protected PreparedStatement |
wrapPreparedStatement(PreparedStatement pstmt,
String sql)
returns a wrapped PreparedStatement
|
addResource, releaseResources, removeResourcepublic ConnectionImpl(HybrisDataSource dataSource, Connection connection)
protected boolean gotError()
protected boolean hasBeenRollbacked()
protected void notifyError(SQLException cause)
protected void logError(SQLException e, String message)
protected String getConnectionInfo()
protected void protectReadOnly(String sql) throws SQLException
SQLExceptionprotected void assureWritable()
throws SQLException
SQLExceptionpublic HybrisDataSource getDataSource()
public void invalidate()
public void unsetTxBound()
protected void restoreAutoCommit()
protected void restoreTxIsolationLevel()
protected void autoRollbackOnUnsetTxBOund()
public void setTxBoundNoUserTA()
public void setTxBoundUserTA(Integer isolationLevel) throws SQLException
SQLExceptionpublic boolean isTxBound()
public boolean isTxBoundUserTA()
public boolean isClosed()
isClosed in interface Connectionpublic void prepareForUse()
public void restoreAfterUse()
throws SQLException
SQLExceptionpublic void closeUnderlayingConnection()
throws SQLException
SQLExceptionpublic Connection getUnderlayingConnection()
public int getConnectionID()
protected PreparedStatement wrapPreparedStatement(PreparedStatement pstmt, String sql)
protected boolean isFlexibleSyntax(String query) throws SQLException
isFlexibleSyntax in class WrapperRelease<Statement>SQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLException - if the connection was already closed beforeprotected void notifyStatementClosed(StatementImpl stmt)
protected void releaseResourceImpl(Statement resource) throws SQLException
releaseResourceImpl in class WrapperRelease<Statement>resource - abstracts, release mechanism for underlying resource any specific implementation for release resources
should add hereSQLExceptionpublic String parseQuery(String queryIn) throws SQLException
parseQuery in interface ParsedStatementqueryIn - query to be parsed in flex-mode implementationSQLException - is thrown if during parsing something goes wrongpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic void commit()
throws SQLException
commit in interface ConnectionSQLExceptionprotected void commitInternal()
throws SQLException
SQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionprotected void rollbackInternal()
throws SQLException
SQLExceptionpublic void rollback(Savepoint savePoint) throws SQLException
rollback in interface ConnectionSQLExceptionpublic Statement createStatement() throws SQLException
createStatement in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement 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 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic String getCatalog() throws SQLException
getCatalog in interface ConnectionSQLExceptionpublic void setCatalog(String catalog) throws SQLException
setCatalog in interface ConnectionSQLExceptionpublic int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLExceptionpublic void setHoldability(int holdability)
throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLExceptionpublic void setTransactionIsolation(int level)
throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionpublic Map getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface ConnectionSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLExceptionpublic boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic String nativeSQL(String sql) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic void setTypeMap(Map<String,Class<?>> arg0) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic Blob createBlob() throws SQLException
createBlob in interface ConnectionSQLExceptionpublic Clob createClob() throws SQLException
createClob in interface ConnectionSQLExceptionpublic NClob createNClob() throws SQLException
createNClob in interface ConnectionSQLExceptionpublic SQLXML createSQLXML() throws SQLException
createSQLXML in interface ConnectionSQLExceptionpublic Properties getClientInfo() throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic String getClientInfo(String arg0) throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic boolean isValid(int arg0)
throws SQLException
isValid in interface ConnectionSQLExceptionpublic boolean isWrapperFor(Class<?> arg0) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic Array createArrayOf(String arg0, Object[] arg1) throws SQLException
createArrayOf in interface ConnectionSQLExceptionpublic Struct createStruct(String arg0, Object[] arg1) throws SQLException
createStruct in interface ConnectionSQLExceptionpublic void setClientInfo(Properties arg0) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic void setClientInfo(String arg0, String arg1) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic <T> T unwrap(Class<T> arg0) throws SQLException
unwrap in interface WrapperSQLExceptionpublic void resetError()
public void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema 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 ConnectionSQLExceptionCopyright © 2017 SAP SE. All Rights Reserved.