package org.enhydra.jdbc.core;
import org.enhydra.jdbc.util.JdbcUtil;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
public abstract class CoreStatement extends JdbcUtil implements Statement {
protected Statement statement;
public void addBatch(String s) throws SQLException {
try {
statement.addBatch(s);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void cancel() throws SQLException {
try {
statement.cancel();
} catch (SQLException e) {
catchInvoke(e);
}
}
public void clearBatch() throws SQLException {
try {
statement.clearBatch();
} catch (SQLException e) {
catchInvoke(e);
}
}
public void clearWarnings() throws SQLException {
try {
statement.clearWarnings();
} catch (SQLException e) {
catchInvoke(e);
}
}
public void close() throws SQLException {
if (statement != null) {
statement.close();
}
}
public boolean execute(String s) throws SQLException {
try {
return statement.execute(s);
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public int[] executeBatch() throws SQLException {
try {
return statement.executeBatch();
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public ResultSet executeQuery(String s) throws SQLException {
try {
return statement.executeQuery(s);
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public int executeUpdate(String s) throws SQLException {
try {
return statement.executeUpdate(s);
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public Connection getConnection() throws SQLException {
try {
return statement.getConnection();
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public int getFetchDirection() throws SQLException {
try {
return statement.getFetchDirection();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int getFetchSize() throws SQLException {
try {
return statement.getFetchSize();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public ResultSet getGeneratedKeys() throws SQLException {
try {
return statement.getGeneratedKeys();
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public int getMaxFieldSize() throws SQLException {
try {
return statement.getMaxFieldSize();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int getMaxRows() throws SQLException {
try {
return statement.getMaxRows();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public boolean getMoreResults() throws SQLException {
try {
return statement.getMoreResults();
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public int getQueryTimeout() throws SQLException {
try {
return statement.getQueryTimeout();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public ResultSet getResultSet() throws SQLException {
try {
return statement.getResultSet();
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public int getResultSetConcurrency() throws SQLException {
try {
return statement.getResultSetConcurrency();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int getResultSetType() throws SQLException {
try {
return statement.getResultSetType();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int getUpdateCount() throws SQLException {
try {
return statement.getUpdateCount();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public SQLWarning getWarnings() throws SQLException {
try {
return statement.getWarnings();
} catch (SQLException e) {
catchInvoke(e);
}
return null;
}
public void setCursorName(String name) throws SQLException {
try {
statement.setCursorName(name);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setEscapeProcessing(boolean enable) throws SQLException {
try {
statement.setEscapeProcessing(enable);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setFetchDirection(int direction) throws SQLException {
try {
statement.setFetchDirection(direction);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setFetchSize(int rows) throws SQLException {
try {
statement.setFetchSize(rows);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setMaxFieldSize(int max) throws SQLException {
try {
statement.setMaxFieldSize(max);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setMaxRows(int max) throws SQLException {
try {
statement.setMaxRows(max);
} catch (SQLException e) {
catchInvoke(e);
}
}
public void setQueryTimeout(int seconds) throws SQLException {
try {
statement.setQueryTimeout(seconds);
} catch (SQLException e) {
catchInvoke(e);
}
}
public boolean execute(String sql, int autoGeneratedKeys)
throws SQLException {
try {
return statement.execute(sql, autoGeneratedKeys);
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public boolean execute(String sql, int[] columnIndexes)
throws SQLException {
try {
return statement.execute(sql, columnIndexes);
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public boolean execute(String sql, String[] columnNames)
throws SQLException {
try {
return statement.execute(sql, columnNames);
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public int executeUpdate(String sql, int autoGeneratedKeys)
throws SQLException {
try {
return statement.executeUpdate(sql, autoGeneratedKeys);
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int executeUpdate(String sql, int[] columnIndexes)
throws SQLException {
try {
return statement.executeUpdate(sql, columnIndexes);
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public int executeUpdate(String sql, String[] columnNames)
throws SQLException {
try {
return statement.executeUpdate(sql, columnNames);
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
public boolean getMoreResults(int current)
throws SQLException {
try {
return statement.getMoreResults(current);
} catch (SQLException e) {
catchInvoke(e);
}
return false;
}
public int getResultSetHoldability()
throws SQLException {
try {
return statement.getResultSetHoldability();
} catch (SQLException e) {
catchInvoke(e);
}
return 0;
}
abstract public void catchInvoke(SQLException e) throws SQLException;
}