Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I want to know the correct usage of executeUpdate, executeQuery and execute

586431Jul 4 2007 — edited Jul 5 2007
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2007
Added on Jul 4 2007
3 comments
991 views