FileDocCategorySizeDatePackage
StatementWrapper.javaAPI DocExample4175Tue Nov 13 14:23:22 GMT 2001tuning.jdbc

StatementWrapper

public class StatementWrapper extends Object implements Statement

Fields Summary
protected Statement
realStatement
protected ConnectionWrapper
connectionParent
protected String
lastSql
Constructors Summary
public StatementWrapper(Statement statement, ConnectionWrapper parent)

    realStatement = statement;
    connectionParent = parent;
  
Methods Summary
public voidaddBatch(java.lang.String sql)

    realStatement.addBatch(sql);
    lastSql = sql;
  
public voidcancel()

    realStatement.cancel();
  
public voidclearBatch()

    realStatement.clearBatch();
  
public voidclearWarnings()

    realStatement.clearWarnings();
  
public voidclose()

    realStatement.close();
  
public booleanexecute(java.lang.String sql)

    Thread t = Thread.currentThread();
    JDBCLogger.startLogSqlQuery(t, sql);
    boolean b = realStatement.execute(sql);
    JDBCLogger.endLogSqlQuery(t, sql);
    lastSql = sql;
    return b;
  
public int[]executeBatch()

    Thread t = Thread.currentThread();
    JDBCLogger.startLogSqlQuery(t, "batch");
    int[] i = realStatement.executeBatch();
    JDBCLogger.endLogSqlQuery(t, "batch");
    return i;
  
public java.sql.ResultSetexecuteQuery(java.lang.String sql)

    Thread t = Thread.currentThread();
    JDBCLogger.startLogSqlQuery(t, sql);
    ResultSet r = realStatement.executeQuery(sql);
    JDBCLogger.endLogSqlQuery(t, sql);
    lastSql = sql;
    return new ResultSetWrapper(r, this, sql);
  
public intexecuteUpdate(java.lang.String sql)

    Thread t = Thread.currentThread();
    JDBCLogger.startLogSqlQuery(t, sql);
    int i = realStatement.executeUpdate(sql);
    JDBCLogger.endLogSqlQuery(t, sql);
    lastSql = sql;
    return i;
  
public java.sql.ConnectiongetConnection()

    return connectionParent;
  
public intgetFetchDirection()

    return realStatement.getFetchDirection();
  
public intgetFetchSize()

    return realStatement.getFetchSize();
  
public intgetMaxFieldSize()

    return realStatement.getMaxFieldSize();
  
public intgetMaxRows()

    return realStatement.getMaxRows();
  
public booleangetMoreResults()

    return realStatement.getMoreResults();
  
public intgetQueryTimeout()

    return realStatement.getQueryTimeout();
  
public java.sql.ResultSetgetResultSet()

    return new ResultSetWrapper(realStatement.getResultSet(), this, lastSql);
  
public intgetResultSetConcurrency()

    return realStatement.getResultSetConcurrency();
  
public intgetResultSetType()

    return realStatement.getResultSetType();
  
public intgetUpdateCount()

    return realStatement.getUpdateCount();
  
public java.sql.SQLWarninggetWarnings()

    return realStatement.getWarnings();
  
public voidsetCursorName(java.lang.String name)

    realStatement.setCursorName(name);
  
public voidsetEscapeProcessing(boolean enable)

    realStatement.setEscapeProcessing(enable);
  
public voidsetFetchDirection(int direction)

    realStatement.setFetchDirection(direction);
  
public voidsetFetchSize(int rows)

    realStatement.setFetchSize(rows);
  
public voidsetMaxFieldSize(int max)

    realStatement.setMaxFieldSize(max);
  
public voidsetMaxRows(int max)

    realStatement.setMaxRows(max);
  
public voidsetQueryTimeout(int seconds)

    realStatement.setQueryTimeout(seconds);