Hi,
I am trying to understand the differences between the execute() and the executeUpdate() methods of the java.sql.PreparedStatement.
I am using a CallableStatement to call a Stored Procedure in Oracle. I have tired using the execute() and the executeUpdate() methods and both of them work. Howeer, execute() returns a boolean & executeUpdate() returns an integer.
I am unable to understand the return value of executeUpdate() - if I call a procedure that simply returns a ResultSet in an OUT Parameter, executeUpdate() returns 1. However, the JavaDoc for executeUpdate() states that it :-
Returns:
either (1) the row count for INSERT, UPDATE, or DELETE statements or (2) 0 for SQL statements that return nothing
I am a little confued with the output.
Can you guys please explain the difference to me ?
Regards,
Sandeep