* GREY=local LOCAL HTML version of Foils prepared 13 March 1997

Foil 19 Example - Using Weblogic's Oracle Driver

From Overview of Java Database Connection Basic Information Technology Course CPS616 -- Spring Semester 1997. by Udayan Parvate, Tom Pulikal (Geoffrey C. Fox) *

package tutorial.jdbc.oracle;
import java.sql.*;
public class myTest {
public static void main (String argv[] ) throws Exception
{ //load the driver class from the local CLASSPATH
Class.forname("weblogic.jdbc.oci.Driver");
//connect to the database using the driver url and
// other properties like username, password and server
Connection conn =
DriverManager.getConnection("jdbc:weblogic:oracle:kayak",
"scott", "tiger")
//statement class is instantiated using the connection
// class for executing queries
Statement stmt = conn.createStatement();
stmt.execute("select * from empdemo");



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 Tue Jul 22 1997