Statement Prepared Statement Callable Statement
Statement, Prepared Statement, Callable Statement - Statement – Statement is the java interfaces under java.sql package. This object is used for executing the SQL Query with the execute methods. There the three manner to execute the queries. 1)execute() - execute method are used for execute DML queries. 2)executeBatch() - This method is used for executing many queries at a time. For using this method first add the queries in addBatch() method. 3)executeQuery() - This method is used for select the data from database. This method return ResultSet of database. 4)executeUpdate() - This method is used for update records with in the database. Prepared Statement – Prepared Statement is used for executing the queries with parameter. Any query is compiled and stored in PreparedStatement object at first time. PreparedStatement is used for a situation where you want to execute one query with in a loop. ...