Top Description Fields Constructors Methods
org.h2.command

public Class CommandRemote

extends Object
implements CommandInterface
Class Inheritance
All Implemented Interfaces
org.h2.command.CommandInterface, java.lang.AutoCloseable
Imports
java.io.IOException, java.sql.SQLException, .Statement, java.util.ArrayList, org.h2.engine.Constants, .GeneratedKeysMode, .SessionRemote, .SysProperties, org.h2.expression.ParameterInterface, .ParameterRemote, org.h2.message.DbException, .Trace, org.h2.result.BatchResult, .MergedResult, .ResultInterface, .ResultRemote, .ResultWithGeneratedKeys, org.h2.util.Utils, org.h2.value.Transfer, .Value, .ValueLob, .ValueNull

Represents the client-side part of a SQL statement. This class is not used in embedded mode.

Field Summary

Modifier and TypeField and Description
private int
private final int
private final int
private int
private boolean
private final ArrayList<ParameterInterface>
private boolean
private SessionRemote
private final String
private final Trace
private final ArrayList<Transfer>

Constructor Summary

AccessConstructor and Description
public
CommandRemote(SessionRemote session, ArrayList<Transfer> transferList, String sql, int fetchSize)

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.h2.command.CommandInterface.cancel.

Cancel this current statement.

private void
public void
close()

Implements org.h2.command.CommandInterface.close.

Close the statement.

public BatchResult
executeBatchUpdate(ArrayList<Value[]>
batch parameters
batchParameters
,
Object
null or 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 from
generatedKeysRequest
)

Implements org.h2.command.CommandInterface.executeBatchUpdate.

Executes the statement with multiple sets of parameters.

public ResultInterface
executeQuery(long
the maximum number of rows returned
maxRows
,
boolean
if the result set must be scrollable
scrollable
)

Implements org.h2.command.CommandInterface.executeQuery.

Execute the query.

public ResultWithGeneratedKeys
executeUpdate(Object
null or 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 from
generatedKeysRequest
)

Implements org.h2.command.CommandInterface.executeUpdate.

Execute the statement

public int
public ResultInterface
getMetaData()

Implements org.h2.command.CommandInterface.getMetaData.

Get an empty result set containing the meta data of the result.

public ArrayList<ParameterInterface>
getParameters()

Implements org.h2.command.CommandInterface.getParameters.

Get the parameters (if any).

public boolean
isQuery()

Implements org.h2.command.CommandInterface.isQuery.

Check if this is a query.

private void
prepare(SessionRemote s, boolean createParams)

private void
private static void
sendGeneratedKeysRequest(Object generatedKeysRequest, int generatedKeysMode, Transfer transfer)

private void
private void
sendParameters(Transfer transfer, Value[] parameters)

public void
stop(boolean
commit the session if auto-commit is enabled
commitIfAutoCommit
)

Implements org.h2.command.CommandInterface.stop.

Stop the command execution, release all locks and resources.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cmdTypeback to summary
private int cmdType
createdback to summary
private final int created
fetchSizeback to summary
private final int fetchSize
idback to summary
private int id
isQueryback to summary
private boolean isQuery
parametersback to summary
private final ArrayList<ParameterInterface> parameters
readonlyback to summary
private boolean readonly
sessionback to summary
private SessionRemote session
sqlback to summary
private final String sql
traceback to summary
private final Trace trace
transferListback to summary
private final ArrayList<Transfer> transferList

Constructor Detail

CommandRemoteback to summary
public CommandRemote(SessionRemote session, ArrayList<Transfer> transferList, String sql, int fetchSize)

Method Detail

cancelback to summary
public void cancel()

Implements org.h2.command.CommandInterface.cancel.

Cancel this current statement.

Annotations
@Override
checkParametersback to summary
private void checkParameters()
closeback to summary
public void close()

Implements org.h2.command.CommandInterface.close.

Doc from org.h2.command.CommandInterface.close.

Close the statement.

Annotations
@Override
executeBatchUpdateback to summary
public BatchResult executeBatchUpdate(ArrayList<Value[]> batchParameters, Object generatedKeysRequest)

Implements org.h2.command.CommandInterface.executeBatchUpdate.

Doc from org.h2.command.CommandInterface.executeBatchUpdate.

Executes the statement with multiple sets of parameters.

Parameters
batchParameters:ArrayList<Value[]>

batch parameters

generatedKeysRequest:Object

null or 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 from

Returns:BatchResult

result of batch execution

Annotations
@Override
executeQueryback to summary
public ResultInterface executeQuery(long maxRows, boolean scrollable)

Implements org.h2.command.CommandInterface.executeQuery.

Doc from org.h2.command.CommandInterface.executeQuery.

Execute the query.

Parameters
maxRows:long

the maximum number of rows returned

scrollable:boolean

if the result set must be scrollable

Returns:ResultInterface

the result

Annotations
@Override
executeUpdateback to summary
public ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest)

Implements org.h2.command.CommandInterface.executeUpdate.

Doc from org.h2.command.CommandInterface.executeUpdate.

Execute the statement

Parameters
generatedKeysRequest:Object

null or 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 from

Returns:ResultWithGeneratedKeys

the update count and generated keys, if any

Annotations
@Override
getCommandTypeback to summary
public int getCommandType()

Implements org.h2.command.CommandInterface.getCommandType.

Doc from org.h2.command.CommandInterface.getCommandType.

Get command type.

Returns:int

one of the constants above

Annotations
@Override
getMetaDataback to summary
public ResultInterface getMetaData()

Implements org.h2.command.CommandInterface.getMetaData.

Doc from org.h2.command.CommandInterface.getMetaData.

Get an empty result set containing the meta data of the result.

Returns:ResultInterface

the empty result

Annotations
@Override
getParametersback to summary
public ArrayList<ParameterInterface> getParameters()

Implements org.h2.command.CommandInterface.getParameters.

Doc from org.h2.command.CommandInterface.getParameters.

Get the parameters (if any).

Returns:ArrayList<ParameterInterface>

the parameters

Annotations
@Override
isQueryback to summary
public boolean isQuery()

Implements org.h2.command.CommandInterface.isQuery.

Doc from org.h2.command.CommandInterface.isQuery.

Check if this is a query.

Returns:boolean

true if it is a query

Annotations
@Override
prepareback to summary
private void prepare(SessionRemote s, boolean createParams)
prepareIfRequiredback to summary
private void prepareIfRequired()
sendGeneratedKeysRequestback to summary
private static void sendGeneratedKeysRequest(Object generatedKeysRequest, int generatedKeysMode, Transfer transfer) throws IOException
sendParametersback to summary
private void sendParameters(Transfer transfer) throws IOException
sendParametersback to summary
private void sendParameters(Transfer transfer, Value[] parameters) throws IOException
stopback to summary
public void stop(boolean commitIfAutoCommit)

Implements org.h2.command.CommandInterface.stop.

Doc from org.h2.command.CommandInterface.stop.

Stop the command execution, release all locks and resources.

Parameters
commitIfAutoCommit:boolean

commit the session if auto-commit is enabled

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override