1 Answers
What is the difference between executeQuery() and executeUpdate() methods in JDBC?
In JDBC, the executeQuery() method is used to execute SQL SELECT statements that return a ResultSet object containing the query results. On the other hand, the executeUpdate() method is used to execute SQL statements such as INSERT, UPDATE, DELETE, and DDL statements, and it returns the number of rows affected.
Therefore, the key difference between executeQuery() and executeUpdate() methods in JDBC is that executeQuery() is used for querying and retrieving data, while executeUpdate() is used for modifying data in the database.
Please login or Register to submit your answer