• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

execute() vs executeUpdate()

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

May I know what is the difference betweet execute() and executeUpdate().
As far as I know executeUpdate() dont support select statements. execute() supporots all.

If any, please let me know.

Regards,

rahul.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another main difference in these execute() methods is about returning the value by execute these methods.

like:

execute() It returns boolean value

executeQuery() it returns resultset

executeUpdate() It returns integer
 
Scott Selikoff
author
Saloon Keeper
Posts: 4011
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally speaking you almost always use executeUpdate or executeQuery since execute() by itself does not give you much information. I'd recommend consulting the APIs for more details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic