![]() |
Qore jni Module 2.3.1
|
Java wrapper for the Qore::SQL::AbstractSQLStatement class in Qore. More...
Public Member Methods | |
AbstractSQLStatement (QoreObject ds) | |
creates the object | |
void | prepare (String sql, Object... args) throws Throwable |
Saves an SQL statement that will be prepared and executed later, along with optional arguments. More... | |
void | prepareRaw (String sql) throws Throwable |
Saves an SQL statement that will be prepared and executed later. More... | |
void | bind (Object... args) throws Throwable |
Binds placeholder buffer specifications and values to buffers defined in prepare() More... | |
void | bindArgs (Object[] vargs) throws Throwable |
Binds placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in prepare() More... | |
void | bindPlaceholders (Object... args) throws Throwable |
Binds placeholder buffer specifications to buffers defined in prepare() More... | |
void | bindPlaceholdersArgs (Object[] vargs) throws Throwable |
Binds placeholder buffer specifications given as a list in the single argument to the method to buffers defined in prepare() More... | |
void | bindValues (Object... args) throws Throwable |
Binds values to value buffer specifications to buffers defined in prepare() More... | |
void | bindValuesArgs (Object[] vargs) throws Throwable |
Binds values to value buffer specifications given as a list in the single argument to the method to value buffers defined in prepare() More... | |
void | exec (Object... args) throws Throwable |
Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values to buffers defined in prepare() before executing the statement. More... | |
void | execArgs (Object[] vargs) throws Throwable |
Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in prepare() More... | |
int | affectedRows () throws Throwable |
Returns the number of rows affected by the last call to exec() More... | |
HashMap< String, Object > | getOutput () throws Throwable |
Retrieves output buffers as a hash; result sets will be returned as hashes of lists. More... | |
HashMap< String, Object > | getOutputRows () throws Throwable |
Retrieves output buffers as a hash; result sets will be returned as lists of hashes. More... | |
void | define () throws Throwable |
Performs an explicit define operation on the SQLStatement. More... | |
void | close () throws Throwable |
Closes the statement if it is open, however this method does not release the connection or transaction lock. More... | |
void | commit () throws Throwable |
Commits the transaction, releases the connection or the transaction lock according to the object used in the constructor and closes the statement. More... | |
void | rollback () throws Throwable |
Closes the SQLStatement, performs a transaction rollback, and releases the connection or the transaction lock according to the object used in the constructor, and closes the statement. More... | |
void | beginTransaction () throws Throwable |
Manually starts a transaction and allocates a connection or grabs the transaction lock according to the object used in the constructor. More... | |
boolean | next () throws Throwable |
Increments the row pointer when retrieving rows from a select statement; returns true if there is a row to retrieve, false if not. More... | |
boolean | valid () throws Throwable |
returns true if the object is currently pointing at a valid element, false if not (use when iterating with next()) More... | |
HashMap< String, Object > | fetchRow () throws Throwable |
Retrieves the current row as a Map<String, Object> where the keys are the column names and the values are the column values. More... | |
HashMap< String, Object > | getValue () throws Throwable |
Retrieves the current row as a Map<String, Object> where the keys are the column names and the values are the column values. More... | |
HashMap< String, Object >[] | fetchRows (int rows) throws Throwable |
Retrieves a block of rows as a list of hashes with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call next() More... | |
HashMap< String, Object >[] | fetchRows () throws Throwable |
Retrieves all available rows as a list of hashes; automatically advances the row pointer; with this call it is not necessary to call next() More... | |
HashMap< String, Object > | fetchColumns (int rows) throws Throwable |
Retrieves a block of rows as a Map<String, Object> of lists with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call next(). More... | |
HashMap< String, Object > | fetchColumns () throws Throwable |
Retrieves all available rows as a Map<String, Object> of lists; automatically advances the row pointer; with this call it is not necessary to call next(). More... | |
HashMap< String, Object > | describe () throws Throwable |
Describes columns in the statement result. More... | |
String | getSQL () throws Throwable |
Returns the current SQL string set with the call to prepare() or prepareRaw() or void if no SQL has been set. More... | |
boolean | active () throws Throwable |
Returns true if the object is currently active and has a connection or transaction lock allocated to it, or false if not. More... | |
boolean | currentThreadInTransaction () throws Throwable |
Returns true if the current thread is in a transaction (i.e. holds the transaction lock), false if not. More... | |
![]() | |
QoreObjectWrapper (QoreObject obj) | |
creates the wrapper object with the Qore object | |
void | release () |
releases the Qore object; do not call any further methods on the object after this call | |
QoreObject | getQoreObject () |
returns the Qore object | |
String | className () |
returns the class name for the Qore object | |
boolean | instanceOf (String class_name) |
returns true if the object is an instance of the given class | |
Additional Inherited Members | |
![]() | |
QoreObject | obj |
the wrapper Qore object | |
Java wrapper for the Qore::SQL::AbstractSQLStatement class in Qore.
import qore.Qore.SQL.AbstractSQLStatement;
|
inline |
Returns true if the object is currently active and has a connection or transaction lock allocated to it, or false if not.
|
inline |
Returns the number of rows affected by the last call to exec()
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Manually starts a transaction and allocates a connection or grabs the transaction lock according to the object used in the constructor.
|
inline |
Binds placeholder buffer specifications and values to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
Any arguments previously bound will be released when this call is made.
args | Arguments to placeholder specifications (if required by the underlying DBI driver) and bind by value arguments |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Binds placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
Any arguments previously bound will be released when this call is made.
vargs | Arguments to placeholder specifications (if required by the underlying DBI driver) and bind by value arguments |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Binds placeholder buffer specifications to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method. Only placeholder buffer specifications will be processed; value buffer specifications will be skipped by this method.
Any buffer specifications previously defined will be released when this call is made.
args | Arguments to placeholder specifications (if required by the underlying DBI driver) |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Binds placeholder buffer specifications given as a list in the single argument to the method to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method. Only placeholder buffer specifications will be processed; value buffer specifications will be skipped by this method.
Any buffer specifications previously defined will be released when this call is made.
vargs | Arguments to placeholder specifications (if required by the underlying DBI driver) |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Binds values to value buffer specifications to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
Any values previously bound will be released when this call is made.
args | Arguments to bind by value arguments |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Binds values to value buffer specifications given as a list in the single argument to the method to value buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
Any values previously bound will be released when this call is made.
vargs | Arguments to bind by value arguments |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() |
|
inline |
Closes the statement if it is open, however this method does not release the connection or transaction lock.
|
inline |
Commits the transaction, releases the connection or the transaction lock according to the object used in the constructor and closes the statement.
|
inline |
Returns true if the current thread is in a transaction (i.e. holds the transaction lock), false if not.
|
inline |
Performs an explicit define operation on the SQLStatement.
It is not encessary to call this method manually; define operations are implicitly executed when needed when retrieving values from a select statement
|
inline |
Describes columns in the statement result.
"name"
: (string) the column name"type"
: (integer) the column type code (Qore type code)"maxsize"
: (integer) the maximum size of the column"native_type"
: (string) the database-specific name of the type"internal_id"
: (integer) the database-specific type code of the type
|
inline |
Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values to buffers defined in prepare() before executing the statement.
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Optional arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
If bind arguments are provided, any arguments previously bound will be released when this call is made.
After calling this method to execute the statement, to retrieve information about the call or output values bound in the call, call affectedRows(), getOutput(), or getOutputRows() as needed.
To retrieve rows from a select statement call either next() and fetchRow(), or fetchRows() or fetchColumns() as needed.
args | Optional arguments to placeholder specifications (if required by the underlying DBI driver) and bind by value arguments can be given in the call to the method; if present, arguments are bound before the statement is executed |
SQLSTATEMENT-ERROR | No SQL has been set with prepare(); the SQLStatement uses a DatasourcePool an the statement was prepared on another connection |
|
inline |
Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in prepare()
If the statement has not previously been prepared with the DB API, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a DatasourcePool object or the transaction lock to be grabbed with a Datasource object, depending on the argument to constructor.
Optional arguments to buffer specifications must be given in the same order as declared in the string given to the prepare() method.
If bind arguments are provided, any arguments previously bound will be released when this call is made.
After calling this method to execute the statement, to retrieve information about the call or output values bound in the call, call affectedRows(), getOutput(), or getOutputRows() as needed.
To retrieve rows from a select statement call either next() and fetchRow(), or fetchRows() or fetchColumns() as needed.
vargs | Optional arguments to placeholder specifications (if required by the underlying DBI driver) and bind by value arguments can be given in the call to the method; if present, arguments are bound before the statement is executed |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw(); the SQLStatement uses a DatasourcePool an the statement was prepared on another connection |
|
inline |
Retrieves all available rows as a Map<String, Object> of lists; automatically advances the row pointer; with this call it is not necessary to call next().
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves a block of rows as a Map<String, Object> of lists with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call next().
If the argument passed is omitted or less than or equal to zero, then all available rows from the current row position are retrieved, also if fewer rows are available than requested then only the rows available are retrieved.
rows | The maximum number of rows to retrieve, if this argument is omitted, negative, or equal to zero, then all available rows from the current row position are retrieved |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves the current row as a Map<String, Object> where the keys are the column names and the values are the column values.
Use with next() to iterate through the results of a select statement one row at a time
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves all available rows as a list of hashes; automatically advances the row pointer; with this call it is not necessary to call next()
If no more rows are available then an empty list is returned.
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves a block of rows as a list of hashes with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call next()
If the argument passed is omitted or less than or equal to zero, then all available rows from the current row position are retrieved, also if fewer rows are available than requested then only the rows available are retrieved.
If no more rows are available then an empty list is returned.
rows | The maximum number of rows to retrieve, if this argument is omitted, negative, or equal to zero, then all available rows from the current row position are retrieved |
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves output buffers as a hash; result sets will be returned as hashes of lists.
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Retrieves output buffers as a hash; result sets will be returned as lists of hashes.
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Returns the current SQL string set with the call to prepare() or prepareRaw() or void if no SQL has been set.
|
inline |
Retrieves the current row as a Map<String, Object> where the keys are the column names and the values are the column values.
Use with next() to iterate through the results of a select statement one row at a time
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Increments the row pointer when retrieving rows from a select statement; returns true if there is a row to retrieve, false if not.
If this method returns true, then call fetchRow() afterwards to retrieve the row
SQLSTATEMENT-ERROR | No SQL has been set with prepare() or prepareRaw() |
|
inline |
Saves an SQL statement that will be prepared and executed later, along with optional arguments.
The statement is actually only prepared when used for the first time, this is so that SQLStatement objects created with DatasourcePool objects use the DatasourcePool more efficiently, as many drivers require the actual DB API prepare call to be made on the same connection as the connection the statement will be executed on as well.
%v
); for a version of this method that does not parse the SQL string for placeholders and bind by value tokens, see prepareRaw().sql | The SQL string to prepare for execution on the DB server |
args | The arguments for any bind placeholders |
|
inline |
Saves an SQL statement that will be prepared and executed later.
The statement is actually only prepared when used for the first time, this is so that SQLStatement objects created with DatasourcePool objects use the DatasourcePool more efficiently, as many drivers require the actual DB API prepare call to be made on the same connection as the connection the statement will be executed on as well.
%v
); for a version of this method that does parse the SQL string for placeholders and bind by value tokens, see prepare().sql | The SQL string to prepare for execution on the DB server |
|
inline |
Closes the SQLStatement, performs a transaction rollback, and releases the connection or the transaction lock according to the object used in the constructor, and closes the statement.
|
inline |
returns true if the object is currently pointing at a valid element, false if not (use when iterating with next())