import java.sql.*; class TestOCIApp { public static void main(String args[]) throws ClassNotFoundException, SQLException { Class.forName("oracle.jdbc.driver.OracleDriver"); // or you can use: // DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver( )); Connection conn = DriverManager.getConnection( "jdbc:oracle:oci8:@dssora01.dss","scott","tiger"); Statement stmt = conn.createStatement( ); ResultSet rset = stmt.executeQuery( "select 'Hello OCI driver tester '||USER||'!' result from dual"); while(rset.next( )) System.out.println(rset.getString(1)); rset.close( ); stmt.close( ); conn.close( );
hi there i tried the above program and i got the following error:Exception in thread "main" java.lang.classNotFoundException Oracle.jdbc.driver. I am using the oracle9i version also i set the classpath environment variable: classpath=C:\oracle\ora90\jdbc\lib\classes12.zip;
View All Comments
| View Tutorial