prepareStatement(String sql, int resultSetType, int resultSetConcurrency)

Syntax:

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

Description:

Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareStatement method above, but it allows the default result set type and concurrency to be overridden. The holdability of the created result sets can be determined by calling getHoldability().

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

resultSetConcurrency

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

Returns:

Type:  PreparedStatement

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

Throws:

SQLException - if a database access error occurs

SQLFeatureNotSupportedException - this method is not supported for the specified result set type and result set concurrency

Reference:

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