Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » UltraLiteJ » UltraLiteJ Reference » UltraLiteJ API reference


PreparedStatement interface

Provides methods to execute a SQL query to generate a ResultSet, or to execute a prepared SQL statement on an UltraLite database.

public PreparedStatement
Base classes

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.

All members of PreparedStatement, including all inherited members.

close method
execute method
executeQuery method
getPlan method
getResultSet method
getUpdateCount method
hasResultSet method