|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.module.database.MultiStatement
public class MultiStatement
MultiStatement is a wrapper class for a callable Statement obtained by a MultiConnection object. The sole function of this class is to log the sql statement passed to it using the MultiConnection that called it - all calls are then passed to the Statement object passed to the constructor.
| Field Summary | |
|---|---|
(package private) MultiConnection |
parent
The connection that created this statement. |
| 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 | |
|---|---|
MultiStatement(MultiConnection parent,
Statement s)
|
|
| Method Summary | ||
|---|---|---|
void |
addBatch(String sql)
|
|
void |
cancel()
|
|
protected Statement |
checkAfterException()
Tries to fix the parent connection, if it proves to be broken. |
|
void |
clearBatch()
|
|
void |
clearWarnings()
|
|
void |
close()
|
|
boolean |
execute(String sql)
|
|
boolean |
execute(String sql,
int autoGeneratedKeys)
Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. |
|
boolean |
execute(String sql,
int[] columnIndexes)
Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
|
boolean |
execute(String sql,
String[] columnNames)
Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
|
int[] |
executeBatch()
|
|
ResultSet |
executeQuery(String sql)
|
|
int |
executeUpdate(String sql)
|
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. |
|
int |
executeUpdate(String sql,
int[] columnIndexes)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
|
int |
executeUpdate(String sql,
String[] columnNames)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
|
Connection |
getConnection()
|
|
int |
getFetchDirection()
|
|
int |
getFetchSize()
|
|
ResultSet |
getGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this Statement object. |
|
int |
getMaxFieldSize()
|
|
int |
getMaxRows()
|
|
boolean |
getMoreResults()
|
|
boolean |
getMoreResults(int current)
Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object. |
|
int |
getQueryTimeout()
|
|
ResultSet |
getResultSet()
|
|
int |
getResultSetConcurrency()
|
|
int |
getResultSetHoldability()
Retrieves the result set holdability for ResultSet objects generated by this Statement object. |
|
int |
getResultSetType()
|
|
int |
getUpdateCount()
|
|
SQLWarning |
getWarnings()
|
|
boolean |
isClosed()
|
|
boolean |
isPoolable()
|
|
boolean |
isWrapperFor(Class<?> iface)
|
|
void |
setCursorName(String name)
|
|
void |
setEscapeProcessing(boolean enable)
|
|
void |
setFetchDirection(int dir)
|
|
void |
setFetchSize(int i)
|
|
void |
setMaxFieldSize(int max)
|
|
void |
setMaxRows(int max)
|
|
void |
setPoolable(boolean p)
|
|
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 |
|---|
MultiConnection parent
| Constructor Detail |
|---|
MultiStatement(MultiConnection parent,
Statement s)
| Method Detail |
|---|
public int executeUpdate(String sql)
throws SQLException
executeUpdate in interface StatementSQLException
public void close()
throws SQLException
close 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 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 setCursorName(String name)
throws SQLException
setCursorName in interface StatementSQLException
protected Statement checkAfterException()
throws SQLException
public ResultSet executeQuery(String sql)
throws SQLException
executeQuery in interface StatementSQLException
public int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLException
public void setFetchDirection(int dir)
throws SQLException
setFetchDirection in interface StatementSQLException
public int getFetchDirection()
throws SQLException
getFetchDirection 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 Connection getConnection()
throws SQLException
getConnection in interface StatementSQLException
public int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLException
public void setFetchSize(int i)
throws SQLException
setFetchSize in interface StatementSQLException
public boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface Statementcurrent - one of CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS
SQLException
public ResultSet getGeneratedKeys()
throws SQLException
getGeneratedKeys in interface StatementSQLException
public int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
executeUpdate in interface Statementsql - must be an SQL INSERT, UPDATE or DELETE statement or an SQL statement that returns nothingautoGeneratedKeys - a flag indicating whether auto-generated keys should be made available for retrieval
SQLException
public int executeUpdate(String sql,
int[] columnIndexes)
throws SQLException
executeUpdate in interface Statementsql - must be an SQL INSERT, UPDATE or DELETE statement or an SQL statement that returns nothingcolumnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row
SQLException
public int executeUpdate(String sql,
String[] columnNames)
throws SQLException
executeUpdate in interface Statementsql - must be an SQL INSERT, UPDATE or DELETE statement or an SQL statement that returns nothingcolumnNames - - an array of the names of the columns that should be returned from the inserted row
SQLException
public boolean execute(String sql,
int autoGeneratedKeys)
throws SQLException
execute in interface Statementsql - any SQL statementautoGeneratedKeys - a flag indicating whether auto-generated keys should be made available for retrieval
SQLException
public boolean execute(String sql,
int[] columnIndexes)
throws SQLException
execute in interface Statementsql - any SQL statementcolumnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row
SQLException
public boolean execute(String sql,
String[] columnNames)
throws SQLException
execute in interface Statementsql - any SQL statementcolumnNames - - an array of the names of the columns that should be returned from the inserted row
SQLException
public int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLException
public boolean isClosed()
throws SQLException
isClosed in interface StatementSQLException
public void setPoolable(boolean p)
throws SQLException
setPoolable in interface StatementSQLException
public boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic <T> T unwrap(Class<T> iface)
unwrap in interface Wrapperpublic boolean isWrapperFor(Class<?> iface)
isWrapperFor in interface Wrapper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||