org.apache.commons.dbcp
クラス DelegatingPreparedStatement

java.lang.Object
  拡張org.apache.commons.dbcp.AbandonedTrace
      拡張org.apache.commons.dbcp.DelegatingPreparedStatement
すべての実装インタフェース:
PreparedStatement, Statement
直系の既知のサブクラス:
PoolablePreparedStatement

public class DelegatingPreparedStatement
extends AbandonedTrace
implements PreparedStatement

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

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

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

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

フィールドの概要
protected  boolean _closed
           
protected  DelegatingConnection _conn
          この Statement を生成したコネクション。
protected  PreparedStatement _stmt
          処理の委譲先です。
 
インタフェース java.sql.Statement から継承したフィールド
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
コンストラクタの概要
DelegatingPreparedStatement(DelegatingConnection c, PreparedStatement s)
          Statement 、生成したコネクション、生成したコードをトレースする Statement のラッパーを生成します。
 
メソッドの概要
protected  void activate()
           
 void addBatch()
           
 void addBatch(String sql)
           
 void cancel()
           
protected  void checkOpen()
           
 void clearBatch()
           
 void clearParameters()
           
 void clearWarnings()
           
 void close()
          この DelegatingPreparedStatement をクローズし、明示的にクローズされていない全ての ResultSet をクローズします。
 boolean execute()
           
 boolean execute(String sql)
           
 int[] executeBatch()
           
 ResultSet executeQuery()
           
 ResultSet executeQuery(String sql)
           
 int executeUpdate()
           
 int executeUpdate(String sql)
           
 Connection getConnection()
           
 PreparedStatement getDelegate()
          内部に保持する PreparedStatement を返します。
 int getFetchDirection()
           
 int getFetchSize()
           
 PreparedStatement getInnermostDelegate()
          内部に保持する PreparedStatementDelegatingPreparedStatement でない場合にはその PreparedStatement を返し、それ以外の場合には再帰的に getDelegate() をコールします。
 int getMaxFieldSize()
           
 int getMaxRows()
           
 ResultSetMetaData getMetaData()
           
 boolean getMoreResults()
           
 int getQueryTimeout()
           
 ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetType()
           
 int getUpdateCount()
           
 SQLWarning getWarnings()
           
protected  void passivate()
           
 void setArray(int i, Array x)
           
 void setAsciiStream(int parameterIndex, InputStream x, int length)
           
 void setBigDecimal(int parameterIndex, BigDecimal x)
           
 void setBinaryStream(int parameterIndex, InputStream x, int length)
           
 void setBlob(int i, Blob x)
           
 void setBoolean(int parameterIndex, boolean x)
           
 void setByte(int parameterIndex, byte x)
           
 void setBytes(int parameterIndex, byte[] x)
           
 void setCharacterStream(int parameterIndex, Reader reader, int length)
           
 void setClob(int i, Clob x)
           
 void setCursorName(String name)
           
 void setDate(int parameterIndex, Date x)
           
 void setDate(int parameterIndex, Date x, Calendar cal)
           
 void setDelegate(PreparedStatement s)
          処理の委託先となる PreparedStatement を設定します。
 void setDouble(int parameterIndex, double x)
           
 void setEscapeProcessing(boolean enable)
           
 void setFetchDirection(int direction)
           
 void setFetchSize(int rows)
           
 void setFloat(int parameterIndex, float x)
           
 void setInt(int parameterIndex, int x)
           
 void setLong(int parameterIndex, long x)
           
 void setMaxFieldSize(int max)
           
 void setMaxRows(int max)
           
 void setNull(int parameterIndex, int sqlType)
           
 void setNull(int paramIndex, int sqlType, String typeName)
           
 void setObject(int parameterIndex, Object x)
           
 void setObject(int parameterIndex, Object x, int targetSqlType)
           
 void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
           
 void setQueryTimeout(int seconds)
           
 void setRef(int i, Ref x)
           
 void setShort(int parameterIndex, short x)
           
 void setString(int parameterIndex, String x)
           
 void setTime(int parameterIndex, Time x)
           
 void setTime(int parameterIndex, Time x, Calendar cal)
           
 void setTimestamp(int parameterIndex, Timestamp x)
           
 void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
           
 
クラス 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.PreparedStatement から継承したメソッド
getParameterMetaData, setUnicodeStream, setURL
 
インタフェース java.sql.Statement から継承したメソッド
execute, execute, execute, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getMoreResults, getResultSetHoldability
 

フィールドの詳細

_closed

protected boolean _closed

_conn

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


_stmt

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

コンストラクタの詳細

DelegatingPreparedStatement

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

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

activate

protected void activate()

addBatch

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

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

clearParameters

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

clearWarnings

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

close

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

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

execute

public boolean execute()
                throws SQLException
定義:
インタフェース PreparedStatement 内の execute
例外:
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()
                       throws SQLException
定義:
インタフェース PreparedStatement 内の executeQuery
例外:
SQLException

executeQuery

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

executeUpdate

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

executeUpdate

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

getConnection

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

getDelegate

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

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

getFetchDirection

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

getFetchSize

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

getInnermostDelegate

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

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

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


getMaxFieldSize

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

getMaxRows

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

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
定義:
インタフェース PreparedStatement 内の getMetaData
例外:
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

setArray

public void setArray(int i,
                     Array x)
              throws SQLException
定義:
インタフェース PreparedStatement 内の setArray
例外:
SQLException

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           InputStream x,
                           int length)
                    throws SQLException
定義:
インタフェース PreparedStatement 内の setAsciiStream
例外:
SQLException

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          BigDecimal x)
                   throws SQLException
定義:
インタフェース PreparedStatement 内の setBigDecimal
例外:
SQLException

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            InputStream x,
                            int length)
                     throws SQLException
定義:
インタフェース PreparedStatement 内の setBinaryStream
例外:
SQLException

setBlob

public void setBlob(int i,
                    Blob x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setBlob
例外:
SQLException

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
                throws SQLException
定義:
インタフェース PreparedStatement 内の setBoolean
例外:
SQLException

setByte

public void setByte(int parameterIndex,
                    byte x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setByte
例外:
SQLException

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
              throws SQLException
定義:
インタフェース PreparedStatement 内の setBytes
例外:
SQLException

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               Reader reader,
                               int length)
                        throws SQLException
定義:
インタフェース PreparedStatement 内の setCharacterStream
例外:
SQLException

setClob

public void setClob(int i,
                    Clob x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setClob
例外:
SQLException

setCursorName

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

setDate

public void setDate(int parameterIndex,
                    Date x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setDate
例外:
SQLException

setDate

public void setDate(int parameterIndex,
                    Date x,
                    Calendar cal)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setDate
例外:
SQLException

setDelegate

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


setDouble

public void setDouble(int parameterIndex,
                      double x)
               throws SQLException
定義:
インタフェース PreparedStatement 内の setDouble
例外:
SQLException

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

setFloat

public void setFloat(int parameterIndex,
                     float x)
              throws SQLException
定義:
インタフェース PreparedStatement 内の setFloat
例外:
SQLException

setInt

public void setInt(int parameterIndex,
                   int x)
            throws SQLException
定義:
インタフェース PreparedStatement 内の setInt
例外:
SQLException

setLong

public void setLong(int parameterIndex,
                    long x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setLong
例外:
SQLException

setMaxFieldSize

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

setMaxRows

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

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setNull
例外:
SQLException

setNull

public void setNull(int paramIndex,
                    int sqlType,
                    String typeName)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setNull
例外:
SQLException

setObject

public void setObject(int parameterIndex,
                      Object x)
               throws SQLException
定義:
インタフェース PreparedStatement 内の setObject
例外:
SQLException

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType)
               throws SQLException
定義:
インタフェース PreparedStatement 内の setObject
例外:
SQLException

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType,
                      int scale)
               throws SQLException
定義:
インタフェース PreparedStatement 内の setObject
例外:
SQLException

setQueryTimeout

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

setRef

public void setRef(int i,
                   Ref x)
            throws SQLException
定義:
インタフェース PreparedStatement 内の setRef
例外:
SQLException

setShort

public void setShort(int parameterIndex,
                     short x)
              throws SQLException
定義:
インタフェース PreparedStatement 内の setShort
例外:
SQLException

setString

public void setString(int parameterIndex,
                      String x)
               throws SQLException
定義:
インタフェース PreparedStatement 内の setString
例外:
SQLException

setTime

public void setTime(int parameterIndex,
                    Time x)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setTime
例外:
SQLException

setTime

public void setTime(int parameterIndex,
                    Time x,
                    Calendar cal)
             throws SQLException
定義:
インタフェース PreparedStatement 内の setTime
例外:
SQLException

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x)
                  throws SQLException
定義:
インタフェース PreparedStatement 内の setTimestamp
例外:
SQLException

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp x,
                         Calendar cal)
                  throws SQLException
定義:
インタフェース PreparedStatement 内の setTimestamp
例外:
SQLException


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