Platforms to show: All Mac Windows Linux Cross-Platform

Back to JavaStatementMBS class.

JavaStatementMBS.addBatch(sql as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Adds the given SQL command to the current list of commmands for this Statement object.

The commands in this list can be executed as a batch by calling the method executeBatch.

NOTE: This method is optional.

Parameters:
sql - typically this is a static SQL INSERT or UPDATE statement

JavaStatementMBS.cancel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.

This method can be used by one thread to cancel a statement that is being executed by another thread.

JavaStatementMBS.clearBatch

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Empties this Statement object's current list of SQL commands.

NOTE: This method is optional.

JavaStatementMBS.clearWarnings

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Clears all the warnings reported on this Statement object.

After a call to this method, the method getWarnings will return null until a new warning is reported for this Statement object.

JavaStatementMBS.close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources.
Calling the method close on a Statement object that is already closed has no effect.

Note: A Statement object is automatically closed when it is garbage collected. When a Statement object is closed, its current ResultSet object, if one exists, is also closed.

JavaStatementMBS.CLOSE_ALL_RESULTS as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that all ResultSet objects that have previously been kept open should be closed when calling getMoreResults.

JavaStatementMBS.CLOSE_CURRENT_RESULT as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that the current ResultSet object should be closed when calling getMoreResults.

JavaStatementMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The private constructor.

JavaStatementMBS.EscapeProcessing as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Whether escape processing is on or off.

If escape scanning is on (the default), the driver will do escape substitution before sending the SQL statement to the database. Note: Since prepared statements have usually been parsed prior to making this call, disabling escape processing for PreparedStatements objects will have no effect.
Parameters:
enable - true to enable escape processing; false to disable it
(Read and Write computed property)

JavaStatementMBS.execute(sql as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Executes the given SQL statement, which may return multiple results.

In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

Parameters:
sql - any SQL statement

Returns:
true if the first result is a ResultSet object; false if it is an update count or there are no results

See also:

JavaStatementMBS.execute(sql as string, autoGeneratedKeys as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.

The driver will ignore this signal if the SQL statement is not an INSERT statement.
In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

Parameters:
sql - any SQL statement
autoGeneratedKeys - a constant indicating whether auto-generated keys should be made available for retrieval using the method getGeneratedKeys; one of the following constants: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
Returns:
true if the first result is a ResultSet object; false if it is an update count or there are no results

See also:

JavaStatementMBS.executeBatch as Integer()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

JavaStatementMBS.executeQuery(sql as string) as JavaResultSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Executes the given SQL statement, which returns a single ResultSet object.

Parameters:
sql - an SQL statement to be sent to the database, typically a static SQL SELECT statement
Returns:
a ResultSet object that contains the data produced by the given query; never null

JavaStatementMBS.executeUpdate(Sql as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Parameters:
sql - an SQL INSERT, UPDATE or DELETE statement or an SQL statement that returns nothing
Returns:
either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing

See also:

JavaStatementMBS.executeUpdate(Sql as string, autoGeneratedKeys as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.

Parameters:
sql - must be an SQL INSERT, UPDATE or DELETE statement or an SQL statement that returns nothing
autoGeneratedKeys - a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS
Returns:
either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing

See also:

JavaStatementMBS.EXECUTE_FAILED as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that an error occured while executing a batch statement.

JavaStatementMBS.FetchDirection as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The fetch direction.

Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object. The default value is ResultSet.FETCH_FORWARD.
Note that this method sets the default fetch direction for result sets generated by this Statement object. Each result set has its own methods for getting and setting its own fetch direction.

Parameters:
direction - the initial direction for processing rows
(Read and Write computed property)

JavaStatementMBS.FetchSize as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.

The number of rows specified affects only result sets created using this statement. If the value specified is zero, then the hint is ignored. The default value is zero.
Parameters:
rows - the number of rows to fetch
(Read and Write computed property)

JavaStatementMBS.getGeneratedKeys as JavaResultSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves any auto-generated keys created as a result of executing this Statement object.

If this Statement object did not generate any keys, an empty ResultSet object is returned.

Returns:
a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object

JavaStatementMBS.getMoreResults as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.

There are no more results when the following is true:

// stmt is a Statement object
((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))

Returns:
true if the next result is a ResultSet object; false if it is an update count or there are no more results

See also:

JavaStatementMBS.getMoreResults(current as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object.

There are no more results when the following is true:

// stmt is a Statement object
((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))

Parameters:
current - one of the following Statement constants indicating what should happen to current ResultSet objects obtained using the method getResultSet: Statement.CLOSE_CURRENT_RESULT, Statement.KEEP_CURRENT_RESULT, or Statement.CLOSE_ALL_RESULTS
Returns:
true if the next result is a ResultSet object; false if it is an update count or there are no more results

See also:

JavaStatementMBS.getResultSet as JavaResultSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the current result as a ResultSet object.

This method should be called only once per result.

Returns:
the current result as a ResultSet object or null if the result is an update count or there are no more results

JavaStatementMBS.getResultSetConcurrency as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the result set concurrency for ResultSet objects generated by this Statement object.

Returns:
either ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

JavaStatementMBS.getResultSetHoldability as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the result set holdability for ResultSet objects generated by this Statement object.

Returns:
either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT

JavaStatementMBS.getResultSetType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the result set type for ResultSet objects generated by this Statement object.

Returns:
one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE

JavaStatementMBS.getUpdateCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

This method should be called only once per result.

Returns:
the current result as an update count; -1 if the current result is a ResultSet object or there are no more results

JavaStatementMBS.KEEP_CURRENT_RESULT as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that the current ResultSet object should not be closed when calling getMoreResults.

JavaStatementMBS.MaxFieldSize as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.

This limit applies only to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded.
(Read and Write computed property)

JavaStatementMBS.MaxRows as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The maximum number of rows that a ResultSet object produced by this Statement object can contain.

If this limit is exceeded, the excess rows are silently dropped.
(Read and Write computed property)

JavaStatementMBS.NO_GENERATED_KEYS as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that generated keys should not be made available for retrieval.

JavaStatementMBS.QueryTimeout as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The number of seconds the driver will wait for a Statement object to execute. If the limit is exceeded, a SQLException is thrown.

Returns:
the current query timeout limit in seconds; zero means there is no limit
(Read and Write computed property)

JavaStatementMBS.RETURN_GENERATED_KEYS as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that generated keys should be made available for retrieval.

JavaStatementMBS.setCursorName(name as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods.

This name can then be used in SQL positioned update or delete statements to identify the current row in the ResultSet object generated by this statement. If the database does not support positioned update/delete, this method is a noop. To insure that a cursor has the proper isolation level to support updates, the cursor's SELECT statement should have the form SELECT FOR UPDATE. If FOR UPDATE is not present, positioned updates may fail.
Note: By definition, the execution of positioned updates and deletes must be done by a different Statement object than the one that generated the ResultSet object being used for positioning. Also, cursor names must be unique within a connection.

Parameters:
name - the new cursor name, which must be unique within a connection

JavaStatementMBS.SUCCESS_NO_INFO as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java Database MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constant indicating that a batch statement executed successfully but that no count of the number of rows it affected is available.

The items on this page are in the following plugins: MBS Java Plugin.


The biggest plugin in space...