Which method is used to execute SQL queries in JDBC?

  • executeQuery()
  • executeSQL()
  • executeStatement()
  • executeUpdate()
The executeQuery() method in JDBC is used to execute SQL queries that return a ResultSet, typically used for SELECT statements. The executeUpdate() method is used for executing SQL queries that modify the database, such as INSERT, UPDATE, or DELETE statements. The other options mentioned are not valid JDBC methods.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *