public abstract class Command extends java.lang.Object implements CommandInterface
| Modifier and Type | Field and Description |
|---|---|
protected Session |
session
The session.
|
protected long |
startTimeNanos
The last start time.
|
ALTER_INDEX_RENAME, ALTER_SCHEMA_RENAME, ALTER_SEQUENCE, ALTER_TABLE_ADD_COLUMN, ALTER_TABLE_ADD_CONSTRAINT_CHECK, ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY, ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL, ALTER_TABLE_ADD_CONSTRAINT_UNIQUE, ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE, ALTER_TABLE_ALTER_COLUMN_DEFAULT, ALTER_TABLE_ALTER_COLUMN_NOT_NULL, ALTER_TABLE_ALTER_COLUMN_NULL, ALTER_TABLE_ALTER_COLUMN_ON_UPDATE, ALTER_TABLE_ALTER_COLUMN_RENAME, ALTER_TABLE_ALTER_COLUMN_SELECTIVITY, ALTER_TABLE_ALTER_COLUMN_VISIBILITY, ALTER_TABLE_DROP_COLUMN, ALTER_TABLE_DROP_CONSTRAINT, ALTER_TABLE_RENAME, ALTER_TABLE_RENAME_CONSTRAINT, ALTER_TABLE_SET_REFERENTIAL_INTEGRITY, ALTER_USER_ADMIN, ALTER_USER_RENAME, ALTER_USER_SET_PASSWORD, ALTER_VIEW, ANALYZE, BACKUP, BEGIN, CALL, CHECKPOINT, CHECKPOINT_SYNC, COMMENT, COMMIT, COMMIT_TRANSACTION, CREATE_AGGREGATE, CREATE_ALIAS, CREATE_CONSTANT, CREATE_DOMAIN, CREATE_INDEX, CREATE_LINKED_TABLE, CREATE_ROLE, CREATE_SCHEMA, CREATE_SEQUENCE, CREATE_SYNONYM, CREATE_TABLE, CREATE_TRIGGER, CREATE_USER, CREATE_VIEW, DEALLOCATE, DELETE, DROP_AGGREGATE, DROP_ALIAS, DROP_ALL_OBJECTS, DROP_CONSTANT, DROP_DOMAIN, DROP_INDEX, DROP_ROLE, DROP_SCHEMA, DROP_SEQUENCE, DROP_SYNONYM, DROP_TABLE, DROP_TRIGGER, DROP_USER, DROP_VIEW, EXECUTE, EXPLAIN, EXPLAIN_ANALYZE, GRANT, INSERT, MERGE, NO_OPERATION, PREPARE, PREPARE_COMMIT, REPLACE, REVOKE, ROLLBACK, ROLLBACK_TO_SAVEPOINT, ROLLBACK_TRANSACTION, RUNSCRIPT, SAVEPOINT, SCRIPT, SELECT, SET, SET_AUTOCOMMIT_FALSE, SET_AUTOCOMMIT_TRUE, SHUTDOWN, SHUTDOWN_COMPACT, SHUTDOWN_DEFRAG, SHUTDOWN_IMMEDIATELY, TRUNCATE_TABLE, UNKNOWN, UPDATE| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the statement if it is still processing.
|
boolean |
canReuse()
Whether the command is already closed (in which case it can be re-used).
|
protected void |
checkCanceled()
Check if this command has been canceled, and throw an exception if yes.
|
void |
close()
Close the statement.
|
ResultInterface |
executeQuery(int maxrows,
boolean scrollable)
Execute a query and return the result.
|
ResultWithGeneratedKeys |
executeUpdate(java.lang.Object generatedKeysRequest)
Execute the statement
|
ResultInterface |
getMetaData()
Get an empty result set containing the meta data of the result.
|
abstract java.util.ArrayList<? extends ParameterInterface> |
getParameters()
Get the list of parameters.
|
boolean |
isCacheable() |
abstract boolean |
isQuery()
Check if this command is a query.
|
abstract boolean |
isReadOnly()
Check if this command is read only.
|
abstract boolean |
isTransactional()
Check if this command is transactional.
|
abstract void |
prepareJoinBatch()
Prepare join batching.
|
ResultInterface |
query(int maxrows)
Execute a query statement, if this is possible.
|
abstract ResultInterface |
queryMeta()
Get an empty result set containing the meta data.
|
void |
reuse()
The command is now re-used, therefore reset the canReuse flag, and the
parameter values.
|
void |
setCanReuse(boolean canReuse) |
void |
stop()
Stop the command execution, release all locks and resources
|
java.lang.String |
toString() |
int |
update()
Execute an updating statement (for example insert, delete, or update), if
this is possible.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCommandTypeprotected final Session session
protected long startTimeNanos
public abstract boolean isTransactional()
public abstract boolean isQuery()
isQuery in interface CommandInterfacepublic abstract void prepareJoinBatch()
public abstract java.util.ArrayList<? extends ParameterInterface> getParameters()
getParameters in interface CommandInterfacepublic abstract boolean isReadOnly()
public abstract ResultInterface queryMeta()
public int update()
DbException - if the command is not an updating statementpublic ResultInterface query(int maxrows)
maxrows - the maximum number of rows returnedDbException - if the command is not a querypublic final ResultInterface getMetaData()
CommandInterfacegetMetaData in interface CommandInterfaceprotected void checkCanceled()
DbException - if the statement has been canceledpublic void stop()
CommandInterfacestop in interface CommandInterfacepublic ResultInterface executeQuery(int maxrows, boolean scrollable)
query(int) finally.executeQuery in interface CommandInterfacemaxrows - the maximum number of rows to returnscrollable - if the result set must be scrollable (ignored)public ResultWithGeneratedKeys executeUpdate(java.lang.Object generatedKeysRequest)
CommandInterfaceexecuteUpdate in interface CommandInterfacegeneratedKeysRequest - false if generated keys are not needed, true if
generated keys should be configured automatically, int[]
to specify column indices to return generated keys from, or
String[] to specify column names to return generated keys
frompublic void close()
CommandInterfaceclose in interface CommandInterfacepublic void cancel()
CommandInterfacecancel in interface CommandInterfacepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isCacheable()
public boolean canReuse()
public void reuse()
public void setCanReuse(boolean canReuse)