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
|
The method execute is used for SQL statements that may return more than one result set or update count. |