|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.command.Command
public abstract class Command
Represents a SQL statement. This object is only used on the server side.
Field Summary | |
---|---|
protected Session |
session
The session. |
protected long |
startTime
The last start time. |
Method Summary | |
---|---|
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. |
int |
executeUpdate()
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. |
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. |
java.lang.String |
toString()
|
int |
update()
Execute an updating statement, if this is possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.h2.command.CommandInterface |
---|
getCommandType |
Field Detail |
---|
protected final Session session
protected long startTime
Method Detail |
---|
public abstract boolean isTransactional()
public abstract boolean isQuery()
isQuery
in interface CommandInterface
public abstract java.util.ArrayList<? extends ParameterInterface> getParameters()
getParameters
in interface CommandInterface
public 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 returned
DbException
- if the command is not a querypublic final ResultInterface getMetaData()
CommandInterface
getMetaData
in interface CommandInterface
protected void checkCanceled()
DbException
- if the statement has been canceledpublic ResultInterface executeQuery(int maxrows, boolean scrollable)
query(int)
finally.
executeQuery
in interface CommandInterface
maxrows
- the maximum number of rows to returnscrollable
- if the result set must be scrollable (ignored)
public int executeUpdate()
CommandInterface
executeUpdate
in interface CommandInterface
public void close()
CommandInterface
close
in interface CommandInterface
public void cancel()
CommandInterface
cancel
in interface CommandInterface
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isCacheable()
public boolean canReuse()
public void reuse()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |