org.apache.commons.dbcp
クラス DelegatingStatement

java.lang.Object
  拡張org.apache.commons.dbcp.AbandonedTrace
      拡張org.apache.commons.dbcp.DelegatingStatement
すべての実装インタフェース:
Statement

public class DelegatingStatement
extends AbandonedTrace
implements Statement

基盤となる Statement の委譲を行う実装です。

Statement インターフェイスの持つ全てのメソッドは、この コンストラクタにて渡された Statement がアクティブかどうかをチェックして Statement の対応するメソッドを単純にコールします。

Statement の追跡とStatement を生成したコードのログを行うために AbandonedTrace を継承します。 Statement の追跡を行うことにより、この Statement を生成した Connection がクローズされる際に、確実にこの Connection がオープンした全ての Statement をクローズすることができるようになります。

作成者:
Rodney Waldhoff (rwaldhof@us.britannica.com), Glenn L. Nielsen, James House (james@interobjective.com)
翻訳者:
日置 聡

フィールドの概要
protected  boolean _closed
           
protected  DelegatingConnection _conn
          この Statement を生成したコネクション。
protected  Statement _stmt
          処理の委譲先です。
 
インタフェース java.sql.Statement から継承したフィールド
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
コンストラクタの概要
DelegatingStatement(DelegatingConnection c, Statement s)
          Statement 、生成したコネクション、生成したコードをトレースする Statement のラッパーを生成します。
 
メソッドの概要
protected  void activate()
           
 void addBatch(String sql)
           
 void cancel()
           
protected  void checkOpen()
           
 void clearBatch()
           
 void clearWarnings()
           
 void close()
          この DelegatingStatement をクローズし、明示的にクローズされていない全ての ResultSet をクローズします。
 boolean execute(String sql)
           
 int[] executeBatch()
           
 ResultSet executeQuery(String sql)
           
 int executeUpdate(String sql)
           
 Connection getConnection()
           
 Statement getDelegate()
          内部に保持する Statement を返します。
 int getFetchDirection()
           
 int getFetchSize()
           
 Statement getInnermostDelegate()
          内部に保持する StatementDelegatingStatement でない場合にはその Statement を返し、それ以外の場合には再帰的に getDelegate() をコールします。
 int getMaxFieldSize()
           
 int getMaxRows()
           
 boolean getMoreResults()
           
 int getQueryTimeout()
           
 ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetType()
           
 int getUpdateCount()
           
 SQLWarning getWarnings()
           
protected  void passivate()
           
 void setCursorName(String name)
           
 void setDelegate(Statement s)
          処理の委託先となる Statement を設定します。
 void setEscapeProcessing(boolean enable)
           
 void setFetchDirection(int direction)
           
 void setFetchSize(int rows)
           
 void setMaxFieldSize(int max)
           
 void setMaxRows(int max)
           
 void setQueryTimeout(int seconds)
           
 
クラス org.apache.commons.dbcp.AbandonedTrace から継承したメソッド
addTrace, clearTrace, getConfig, getLastUsed, getTrace, printStackTrace, removeTrace, setLastUsed, setLastUsed, setStackTrace
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース java.sql.Statement から継承したメソッド
execute, execute, execute, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getMoreResults, getResultSetHoldability
 

フィールドの詳細

_closed

protected boolean _closed

_conn

protected DelegatingConnection _conn
この Statement を生成したコネクション。


_stmt

protected Statement _stmt
処理の委譲先です。

コンストラクタの詳細

DelegatingStatement

public DelegatingStatement(DelegatingConnection c,
                           Statement s)
Statement 、生成したコネクション、生成したコードをトレースする Statement のラッパーを生成します。

パラメータ:
s - the 全ての処理の委託先となる Statement
c - このステートメントを生成した DelegatingConnection
メソッドの詳細

activate

protected void activate()

addBatch

public void addBatch(String sql)
              throws SQLException
定義:
インタフェース Statement 内の addBatch
例外:
SQLException

cancel

public void cancel()
            throws SQLException
定義:
インタフェース Statement 内の cancel
例外:
SQLException

checkOpen

protected void checkOpen()
                  throws SQLException
例外:
SQLException

clearBatch

public void clearBatch()
                throws SQLException
定義:
インタフェース Statement 内の clearBatch
例外:
SQLException

clearWarnings

public void clearWarnings()
                   throws SQLException
定義:
インタフェース Statement 内の clearWarnings
例外:
SQLException

close

public void close()
           throws SQLException
この DelegatingStatement をクローズし、明示的にクローズされていない全ての ResultSet をクローズします。

定義:
インタフェース Statement 内の close
例外:
SQLException

execute

public boolean execute(String sql)
                throws SQLException
定義:
インタフェース Statement 内の execute
例外:
SQLException

executeBatch

public int[] executeBatch()
                   throws SQLException
定義:
インタフェース Statement 内の executeBatch
例外:
SQLException

executeQuery

public ResultSet executeQuery(String sql)
                       throws SQLException
定義:
インタフェース Statement 内の executeQuery
例外:
SQLException

executeUpdate

public int executeUpdate(String sql)
                  throws SQLException
定義:
インタフェース Statement 内の executeUpdate
例外:
SQLException

getConnection

public Connection getConnection()
                         throws SQLException
定義:
インタフェース Statement 内の getConnection
例外:
SQLException

getDelegate

public Statement getDelegate()
内部に保持する Statement を返します。

戻り値:
内部に保持する Statement

getFetchDirection

public int getFetchDirection()
                      throws SQLException
定義:
インタフェース Statement 内の getFetchDirection
例外:
SQLException

getFetchSize

public int getFetchSize()
                 throws SQLException
定義:
インタフェース Statement 内の getFetchSize
例外:
SQLException

getInnermostDelegate

public Statement getInnermostDelegate()
内部に保持する StatementDelegatingStatement でない場合にはその Statement を返し、それ以外の場合には再帰的に getDelegate() をコールします。

従ってこのメソッドは DelegatingStatement ではない根本の処理の委託先となる Statement を返し、 DelegatingStatement の連鎖の中に処理の委託先が見つからない場合には null を返します。

このメソッドはネストした DelegatingStatement から 本来の Statement を取得したい場合に有用です。


getMaxFieldSize

public int getMaxFieldSize()
                    throws SQLException
定義:
インタフェース Statement 内の getMaxFieldSize
例外:
SQLException

getMaxRows

public int getMaxRows()
               throws SQLException
定義:
インタフェース Statement 内の getMaxRows
例外:
SQLException

getMoreResults

public boolean getMoreResults()
                       throws SQLException
定義:
インタフェース Statement 内の getMoreResults
例外:
SQLException

getQueryTimeout

public int getQueryTimeout()
                    throws SQLException
定義:
インタフェース Statement 内の getQueryTimeout
例外:
SQLException

getResultSet

public ResultSet getResultSet()
                       throws SQLException
定義:
インタフェース Statement 内の getResultSet
例外:
SQLException

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws SQLException
定義:
インタフェース Statement 内の getResultSetConcurrency
例外:
SQLException

getResultSetType

public int getResultSetType()
                     throws SQLException
定義:
インタフェース Statement 内の getResultSetType
例外:
SQLException

getUpdateCount

public int getUpdateCount()
                   throws SQLException
定義:
インタフェース Statement 内の getUpdateCount
例外:
SQLException

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
定義:
インタフェース Statement 内の getWarnings
例外:
SQLException

passivate

protected void passivate()
                  throws SQLException
例外:
SQLException

setCursorName

public void setCursorName(String name)
                   throws SQLException
定義:
インタフェース Statement 内の setCursorName
例外:
SQLException

setDelegate

public void setDelegate(Statement s)
処理の委託先となる Statement を設定します。


setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws SQLException
定義:
インタフェース Statement 内の setEscapeProcessing
例外:
SQLException

setFetchDirection

public void setFetchDirection(int direction)
                       throws SQLException
定義:
インタフェース Statement 内の setFetchDirection
例外:
SQLException

setFetchSize

public void setFetchSize(int rows)
                  throws SQLException
定義:
インタフェース Statement 内の setFetchSize
例外:
SQLException

setMaxFieldSize

public void setMaxFieldSize(int max)
                     throws SQLException
定義:
インタフェース Statement 内の setMaxFieldSize
例外:
SQLException

setMaxRows

public void setMaxRows(int max)
                throws SQLException
定義:
インタフェース Statement 内の setMaxRows
例外:
SQLException

setQueryTimeout

public void setQueryTimeout(int seconds)
                     throws SQLException
定義:
インタフェース Statement 内の setQueryTimeout
例外:
SQLException


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation