📄 statementadapter.java
字号:
/**
* $RCSfile: StatementAdapter.java,v $
* $Revision: 1.1.1.1 $
* $Date: 2002/09/09 13:51:02 $
*
* Copyright 2001 CoolServlets, Inc. All Rights Reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package com.jivesoftware.forum.database;
import java.sql.*;
/**
* An implementation of the Statement interface that wraps an underlying
* Statement object and performs timings of the database queries. The class
* does not handle batch queries but should generally work otherwise.
*/
public class StatementAdapter implements Statement {
protected Statement stmt;
/**
* Creates a new TimedStatement that wraps <tt>stmt</tt>.
*/
public StatementAdapter(Statement stmt) {
this.stmt = stmt;
}
public boolean getMoreResults(int current) throws SQLException{
return stmt.getMoreResults(current);
}
public ResultSet getGeneratedKeys() throws SQLException{
return stmt.getGeneratedKeys();
}
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException{
return stmt.executeUpdate(sql, autoGeneratedKeys);
}
public int executeUpdate(String sql,int[] columnIndexes) throws SQLException{
return stmt.executeUpdate(sql,columnIndexes);
}
public int executeUpdate(String sql,String[] columnNames) throws SQLException{
return stmt.executeUpdate(sql,columnNames);
}
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException{
return stmt.execute(sql, autoGeneratedKeys);
}
public boolean execute(String sql,int[] columnIndexes) throws SQLException{
return stmt.execute(sql,columnIndexes);
}
public boolean execute(String sql,String[] columnNames) throws SQLException{
return stmt.execute(sql,columnNames);
}
public int getResultSetHoldability() throws SQLException{
return stmt.getResultSetHoldability();
}
public void addBatch(String sql) throws SQLException {
stmt.addBatch(sql);
}
public void cancel() throws SQLException {
stmt.cancel();
}
public void clearBatch() throws SQLException {
stmt.clearBatch();
}
public void clearWarnings() throws SQLException {
stmt.clearWarnings();
}
public void close() throws SQLException {
stmt.close();
}
public boolean execute(String sql) throws SQLException {
return stmt.execute(sql);
}
public int[] executeBatch() throws SQLException {
return stmt.executeBatch();
}
public ResultSet executeQuery(String sql) throws SQLException {
return stmt.executeQuery(sql);
}
public int executeUpdate(String sql) throws SQLException {
return stmt.executeUpdate(sql);
}
public Connection getConnection() throws SQLException {
return stmt.getConnection();
}
public int getFetchDirection() throws SQLException {
return stmt.getFetchDirection();
}
public int getFetchSize() throws SQLException {
return stmt.getFetchSize();
}
public int getMaxFieldSize() throws SQLException {
return stmt.getMaxFieldSize();
}
public int getMaxRows() throws SQLException {
return stmt.getMaxRows();
}
public boolean getMoreResults() throws SQLException {
return stmt.getMoreResults();
}
public int getQueryTimeout() throws SQLException {
return stmt.getQueryTimeout();
}
public ResultSet getResultSet() throws SQLException {
return stmt.getResultSet();
}
public int getResultSetConcurrency() throws SQLException {
return stmt.getResultSetConcurrency();
}
public int getResultSetType() throws SQLException {
return stmt.getResultSetType();
}
public int getUpdateCount() throws SQLException {
return stmt.getUpdateCount();
}
public SQLWarning getWarnings() throws SQLException {
return stmt.getWarnings();
}
public void setCursorName(String name) throws SQLException {
stmt.setCursorName(name);
}
public void setEscapeProcessing(boolean enable) throws SQLException {
stmt.setEscapeProcessing(enable);
}
public void setFetchDirection(int direction) throws SQLException {
stmt.setFetchDirection(direction);
}
public void setFetchSize(int rows) throws SQLException {
stmt.setFetchSize(rows);
}
public void setMaxFieldSize(int max) throws SQLException {
stmt.setMaxFieldSize(max);
}
public void setMaxRows(int max) throws SQLException {
stmt.setMaxRows(max);
}
public void setQueryTimeout(int seconds) throws SQLException {
stmt.setQueryTimeout(seconds);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -