Platforms to show: All Mac Windows Linux Cross-Platform
Back to JavaConnectionMBS class.
JavaConnectionMBS.AutoCommit 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 |
See the java documentation for details on java.sql.Connection.SetAutoCommit.
(Read and Write computed property)
JavaConnectionMBS.FETCH_FORWARD 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 constant is used by the method setFetchDirection as a hint to the driver, which the driver may ignore.
JavaConnectionMBS.FETCH_REVERSE 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 constant is used by the method setFetchDirection as a hint to the driver, which the driver may ignore.
JavaConnectionMBS.FETCH_UNKNOWN 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 constant is used by the method setFetchDirection as a hint to the driver, which the driver may ignore.
JavaConnectionMBS.getMetaData as JavaDatabaseMetaDataMBS
| 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 metadata includes information about the database's tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on.
Returns:
a DatabaseMetaData object for this Connection object
JavaConnectionMBS.Holdability 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 |
Parameters:
holdability - a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
(Read and Write computed property)
JavaConnectionMBS.HOLD_CURSORS_OVER_COMMIT 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 |
JavaConnectionMBS.isClosed 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 |
A connection is closed if the method close has been called on it or if certain fatal errors have occurred. This method is guaranteed to return true only when it is called after the method Connection.close has been called.
This method generally cannot be called to determine whether a connection to a database is valid or invalid. A typical client can determine that a connection is invalid by catching any exceptions that might be thrown when an operation is attempted.
Returns:
true if this Connection object is closed; false if it is still open
JavaConnectionMBS.nativeSQL(sql as string) 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 |
A driver may convert the JDBC SQL grammar into its system's native SQL grammar prior to sending it. This method returns the native form of the statement that the driver would have sent.
Parameters:
sql - an SQL statement that may contain one or more '?' parameter placeholders
Returns:
the native form of this statement
JavaConnectionMBS.prepareCall(sql as string) as JavaCallableStatementMBS
| 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 CallableStatement object provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.
Note: This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method prepareCall is done; others may wait until the CallableStatement object is executed. This has no direct effect on users; however, it does affect which method throws certain SQLExceptions.
Result sets created using the returned CallableStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.
Parameters:
sql - an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string.
Returns:
a new default CallableStatement object containing the pre-compiled SQL statement
See also:
JavaConnectionMBS.prepareCall(sql as string, resultSetType as Integer, resultSetConcurrency as Integer) as JavaCallableStatementMBS
| 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 is the same as the prepareCall method above, but it allows the default result set type and concurrency to be overridden.
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain on or more ? parameters
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Returns:
a new CallableStatement object containing the pre-compiled SQL statement that will produce ResultSet objects with the given type and concurrency
See also:
JavaConnectionMBS.prepareCall(sql as string, resultSetType as Integer, resultSetConcurrency as Integer, resultSetHoldability as Integer) as JavaCallableStatementMBS
| 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 is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and holdability to be overridden.
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain on or more ? parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
See also:
JavaConnectionMBS.prepareStatement(sql as string) as JavaPreparedStatementMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLException objects.
Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.
Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders
See also:
- prepareStatement(sql as string, autoGeneratedKeys as Integer) as JavaPreparedStatementMBS
- prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer) as JavaPreparedStatementMBS
- prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer, resultSetHoldability as Integer) as JavaPreparedStatementMBS
Some examples using this method:
- /Java/JavaDatabase/java Database Thread Tests
- /Java/JavaDatabase/JavaDatabase MDB
- /Java/JavaDatabase/JavaDatabase MySQL Blob and Clob
- /Java/JavaDatabase/JavaDatabase MySQL test
- /Java/JavaDatabase/JavaDatabase MySQL test with Threading
- /Java/JavaDatabase/JavaDatabase MySQL with JavaInputStreamMBS
- /Java/JavaDatabase/JavaDatabase SQLite
- /Java/JavaDatabase/JavaDatabase SQLite blob
- /Java/JavaDatabase/JavaDatabase to JSON
- /Java/JavaDatabase/JDBCMultipleDrivers
JavaConnectionMBS.prepareStatement(sql as string, autoGeneratedKeys as Integer) as JavaPreparedStatementMBS
| 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 given constant tells the driver whether it should make auto-generated keys available for retrieval. This parameter is ignored if the SQL statement is not an INSERT statement.
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLExceptions.
Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.
Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders
autoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
Returns:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys
See also:
- prepareStatement(sql as string) as JavaPreparedStatementMBS
- prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer) as JavaPreparedStatementMBS
- prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer, resultSetHoldability as Integer) as JavaPreparedStatementMBS
JavaConnectionMBS.prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer) as JavaPreparedStatementMBS
| 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 is the same as the prepareStatement method above, but it allows the default result set type and concurrency to be overridden.
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parameters
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Returns:
a new PreparedStatement object containing the pre-compiled SQL statement that will produce ResultSet objects with the given type and concurrency
See also:
- prepareStatement(sql as string) as JavaPreparedStatementMBS
- prepareStatement(sql as string, autoGeneratedKeys as Integer) as JavaPreparedStatementMBS
- prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer, resultSetHoldability as Integer) as JavaPreparedStatementMBS
JavaConnectionMBS.prepareStatement(sql as string, resultSetType as Integer, resultSetConcurrency as Integer, resultSetHoldability as Integer) as JavaPreparedStatementMBS
| 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 is the same as the prepareStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
See also:
JavaConnectionMBS.ReadOnly 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 |
See the java documentation for details on java.sql.Connection.SetReadOnly.
(Read and Write computed property)
JavaConnectionMBS.releaseSavepoint(safepoint as JavaSavepointMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.
savepoint: the Savepoint object to be removed
| 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 used only when auto- commit has been disabled.
See the java documentation for details on java.sql.Connection.Rollback.
See also:
JavaConnectionMBS.rollback(safepoint as JavaSavepointMBS)
| 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 used only when auto-commit has been disabled.
savepoint: the Savepoint object to roll back to
See also:
JavaConnectionMBS.setSavepoint as JavaSavepointMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
See also:
JavaConnectionMBS.setSavepoint(name as string) as JavaSavepointMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Java Database | MBS Java Plugin | 8.5 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
name: a String containing the name of the savepoint
returns the new Savepoint object
See also:
The items on this page are in the following plugins: MBS Java Plugin.