| Method from org.apache.commons.dbcp.TesterConnection Detail: |
protected void checkFailure() throws SQLException {
if (failure != null) {
throw new SQLNestedException("TesterConnection failure", failure);
}
}
|
protected void checkOpen() throws SQLException {
if(!_open) {
throw new SQLException("Connection is closed.");
}
checkFailure();
}
|
public void clearWarnings() throws SQLException {
checkOpen();
warnings = null;
}
|
public void close() throws SQLException {
checkOpen();
_open = false;
}
|
public void commit() throws SQLException {
checkOpen();
if (isReadOnly()) {
throw new SQLException("Cannot commit a readonly connection");
}
}
|
public Statement createStatement() throws SQLException {
checkOpen();
return new TesterStatement(this);
}
|
public Statement createStatement(int resultSetType,
int resultSetConcurrency) throws SQLException {
checkOpen();
return new TesterStatement(this);
}
|
public Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public boolean getAutoCommit() throws SQLException {
checkOpen();
return _autoCommit;
}
|
public String getCatalog() throws SQLException {
checkOpen();
return _catalog;
}
|
public int getHoldability() throws SQLException {
throw new SQLException("Not implemented.");
}
|
public DatabaseMetaData getMetaData() throws SQLException {
checkOpen();
return _metaData;
}
|
public int getTransactionIsolation() throws SQLException {
checkOpen();
return _transactionIsolation;
}
|
public Map getTypeMap() throws SQLException {
checkOpen();
return _typeMap;
}
|
public String getUsername() {
return this.username;
}
|
public SQLWarning getWarnings() throws SQLException {
checkOpen();
return warnings;
}
|
public boolean isClosed() throws SQLException {
checkFailure();
return !_open;
}
|
public boolean isReadOnly() throws SQLException {
checkOpen();
return _readOnly;
}
|
public String nativeSQL(String sql) throws SQLException {
checkOpen();
return sql;
}
|
public CallableStatement prepareCall(String sql) throws SQLException {
checkOpen();
if ("warning".equals(sql)) {
setWarnings(new SQLWarning("warning in prepareCall"));
}
return null;
}
|
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) throws SQLException {
checkOpen();
return null;
}
|
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public PreparedStatement prepareStatement(String sql) throws SQLException {
checkOpen();
if("null".equals(sql)) {
return null;
} if("invalid".equals(sql)) {
throw new SQLException("invalid query");
} if ("broken".equals(sql)) {
throw new SQLException("broken connection");
}
return new TesterPreparedStatement(this, sql);
}
|
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public PreparedStatement prepareStatement(String sql,
String[] columnNames) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) throws SQLException {
checkOpen();
return new TesterPreparedStatement(this, sql, resultSetType, resultSetConcurrency);
}
|
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public void rollback() throws SQLException {
checkOpen();
if (isReadOnly()) {
throw new SQLException("Cannot rollback a readonly connection");
}
}
|
public void rollback(Savepoint savepoint) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public void setAutoCommit(boolean autoCommit) throws SQLException {
checkOpen();
_autoCommit = autoCommit;
}
|
public void setCatalog(String catalog) throws SQLException {
checkOpen();
_catalog = catalog;
}
|
public void setFailure(Exception failure) {
this.failure = failure;
}
|
public void setHoldability(int holdability) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public void setReadOnly(boolean readOnly) throws SQLException {
checkOpen();
_readOnly = readOnly;
}
|
public Savepoint setSavepoint() throws SQLException {
throw new SQLException("Not implemented.");
}
|
public Savepoint setSavepoint(String name) throws SQLException {
throw new SQLException("Not implemented.");
}
|
public void setTransactionIsolation(int level) throws SQLException {
checkOpen();
_transactionIsolation = level;
}
|
public void setTypeMap(Map map) throws SQLException {
checkOpen();
_typeMap = map;
}
|
public void setWarnings(SQLWarning warning) {
this.warnings = warning;
}
|