A base delegating implementation of
Statement
.
All of the methods from the
Statement
interface
simply check to see that the
Statement
is active,
and call the corresponding method on the "delegate"
provided in my constructor.
Extends AbandonedTrace to implement Statement tracking and
logging of code which created the Statement. Tracking the
Statement ensures that the Connection which created it can
close any open Statement's on Connection close.
addBatch
public void addBatch(String sql)
throws SQLException
cancel
public void cancel()
throws SQLException
clearBatch
public void clearBatch()
throws SQLException
clearWarnings
public void clearWarnings()
throws SQLException
close
public void close()
throws SQLException
Close this DelegatingStatement, and close
any ResultSets that were not explicitly closed.
equals
public boolean equals(Object obj)
execute
public boolean execute(String sql)
throws SQLException
execute
public boolean execute(String sql,
columnIndexes[] )
throws SQLException
execute
public boolean execute(String sql,
columnNames[] )
throws SQLException
execute
public boolean execute(String sql,
int autoGeneratedKeys)
throws SQLException
executeBatch
public int[] executeBatch()
throws SQLException
executeQuery
public ResultSet executeQuery(String sql)
throws SQLException
executeUpdate
public int executeUpdate(String sql)
throws SQLException
executeUpdate
public int executeUpdate(String sql,
columnIndexes[] )
throws SQLException
executeUpdate
public int executeUpdate(String sql,
columnNames[] )
throws SQLException
executeUpdate
public int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
getConnection
public Connection getConnection()
throws SQLException
getDelegate
public Statement getDelegate()
Returns my underlying Statement
.
- my underlying
Statement
.
getInnermostDelegate()
getFetchDirection
public int getFetchDirection()
throws SQLException
getFetchSize
public int getFetchSize()
throws SQLException
getGeneratedKeys
public ResultSet getGeneratedKeys()
throws SQLException
getInnermostDelegate
public Statement getInnermostDelegate()
If my underlying
Statement
is not a
DelegatingStatement, returns it,
otherwise recursively invokes this method on
my delegate.
Hence this method will return the first
delegate that is not a
DelegatingStatement
or
null when no non-
DelegatingStatement
delegate can be found by transversing this chain.
This method is useful when you may have nested
DelegatingStatements, and you want to make
sure to obtain a "genuine"
Statement
.
getDelegate()
getMaxFieldSize
public int getMaxFieldSize()
throws SQLException
getMaxRows
public int getMaxRows()
throws SQLException
getMoreResults
public boolean getMoreResults()
throws SQLException
getMoreResults
public boolean getMoreResults(int current)
throws SQLException
getQueryTimeout
public int getQueryTimeout()
throws SQLException
getResultSet
public ResultSet getResultSet()
throws SQLException
getResultSetConcurrency
public int getResultSetConcurrency()
throws SQLException
getResultSetHoldability
public int getResultSetHoldability()
throws SQLException
getResultSetType
public int getResultSetType()
throws SQLException
getUpdateCount
public int getUpdateCount()
throws SQLException
getWarnings
public SQLWarning getWarnings()
throws SQLException
hashCode
public int hashCode()
setCursorName
public void setCursorName(String name)
throws SQLException
setDelegate
public void setDelegate(Statement s)
Sets my delegate.
setEscapeProcessing
public void setEscapeProcessing(boolean enable)
throws SQLException
setFetchDirection
public void setFetchDirection(int direction)
throws SQLException
setFetchSize
public void setFetchSize(int rows)
throws SQLException
setMaxFieldSize
public void setMaxFieldSize(int max)
throws SQLException
setMaxRows
public void setMaxRows(int max)
throws SQLException
setQueryTimeout
public void setQueryTimeout(int seconds)
throws SQLException