Thursday 24 January 2019

Statement.execute(sql) vs executeUpdate(sql) and executeQuery(sql)

boolean execute(): Executes the SQL statement in this Prepared Statement object, which may be any kind of SQL statement.
ResultSet executeQuery(): Executes the SQL query in this Prepared Statement object and returns the ResultSet object generated by the query.
int executeUpdate(): Executes the SQL statement in this Prepared Statement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement.

No comments:

Post a Comment

40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot

  40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot 1. What is Tight Coupling? When a class (ClassA) is depen...