This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi Eswar, Myself, I use "executeQuery()" when I want to SELECT data from the database (i.e. perform a query), I use "executeUpdate()" when I want to INSERT, DELETE or UPDATE (i.e. perform data manipulation) and "execute()" when I want to invoke a database stored procedure. Hope that helps answer your question. Good Luck, Avi.
Originally posted by eswar kumar: what is the difference among three?[/QB]
The difference is in the return type. executeUpdate() returns the number of rows updated. execute() returns a boolean which indicates if a ResultSet is available. executeQuery returns a ResultSet, even if there are no rows returned by the query. I concur with Avi's rules of thumb as to when to use the different methods.