8.2.28 prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
- Organization of this subsection
(1) Function
This method creates a PreparedStatement object for sending an SQL statement with parameters to the HADB server.
(2) Format
public synchronized PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
(3) Arguments
- String sql
-
Specifies the SQL statement that is to be executed.
- int resultSetType
-
Specifies a result set type.
- int resultSetConcurrency
-
Specifies the concurrent processing mode.
(4) Return value
The method returns the PreparedStatement object.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The Connection object is closed.
-
Creation of the PreparedStatement object resulted in an error.
-
A value other than a ResultSet literal is specified for the result set type.
-
A value other than a ResultSet literal is specified for the concurrent processing mode.
-
A database access error occurs.
-
The specified SQL statement exceeds 16,000,000 characters.
(6) Notes
-
If ResultSet.TYPE_SCROLL_SENSITIVE is specified for the result set type, this JDBC driver changes it to ResultSet.TYPE_SCROLL_INSENSITIVE, and then sets an SQLWarning.
-
For the concurrent processing mode, the JDBC driver supports only ResultSet.CONCUR_READ_ONLY. If ResultSet.CONCUR_UPDATABLE is specified, the JDBC driver changes it to ResultSet.CONCUR_READ_ONLY, and then sets an SQLWarning.
-
The holdability of a ResultSet object generated from the PreparedStatement object created by this method is always ResultSet.HOLD_CURSORS_OVER_COMMIT.