• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Stored procedure

 
Richard Vagner
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a performance difference using CallableStatement and Prepared Statements
[ May 11, 2005: Message edited by: Richard Vagner ]
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36031
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36031
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!