What method is commonly used to execute SQL queries in Java?

  • execute()
  • executeQuery()
  • executeStatement()
  • executeUpdate()
In Java, the executeQuery() method is commonly used to execute SQL queries using JDBC. This method is specifically designed for executing SELECT queries and returns a ResultSet containing the query results. The other options (executeStatement(), executeUpdate(), and execute()) are not typically used for executing queries or have different purposes.
Add your answer
Loading...

Leave a comment

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