I want to know the correct usage of executeUpdate, executeQuery and execute
586431Jul 4 2007 — edited Jul 5 2007I checked those methods usage in JDBC3.0 specification like
- executeQuery : used returning a single ResultSet
- executeUpdate : used returning a row count
- execute : used return unknown results or multiple results
But in Oracle, I cannot use those methods following this guide.
For example, in spite of calling executeUpdate method, it does not return a correct row count and always returns 0.
In other case, in which I call executeQuery, Oracle procedure does not return a
single ResultSet. In this case, I had to get ResultSet calling getCursor method from a out parameter.
I think that execute method usage of Oracle is not the same as jdbc3.0 specification's.
What is the correct usage of those 3 methods in Oracle?
Could anyone show me sample Java codes and Oracle stored procedures?