Provides methods to execute a SQL query to generate a ResultSet, or to execute a prepared SQL statement on an UltraLite database.
public PreparedStatement
The following example demonstrates how to execute a PreparedStatement, check if the execution created a ResultSet, save the ResultSet to a local variable, and close the PreparedStatement:
// Create a new PreparedStatement object from an existing connection. String sql_string = "SELECT * FROM SampleTable"; PreparedStatement ps = conn.prepareStatement(sql_string); // result returns true if the execute statement runs successfully. boolean result = ps.execute(); // Check if the PreparedStatement contains a ResultSet. if (ps.hasResultSet()) { // Store the ResultSet in the rs variable. ResultSet rs = ps.getResultSet(); } // Close the PreparedStatement to release resources. ps.close(); |
All members of PreparedStatement, including all inherited members.
close method
execute method
executeQuery method
getPlan method
getResultSet method
getUpdateCount method
hasResultSet method
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |