jQuery in Action, 2nd edition*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
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: 1081

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: diff bw execute and executeUpdate()