wood burning stoves 2.0*
The moose likes JDBC and the fly likes Problem with Stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with Stored procedure" Watch "Problem with Stored procedure" New topic
Author

Problem with Stored procedure

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 107
Is there a performance difference using CallableStatement and Prepared Statements
[ May 11, 2005: Message edited by: Richard Vagner ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30916
    
158

Richard,
executeUpdate() is for inserts/deletes/updates. It returns an int value representing the number of rows changed. executeQuery() returns the resultset and is used for selects.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30916
    
158

Looks like the question changed since I answered it. Richard, its ok to leave the original question and start a new thread for a new topic.

A CallableStatement is for a stored proc that is executed on the database server. A PreparedStatement is for pre-compiled SQL. It's hard to compare the performance since they are different things. Stored procs are typically faster, although it is not always by enough to worry about the difference.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Stored procedure