Personal tools
You are here: Home Classes Spring 2006 CS 311 JDBCExamples.htm
Document Actions

JDBCExamples.htm

by bob last modified 2006-04-28 16:18

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.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: