Specifying the method attribute on statement elements allows you to control how SQL statements and stored procedures are executed.
By default, Rhapsody calls execute() to execute SQL statements and stored procedures. You may set this variable to one of the following values:
execute
executeUpdate
executeQuery
For example:
<statement name="main" method="executeQuery">
- The
execute
method can be used for both query (results returned) and update (no results returned) SQL statements and is by far the most used method in the statement element. - The
executeUpdate
method is used for the SQL statements that don't return results; for example,INSERT
orUPDATE
statements. - The
executeQuery
method is used for SQL statements that return results; for example,SELECT
statements. It differs from theexecute
method because it returns theResultSet
object containing the query results.
As the execute()
method works for most cases, it is unnecessary to specify the execution method unless there is an error in the JDBC driver that you use. One known issue is that the Sprinta driver (com.inet.tds.TdsDriver
) fails to return a ResultSet
object for a stored procedure when the execute()
method is used. If you have found a similar issue, please report it to Rhapsody Support.