1 Reply Latest reply on Jul 23, 2013 9:59 PM by rp0428

    problem in JDBC connection through tugladad

    4948ec00-1a38-46d9-bb14-0faf6b9c4a49

      During run time, i am getting this problem

      Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

       

      My program is

      import java.sql.*;

       

      public class DBOpp

      {

        public static void main(String args []) throws Exception{

      class.forName("oracle.jdbc.driver.OracleDriver");

      Connection con=DriverManager.getConnection

         ("jdbc"oracle:thin:@localhost:1251:myoracle", "scott","tiger");

       

        System.out.println("Connection established ");

        Statement stmt=con.createStatement();

      String str1="insert into abc values ( 145,'wersd','GHTYR');

      stmt.executeUpdate(str1);

      con.close();

       

      }

      }

      I am using JDK 1.5.0.2 and oracle 9i ( server ).

      JDK1.5.0.2 is in c drive and oracle is in E drive.

       

      I would like to know how i can solve this problem.

       

        Thanks & Regards

         Dipak

        • 1. Re: problem in JDBC connection through tugladad
          rp0428

          4948ec00-1a38-46d9-bb14-0faf6b9c4a49 wrote:

           

          During run time, i am getting this problem

          Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

           

          My program is

          import java.sql.*;

           

          public class DBOpp

          {

            public static void main(String args []) throws Exception{

          class.forName("oracle.jdbc.driver.OracleDriver");

          Connection con=DriverManager.getConnection

             ("jdbc"oracle:thin:@localhost:1251:myoracle", "scott","tiger");

           

            System.out.println("Connection established ");

            Statement stmt=con.createStatement();

          String str1="insert into abc values ( 145,'wersd','GHTYR');

          stmt.executeUpdate(str1);

          con.close();

           

          }

          }

          I am using JDK 1.5.0.2 and oracle 9i ( server ).

          JDK1.5.0.2 is in c drive and oracle is in E drive.

           

          I would like to know how i can solve this problem.

           

            Thanks & Regards

             Dipak

          Put the JDBC jar file in your classpath. Don't know if the new 12c driver still supports 9i but the 11.2 driver does.

           

          You can download the Oracle JDBC jar files here:

          http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

           

          Also see the JDBC FAQ for info about the various combinations of database, JDK and JDBC drivers supported

          http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_06

           

          Why are you still using such an ancient and unsupported database?