What is the difference between executeUpdate() and executeQuery() in JDBC ?

Showing Answers 1 - 21 of 21 Answers

ranjita

  • Sep 13th, 2011
 

return type of executeUpdate() method is "int" where as return type of executeQuery() method is "resultset"

  Was this answer useful?  Yes

paparao

  • Sep 14th, 2011
 

executeUpdate() is used for inserting,deleting,modifying,update the data.
executeQuery() is used for select statement for displaying the data.

  Was this answer useful?  Yes

GS

  • Nov 3rd, 2011
 

executeQuery() is used on select queries(ex. select)
executeUpdate() is used on non select queries(ex. insert,update,delete...)

  Was this answer useful?  Yes

Ravi

  • Apr 25th, 2012
 

executeQuery() is used for Select statements.
executeUodate() is used for insert,update,delete statements..

  Was this answer useful?  Yes

Manohar

  • Nov 2nd, 2012
 

executeUpdate() is ment for Non-Select Statements,,and it returns Update Count as an int value.

executeQuery() is ment for Select Statements, and it returns ResultSet.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions