Basic HTML version of Foils prepared 4 Feb 98

Foil 41 JDBC Servlet Example (contd.)

From Overview of JDBC and its use with CORBA or Java RMI CPS616 Technologies of Information Age -- Spring 1998. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


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



© 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 Sun Nov 29 1998