|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsnaq.db.CachedStatement
public class CachedStatement
Statement wrapper that provides methods for caching support.
| Field Summary | |
|---|---|
protected boolean |
cacheable
Flag indicating whether the statement can be cached. |
protected boolean |
checking
Flag indicating a temporary "checking" status (used internally). |
protected boolean |
closing
Flag indicating whether the connection is in the process of being closed. |
protected static String |
MSG_STATEMENT_CLOSED
Exception message for trying to used a closed statement. |
protected boolean |
open
Flag indicating whether the connection is open. |
protected Statement |
st
Delegate Statement instance. |
| Fields inherited from interface java.sql.Statement |
|---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
| Constructor Summary | |
|---|---|
CachedStatement(Statement st)
Creates a new CachedStatement instance, using the supplied Statement. |
|
| Method Summary | ||
|---|---|---|
void |
addBatch(String sql)
|
|
void |
cancel()
|
|
void |
clearBatch()
|
|
void |
clearWarnings()
|
|
void |
close()
Overridden to provide caching support. |
|
boolean |
execute(String sql)
|
|
boolean |
execute(String sql,
int autoGeneratedKeys)
|
|
boolean |
execute(String sql,
int[] columnIndexes)
|
|
boolean |
execute(String sql,
String[] columnNames)
|
|
int[] |
executeBatch()
|
|
ResultSet |
executeQuery(String sql)
|
|
int |
executeUpdate(String sql)
|
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
|
|
int |
executeUpdate(String sql,
int[] columnIndexes)
|
|
int |
executeUpdate(String sql,
String[] columnNames)
|
|
Connection |
getConnection()
|
|
int |
getFetchDirection()
|
|
int |
getFetchSize()
|
|
ResultSet |
getGeneratedKeys()
|
|
int |
getMaxFieldSize()
|
|
int |
getMaxRows()
|
|
boolean |
getMoreResults()
|
|
boolean |
getMoreResults(int current)
|
|
protected String |
getParametersString()
Returns a string descriptions of the ResultSet parameters. |
|
int |
getQueryTimeout()
|
|
ResultSet |
getResultSet()
|
|
int |
getResultSetConcurrency()
|
|
int |
getResultSetHoldability()
|
|
int |
getResultSetType()
|
|
int |
getUpdateCount()
|
|
SQLWarning |
getWarnings()
|
|
boolean |
isClosed()
|
|
boolean |
isPoolable()
Returns whether this statement is poolable. |
|
boolean |
isWrapperFor(Class<?> iface)
|
|
void |
recycle()
|
|
void |
release()
Overridden to provide caching support. |
|
void |
setCursorName(String name)
|
|
void |
setEscapeProcessing(boolean enable)
|
|
void |
setFetchDirection(int direction)
|
|
void |
setFetchSize(int rows)
|
|
void |
setMaxFieldSize(int max)
|
|
void |
setMaxRows(int max)
|
|
void |
setPoolable(boolean poolable)
Sets whether this statement should be considered poolable. |
|
void |
setQueryTimeout(int seconds)
|
|
|
unwrap(Class<T> iface)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String MSG_STATEMENT_CLOSED
protected Statement st
Statement instance.
protected boolean open
protected boolean closing
protected boolean checking
protected boolean cacheable
| Constructor Detail |
|---|
public CachedStatement(Statement st)
CachedStatement instance, using the supplied Statement.
st - Statement instance to which database calls should be delegated| Method Detail |
|---|
protected String getParametersString()
ResultSet parameters.
public void recycle()
throws SQLException
SQLException
public void close()
throws SQLException
close in interface StatementSQLException
public void release()
throws SQLException
SQLException
public ResultSet executeQuery(String sql)
throws SQLException
executeQuery in interface StatementSQLException
public int executeUpdate(String sql)
throws SQLException
executeUpdate in interface StatementSQLException
public int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLException
public void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface StatementSQLException
public int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLException
public void setMaxRows(int max)
throws SQLException
setMaxRows in interface StatementSQLException
public void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface StatementSQLException
public int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLException
public void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface StatementSQLException
public void cancel()
throws SQLException
cancel in interface StatementSQLException
public SQLWarning getWarnings()
throws SQLException
getWarnings in interface StatementSQLException
public void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLException
public void setCursorName(String name)
throws SQLException
setCursorName in interface StatementSQLException
public boolean execute(String sql)
throws SQLException
execute in interface StatementSQLException
public ResultSet getResultSet()
throws SQLException
getResultSet in interface StatementSQLException
public int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLException
public boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLException
public void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface StatementSQLException
public int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLException
public void setFetchSize(int rows)
throws SQLException
setFetchSize in interface StatementSQLException
public int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLException
public int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLException
public int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLException
public void addBatch(String sql)
throws SQLException
addBatch in interface StatementSQLException
public void clearBatch()
throws SQLException
clearBatch in interface StatementSQLException
public int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLException
public Connection getConnection()
throws SQLException
getConnection in interface StatementSQLException
public boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface StatementSQLException
public ResultSet getGeneratedKeys()
throws SQLException
getGeneratedKeys in interface StatementSQLException
public int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
executeUpdate in interface StatementSQLException
public int executeUpdate(String sql,
int[] columnIndexes)
throws SQLException
executeUpdate in interface StatementSQLException
public int executeUpdate(String sql,
String[] columnNames)
throws SQLException
executeUpdate in interface StatementSQLException
public boolean execute(String sql,
int autoGeneratedKeys)
throws SQLException
execute in interface StatementSQLException
public boolean execute(String sql,
int[] columnIndexes)
throws SQLException
execute in interface StatementSQLException
public boolean execute(String sql,
String[] columnNames)
throws SQLException
execute in interface StatementSQLException
public int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLException
public boolean isWrapperFor(Class<?> iface)
throws SQLException
isWrapperFor in interface WrapperSQLException
public <T> T unwrap(Class<T> iface)
throws SQLException
unwrap in interface WrapperSQLException
public boolean isClosed()
throws SQLException
isClosed in interface StatementSQLException
public void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface Statementpoolable - flag indicating desired poolability
SQLException - if the request cannot be fulfilled
public boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||