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

Answer Posted / trio

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.

Is This Answer Correct ?    39 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have foreign key reference to a non primary key column ?

528


In which ways is driver class is registered with drive manager?

520


What are the measures to connect to the db using jdbc?

460


How the JDBC application works?

528


How can you know about drivers and database information ?

546






How will you perform truncation using JDBC?

575


What are the 4 types of jdbc drivers?

509


Explain the main method?

562


What does executequery return in java?

505


What are four types of JDBC driver?

566


How do I receive a ResultSet from a stored procedure?

517


Explain the difference between rowset vs. Resultset in jdbc?

575


What are the benefits of PreparedStatement over Statement?

526


Explain the two tier and three tier architecture of jdbc.

521


What is the feature of jdbc v4?

482