prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

Syntax:

PreparedStatement prepareStatement(String sql,
                                   int resultSetType,
                                   int resultSetConcurrency,
                                   int resultSetHoldability)
                                   throws SQLException

Description:

Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. 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

Type: String 

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; the only supported option is ResultSet.TYPE_FORWARD_ONLY

resultSetConcurrency

a concurrency type; the only supported option is ResultSet.CONCUR_READ_ONLY

resultSetHoldability

a holdability type; the only supported option is ResultSet.CLOSE_CURSORS_AT_COMMIT

Returns:

Type:  PreparedStatement

a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability

Throws:

SQLException - if a database access error occurs

SQLFeatureNotSupportedException - this method is not supported for the specified result set type, result set holdability or result set concurrency

Reference:

For more information, reference JDBC documentation for: Connection.prepareStatement(String, int, int, int)