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 |
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This method can be used by one thread to cancel a statement that is being executed by another thread.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
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 |
After a call to this method, the method getWarnings will return null until a new warning is reported for this Statement object.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 items on this page are in the following plugins: MBS Java Plugin.