This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes diff bw execute and executeUpdate() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "diff bw execute and executeUpdate()" Watch "diff bw execute and executeUpdate()" New topic
Author

diff bw execute and executeUpdate()

vinodheee kumar
Greenhorn

Joined: Apr 26, 2006
Posts: 9
can you tell diff between Statement methods

execute() and executeUpdate()
in most cases i am using executeUpdate()
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

http://www.coderanch.com/t/301594/JDBC/java/Difference-between-execute-executeQuery-executeUpdate


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Sreenivasan M
Greenhorn

Joined: Oct 05, 2006
Posts: 10
boolean execute()
Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement.

ResultSet executeQuery()
Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

int executeUpdate()
Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement.
 
Have you checked out Aspose?
 
subject: diff bw execute and executeUpdate()
 
It's not a secret anymore!