Wrapper around an existing connection. Subclasses can override the
methods whose behavior they mean to change. The
methods pass through to the base underlying data
store connection.
| Method from org.apache.openjpa.lib.jdbc.DelegatingConnection Detail: |
protected void appendInfo(StringBuffer buf) {
if (_del != null)
_del.appendInfo(buf);
}
|
public void clearWarnings() throws SQLException {
_conn.clearWarnings();
}
|
public void close() throws SQLException {
_conn.close();
}
|
public void commit() throws SQLException {
_conn.commit();
}
|
public Statement createStatement() throws SQLException {
return createStatement(true);
}
|
protected Statement createStatement(boolean wrap) throws SQLException {
Statement stmnt;
if (_del != null)
stmnt = _del.createStatement(false);
else
stmnt = _conn.createStatement();
if (wrap)
stmnt = new DelegatingStatement(stmnt, this);
return stmnt;
}
Create a statement, with the option of not wrapping it in a
DelegatingStatement , which is the default. |
public Statement createStatement(int type,
int concur) throws SQLException {
return createStatement(type, concur, true);
}
|
protected Statement createStatement(int type,
int concur,
boolean wrap) throws SQLException {
Statement stmnt;
if (_del != null)
stmnt = _del.createStatement(type, concur, false);
else
stmnt = _conn.createStatement(type, concur);
if (wrap)
stmnt = new DelegatingStatement(stmnt, this);
return stmnt;
}
Create a statement, with the option of not wrapping it in a
DelegatingStatement , which is the default. |
public Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
assertJDBC3();
return createStatement(resultSetType, resultSetConcurrency,
resultSetHoldability, true);
}
|
protected Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) throws SQLException {
Statement stmnt;
if (_del != null)
stmnt = _del.createStatement(resultSetType, resultSetConcurrency,
resultSetHoldability, false);
else {
Method m = (Method) _jdbc3.get(CREATE_STATEMENT);
if (m == null)
m = createJDBC3Method(CREATE_STATEMENT, "createStatement",
new Class[]{ int.class, int.class, int.class });
stmnt = (Statement) invokeJDBC3(m, new Object[]{
Numbers.valueOf(resultSetType),
Numbers.valueOf(resultSetConcurrency),
Numbers.valueOf(resultSetHoldability) });
}
if (wrap)
stmnt = new DelegatingStatement(stmnt, this);
return stmnt;
}
|
public boolean equals(Object other) {
if (other == this)
return true;
if (other instanceof DelegatingConnection)
other = ((DelegatingConnection) other).getInnermostDelegate();
return getInnermostDelegate().equals(other);
}
|
public boolean getAutoCommit() throws SQLException {
return _conn.getAutoCommit();
}
|
public String getCatalog() throws SQLException {
return _conn.getCatalog();
}
|
public Connection getDelegate() {
return _conn;
}
Return the wrapped connection. |
public int getHoldability() throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(GET_HOLDABILITY);
if (m == null)
m = createJDBC3Method(GET_HOLDABILITY, "getHoldability", null);
return ((Number) invokeJDBC3(m, null)).intValue();
}
|
public Connection getInnermostDelegate() {
return (_del == null) ? _conn : _del.getInnermostDelegate();
}
Return the base underlying data store connection. |
public DatabaseMetaData getMetaData() throws SQLException {
return getMetaData(true);
}
|
protected DatabaseMetaData getMetaData(boolean wrap) throws SQLException {
DatabaseMetaData meta;
if (_del != null)
meta = _del.getMetaData(false);
else
meta = _conn.getMetaData();
if (wrap)
meta = new DelegatingDatabaseMetaData(meta, this);
return meta;
}
|
public int getTransactionIsolation() throws SQLException {
return _conn.getTransactionIsolation();
}
|
public Map getTypeMap() throws SQLException {
return _conn.getTypeMap();
}
|
public SQLWarning getWarnings() throws SQLException {
return _conn.getWarnings();
}
|
public int hashCode() {
return getInnermostDelegate().hashCode();
}
|
public boolean isClosed() throws SQLException {
return _conn.isClosed();
}
|
public boolean isReadOnly() throws SQLException {
return _conn.isReadOnly();
}
|
public String nativeSQL(String str) throws SQLException {
return _conn.nativeSQL(str);
}
|
public CallableStatement prepareCall(String str) throws SQLException {
return prepareCall(str, true);
}
|
protected CallableStatement prepareCall(String str,
boolean wrap) throws SQLException {
CallableStatement stmnt;
if (_del != null)
stmnt = _del.prepareCall(str, false);
else
stmnt = _conn.prepareCall(str);
if (wrap)
stmnt = new DelegatingCallableStatement(stmnt, this);
return stmnt;
}
|
public CallableStatement prepareCall(String str,
int type,
int concur) throws SQLException {
return prepareCall(str, type, concur, true);
}
|
protected CallableStatement prepareCall(String str,
int type,
int concur,
boolean wrap) throws SQLException {
CallableStatement stmnt;
if (_del != null)
stmnt = _del.prepareCall(str, type, concur, false);
else
stmnt = _conn.prepareCall(str, type, concur);
if (wrap)
stmnt = new DelegatingCallableStatement(stmnt, this);
return stmnt;
}
|
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
assertJDBC3();
return prepareCall(sql, resultSetType, resultSetConcurrency,
resultSetHoldability, true);
}
|
protected CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) throws SQLException {
CallableStatement stmnt;
if (_del != null)
stmnt = _del.prepareCall(sql, resultSetType,
resultSetConcurrency, resultSetHoldability, false);
else {
Method m = (Method) _jdbc3.get(PREPARE_CALL);
if (m == null)
m = createJDBC3Method(PREPARE_CALL, "prepareCall",
new Class[]{ String.class, int.class, int.class,
int.class });
stmnt = (CallableStatement) invokeJDBC3(m, new Object[]{ sql,
Numbers.valueOf(resultSetType),
Numbers.valueOf(resultSetConcurrency),
Numbers.valueOf(resultSetHoldability) });
}
if (wrap)
stmnt = new DelegatingCallableStatement(stmnt, this);
return stmnt;
}
|
public PreparedStatement prepareStatement(String str) throws SQLException {
return prepareStatement(str, true);
}
|
protected PreparedStatement prepareStatement(String str,
boolean wrap) throws SQLException {
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(str, false);
else
stmnt = _conn.prepareStatement(str, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY);
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys) throws SQLException {
assertJDBC3();
return prepareStatement(sql, autoGeneratedKeys, true);
}
|
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes) throws SQLException {
assertJDBC3();
return prepareStatement(sql, columnIndexes, true);
}
|
public PreparedStatement prepareStatement(String sql,
String[] columnNames) throws SQLException {
assertJDBC3();
return prepareStatement(sql, columnNames, true);
}
|
public PreparedStatement prepareStatement(String str,
int type,
int concur) throws SQLException {
return prepareStatement(str, type, concur, true);
}
|
protected PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys,
boolean wrap) throws SQLException {
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(sql, autoGeneratedKeys);
else {
Method m = (Method) _jdbc3.get(PREPARE_WITH_KEYS);
if (m == null)
m = createJDBC3Method(PREPARE_WITH_KEYS, "prepareStatement",
new Class[]{ String.class, int.class });
stmnt = (PreparedStatement) invokeJDBC3(m, new Object[]{ sql,
Numbers.valueOf(autoGeneratedKeys) });
}
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
protected PreparedStatement prepareStatement(String sql,
int[] columnIndexes,
boolean wrap) throws SQLException {
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(sql, columnIndexes, wrap);
else {
Method m = (Method) _jdbc3.get(PREPARE_WITH_INDEX);
if (m == null)
m = createJDBC3Method(PREPARE_WITH_INDEX, "prepareStatement",
new Class[]{ String.class, int[].class });
stmnt = (PreparedStatement) invokeJDBC3(m, new Object[]{ sql,
columnIndexes });
}
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
protected PreparedStatement prepareStatement(String sql,
String[] columnNames,
boolean wrap) throws SQLException {
assertJDBC3();
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(sql, columnNames, wrap);
else {
Method m = (Method) _jdbc3.get(PREPARE_WITH_NAMES);
if (m == null)
m = createJDBC3Method(PREPARE_WITH_NAMES, "prepareStatement",
new Class[]{ String.class, String[].class });
stmnt = (PreparedStatement) invokeJDBC3(m, new Object[]{ sql,
columnNames });
}
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
protected PreparedStatement prepareStatement(String str,
int type,
int concur,
boolean wrap) throws SQLException {
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(str, type, concur, false);
else
stmnt = _conn.prepareStatement(str, type, concur);
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
assertJDBC3();
return prepareStatement(sql, resultSetType, resultSetConcurrency,
resultSetHoldability, true);
}
|
protected PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
boolean wrap) throws SQLException {
PreparedStatement stmnt;
if (_del != null)
stmnt = _del.prepareStatement(sql, resultSetType,
resultSetConcurrency, resultSetHoldability, false);
else {
Method m = (Method) _jdbc3.get(PREPARE_STATEMENT);
if (m == null)
m = createJDBC3Method(PREPARE_STATEMENT, "prepareStatement",
new Class[]{ String.class, int.class, int.class,
int.class });
stmnt = (PreparedStatement) invokeJDBC3(m, new Object[]{ sql,
Numbers.valueOf(resultSetType),
Numbers.valueOf(resultSetConcurrency),
Numbers.valueOf(resultSetHoldability) });
}
if (wrap)
stmnt = new DelegatingPreparedStatement(stmnt, this);
return stmnt;
}
|
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(RELEASE_SAVEPOINT);
if (m == null)
m = createJDBC3Method(RELEASE_SAVEPOINT, "releaseSavepoint",
new Class[]{ Savepoint.class });
invokeJDBC3(m, new Object[]{ savepoint });
}
|
public void rollback() throws SQLException {
_conn.rollback();
}
|
public void rollback(Savepoint savepoint) throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(ROLLBACK_SAVEPOINT);
if (m == null)
m = createJDBC3Method(ROLLBACK_SAVEPOINT, "rollback",
new Class[]{ Savepoint.class });
invokeJDBC3(m, new Object[]{ savepoint });
}
|
public void setAutoCommit(boolean bool) throws SQLException {
_conn.setAutoCommit(bool);
}
|
public void setCatalog(String str) throws SQLException {
_conn.setCatalog(str);
}
|
public void setHoldability(int holdability) throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(SET_HOLDABILITY);
if (m == null)
m = createJDBC3Method(SET_HOLDABILITY, "setHoldability",
new Class[]{ int.class });
invokeJDBC3(m, new Object[]{ Numbers.valueOf(holdability) });
}
|
public void setReadOnly(boolean bool) throws SQLException {
_conn.setReadOnly(bool);
}
|
public Savepoint setSavepoint() throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(SET_SAVEPOINT_NONAME);
if (m == null)
m = createJDBC3Method(SET_SAVEPOINT_NONAME, "setSavepoint", null);
return (Savepoint) invokeJDBC3(m, null);
}
|
public Savepoint setSavepoint(String savepoint) throws SQLException {
assertJDBC3();
Method m = (Method) _jdbc3.get(SET_SAVEPOINT);
if (m == null)
m = createJDBC3Method(SET_SAVEPOINT, "setSavepoint",
new Class[]{ String.class });
return (Savepoint) invokeJDBC3(m, new Object[]{ savepoint });
}
|
public void setTransactionIsolation(int i) throws SQLException {
_conn.setTransactionIsolation(i);
}
|
public void setTypeMap(Map map) throws SQLException {
_conn.setTypeMap(map);
}
|
public String toString() {
StringBuffer buf = new StringBuffer("conn ").append(hashCode());
appendInfo(buf);
return buf.toString();
}
|