• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Stored procedure

 
Richard Vagner
Ranch Hand
Posts: 108
  • 0
  • 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
Marshal
Posts: 33671
316
Eclipse IDE Java VI Editor
  • 0
  • 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: 33671
316
Eclipse IDE Java VI Editor
  • 0
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic