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"); |