JDBCExamples.htm
JDBC Examples
-
JDBC1 This opens a connection to user dummy's oracle account and executes the statement "SELECT * FROM R". This returns an iterator for the result of this query. A while loop iterates through the results, printing the two fields returned.
- JDBC2 This does an insert on a table using
the Statement.executeUpdate() method.
- JDBC3 This uses a "prepared statement"
to do a sequence of inserts.
- JDBC4 This calls an SQL procedure using the
CallableStatement class.
- JDBC5 This updates view RS (the natural join of tables R(a, d) and S(a, b) by updating the base tables.