Once you have created the statement object you can execute it using one of the execute methods of the Statement interface namely, execute(), executeUpdate() and, executeQuery(). The execute() method: This method is used to execute SQL DDL statements, it returns a boolean value specifyin...
Difference Between ExecuteQuery and ExecuteUpdate Execute query is used for executing read (SELECT) queries, while execute update is used for executing (write INSERT, UPDATE, DELETE) queries, The execute query method returns a result set which contains the data from the SELECT statement, while the ...
executeQuery() is used for Select statements. executeUodate() is used for insert,update,delete statements.. Was this answer useful? Yes ReplyManohar Nov 2nd, 2012 executeUpdate() is ment for Non-Select Statements,,and it returns Update Count as an int value.executeQuery() is ment for ...
DriverManager and interfaces to connect and execute queries: This enables connections to any ODBC-accessible data source commonly using a specific driver, for example, a MySQL Java connector. We can connect to the database and open/close a transaction over it. Most importantly, we can use any ...