• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Stored procedure  RSS feed

 
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 ]
 
author & internet detective
Marshal
Posts: 37693
575
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
Marshal
Posts: 37693
575
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!