1.

What is the difference between execute, executeQuery, executeUpdate?

Answer»
  • boolean execute() - Executes the any kind of SQL statement.

  • ResultSet executeQuery() - This is used generally for reading the content of the database. The output will be in the form of ResultSet. Generally SELECT statement is used.

  • int executeUpdate() - This is generally used for altering the databases. Generally DROP TABLE or DATABASE, INSERT into TABLE, UPDATE TABLE, DELETE from TABLE statements will be used in this. The output will be in the form of int which denotes the number of rows affected by the query.



Discussion

No Comment Found