org.apache.openjpa.lib.jdbc
public abstract class DelegatingConnection extends java.lang.Object implements java.sql.Connection, Closeable
equals
and
hashCode
methods pass through to the base underlying data
store connection.Constructor and Description |
---|
DelegatingConnection(java.sql.Connection conn) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendInfo(java.lang.StringBuffer buf) |
void |
clearWarnings() |
void |
close() |
void |
commit() |
java.sql.Statement |
createStatement() |
protected java.sql.Statement |
createStatement(boolean wrap)
Create a statement, with the option of not wrapping it in a
DelegatingStatement , which is the default. |
java.sql.Statement |
createStatement(int type,
int concur) |
protected java.sql.Statement |
createStatement(int type,
int concur,
boolean wrap)
Create a statement, with the option of not wrapping it in a
DelegatingStatement , which is the default. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
protected java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) |
protected abstract void |
enforceAbstract()
Marker to enforce that subclasses of this class are abstract.
|
boolean |
equals(java.lang.Object other) |
boolean |
getAutoCommit() |
java.lang.String |
getCatalog() |
java.sql.Connection |
getDelegate()
Return the wrapped connection.
|
int |
getHoldability() |
java.sql.Connection |
getInnermostDelegate()
Return the base underlying data store connection.
|
java.sql.DatabaseMetaData |
getMetaData() |
protected java.sql.DatabaseMetaData |
getMetaData(boolean wrap)
Return the metadata, with the option of not wrapping it in a
DelegatingDatabaseMetaData , which is the default. |
int |
getTransactionIsolation() |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap() |
java.sql.SQLWarning |
getWarnings() |
int |
hashCode() |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isWrapperFor(java.lang.Class iface) |
java.lang.String |
nativeSQL(java.lang.String str) |
static DelegatingConnection |
newInstance(java.sql.Connection conn)
Constructor for the concrete implementation of this abstract class.
|
java.sql.CallableStatement |
prepareCall(java.lang.String str) |
protected java.sql.CallableStatement |
prepareCall(java.lang.String str,
boolean wrap)
Prepare a call, with the option of not wrapping it in a
DelegatingCallableStatement , which is the default. |
java.sql.CallableStatement |
prepareCall(java.lang.String str,
int type,
int concur) |
protected java.sql.CallableStatement |
prepareCall(java.lang.String str,
int type,
int concur,
boolean wrap)
Prepare a call, with the option of not wrapping it in a
DelegatingCallableStatement , which is the default. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
protected java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String str) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String str,
boolean wrap)
Prepare a statement, with the option of not wrapping it in a
DelegatingPreparedStatement , which is the default. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes,
boolean wrap) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys,
boolean wrap) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String str,
int type,
int concur) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String str,
int type,
int concur,
boolean wrap)
Prepare a statement, with the option of not wrapping it in a
DelegatingPreparedStatement , which is the default. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
protected java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames,
boolean wrap) |
void |
releaseSavepoint(java.sql.Savepoint savepoint) |
void |
rollback() |
void |
rollback(java.sql.Savepoint savepoint) |
void |
setAutoCommit(boolean bool) |
void |
setCatalog(java.lang.String str) |
void |
setHoldability(int holdability) |
void |
setReadOnly(boolean bool) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String savepoint) |
void |
setTransactionIsolation(int i) |
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) |
java.lang.String |
toString() |
java.lang.Object |
unwrap(java.lang.Class iface) |
public static DelegatingConnection newInstance(java.sql.Connection conn)
protected abstract void enforceAbstract()
public java.sql.Connection getDelegate()
public java.sql.Connection getInnermostDelegate()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected void appendInfo(java.lang.StringBuffer buf)
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.Statement createStatement(boolean wrap) throws java.sql.SQLException
DelegatingStatement
, which is the default.java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String str) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String str, boolean wrap) throws java.sql.SQLException
DelegatingPreparedStatement
, which is the default.java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String str) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.CallableStatement prepareCall(java.lang.String str, boolean wrap) throws java.sql.SQLException
DelegatingCallableStatement
, which is the default.java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String str) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
public void setAutoCommit(boolean bool) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void close() throws java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.DatabaseMetaData getMetaData(boolean wrap) throws java.sql.SQLException
DelegatingDatabaseMetaData
, which is the default.java.sql.SQLException
public void setReadOnly(boolean bool) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public void setCatalog(java.lang.String str) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
public void setTransactionIsolation(int i) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int type, int concur) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.Statement createStatement(int type, int concur, boolean wrap) throws java.sql.SQLException
DelegatingStatement
, which is the default.java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String str, int type, int concur) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String str, int type, int concur, boolean wrap) throws java.sql.SQLException
DelegatingPreparedStatement
, which is the default.java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String str, int type, int concur) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.CallableStatement prepareCall(java.lang.String str, int type, int concur, boolean wrap) throws java.sql.SQLException
DelegatingCallableStatement
, which is the default.java.sql.SQLException
public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String savepoint) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames, boolean wrap) throws java.sql.SQLException
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class iface)
isWrapperFor
in interface java.sql.Wrapper
public java.lang.Object unwrap(java.lang.Class iface)
unwrap
in interface java.sql.Wrapper