1 |
There are several classes for making SQL statements.
-
Statement stmt = conn.createStatement( ); ResultSet rs = stmt.executeQuery("select a,b,c from table1");
|
2 |
The query returns a result set, which has database table rows satisfying the query.
-
while (rs.next( )) { //print values for current row int i = r.getInt("a"); double f = r.getDouble("b"); String s = r.getString("c"); System.out.println("row" + i + f + s); }
|
3 |
SQL statements may insert, update and delete, and may execute stored procedures in the database. Additional classes deal with transaction commit and rollback.
|