What is execute(), executeUpdate() and executeQuery()
methods?

Answer Posted / ratheesh.a

executeQuery(): This is a method/function used in jdbc
programs. this method will return a 'Resulset' object.
Through this method we can access the result of the query
Usually the Select query is used here..




executeUpadte(): This method is mainly used for updating
queries.. such as 'insert,update,delete' etc... returns an
integer value which shows how many rows are updated...


execute() :What ever the sql queries we are giving in the
other 2 methods can also be include here
This will return a boolean value if it returns 'true' means
query executed successfuly else not..

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is jdbc used?

520


What happens if we don't close the connection in jdbc?

481


Give an example for getXXX method?

553


Does jdbc use ssl?

494


What is db client?

488






What is jdbc and its types?

494


What is the reason why we need a jdbcrowset like the wrapper around resultset?

537


How can we retrieve data from the resultset?

549


What is the difference between client and server database cursors?

595


What is jdbc and explain jdbc architecture?

514


What is data source in java?

525


What is jdbc in java?

487


What are jdbc and its components?

574


How to get the Database server details in java program?

571


Does jdbc require oracle client?

521