8.4.6 executeQuery()
- Organization of this subsection
(1) Function
This method executes the preprocessed retrieval SQL statement and returns the ResultSet object that contains the execution results.
(2) Format
public synchronized ResultSet executeQuery() throws SQLException
(3) Arguments
None.
(4) Return value
This method returns the ResultSet object that contains the execution results.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The PreparedStatement object is closed.
-
The Connection object that created this PreparedStatement object is closed.
-
A non-retrieval SQL statement (such as an INSERT statement) was executed.
-
No value is set in at least one dynamic parameter.
-
A database access error occurs.