Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there any difference between executeUpdate and execute?

 
thomas davis
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any difference between executeUpdate and execute?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case someone sees this thread later, it was answered
here
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
executeUpdate() is special form of execute(), that only performs DML Operations, while execute() performs any SQL Operation within the limitations of the support of database driver being used.
That's why executeUpdate() returns int - No. of rows affected, while execute() returns boolean depending on the previous operation performed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic