Statement Class
Use connection to send SQL statements to database:Statement stmt = conn.createStatement( );ResultSet rs = stmt.executeQuery(“select * from table1”);The return value of the method executeQuery is a single result set.
The method executeUpdate is used for
- insert, update and delete statements, which return no. of rows affected by change
- DDL statements such as create table, drop table, . . .
The method execute is used for SQL statements that may return more than one result set or update count.