Basic HTML version of Foils prepared April 15 1997

Foil 13 JDBC Servlet Example (contd.)

From Examples of JDBC -- Microsoft Access CPS616 -- Information Track of CPS -- Spring Semester 97. by Sangeeta Aggarwal,Tom Pulikal,Udayan Pravate(Nancy McCracken) *

1 try {
2 Class.forName("weblogic.jdbc.oci.Driver"); /* load the driver classes and get the connection to the database */
3 Connection con = DriverManager.getConnection(url,username,password);
4 //create and execute the query statement
5 Statement stmt = con.createStatement();
6 ResultSet rs = stmt.executeQuery(query);
7 dispResultSet(rs,out);
8 //close connections here
9 } Catch(SQLException ex) {
10 //print the exceptions caught
11 }
12 }

Table Font Size


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Aug 14 1997