Command

Represents a SQL statement. This object is only used on the server side.

Methods
boolean canReuse()
Whether the command is already closed (in which case it can be re-used).
boolean canReuse()
Whether the command is already closed (in which case it can be re-used).
Returns:
true if it can be re-used
void cancel()
void cancel()
void checkCanceled()
Check if this command has been canceled, and throw an exception if yes.
void checkCanceled()
Check if this command has been canceled, and throw an exception if yes.
Throws:
DbException - if the statement has been canceled
void close()
void close()
ResultInterface executeQuery(int maxrows, boolean scrollable)
Execute a query and return the result.
ResultInterface executeQuery(int maxrows, boolean scrollable)
Execute a query and return the result. This method prepares everything and calls {@link #query(int)} finally.
Parameters:
maxrows - the maximum number of rows to return
scrollable - if the result set must be scrollable (ignored)
Returns:
the result set
ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest)
ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest)
ResultInterface getMetaData()
ResultInterface getMetaData()
ArrayList getParameters()
Get the list of parameters.
ArrayList getParameters()
Get the list of parameters.
Returns:
the list of parameters
boolean isCacheable()
boolean isCacheable()
boolean isQuery()
Check if this command is a query.
boolean isQuery()
Check if this command is a query.
Returns:
true if it is
boolean isReadOnly()
Check if this command is read only.
boolean isReadOnly()
Check if this command is read only.
Returns:
true if it is
boolean isTransactional()
Check if this command is transactional.
boolean isTransactional()
Check if this command is transactional. If it is not, then it forces the current transaction to commit.
Returns:
true if it is
void prepareJoinBatch()
Prepare join batching.
void prepareJoinBatch()
Prepare join batching.
ResultInterface query(int maxrows)
Execute a query statement, if this is possible.
ResultInterface query(int maxrows)
Execute a query statement, if this is possible.
Parameters:
maxrows - the maximum number of rows returned
Returns:
the local result set
Throws:
DbException - if the command is not a query
ResultInterface queryMeta()
Get an empty result set containing the meta data.
ResultInterface queryMeta()
Get an empty result set containing the meta data.
Returns:
an empty result set
void reuse()
The command is now re-used, therefore reset the canReuse flag, and the parameter values.
void reuse()
The command is now re-used, therefore reset the canReuse flag, and the parameter values.
void setCanReuse(boolean canReuse)
void setCanReuse(boolean canReuse)
void setProgress(int state)
void setProgress(int state)
void start()
Start the stopwatch.
void start()
Start the stopwatch.
void stop()
void stop()
String toString()
String toString()
int update()
Execute an updating statement (for example insert, delete, or update), if this is possible.
int update()
Execute an updating statement (for example insert, delete, or update), if this is possible.
Returns:
the update count
Throws:
DbException - if the command is not an updating statement