executeQuery()—for getting the data from database.
execute()—any kind of operations.
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.
- What is the difference between execute, executequery, executeupdate?
- What is the difference between Statement and PreparedStatement in jdbc?
- How can we execute stored procedures and functions?
- How to rollback a JDBC transaction?
- Explain JDBC Savepoint.
- What is the use of blob and clob datatypes in JDBC?
- What is Connection Pooling?
- How do you implement connection pooling?
- What is 2 phase commit?
- What are the different types of locking in JDBC?
- What is a “dirty read”?