Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Currently in Delaware, US.
    Posts
    5

    Unanswered: ClassNotFoundException for oracle.jdbc.driver.OracleDriver

    Hi,

    I try to connect to the oracle DB on a remote machine from a unix box. I use the following part of code for that:
    ====================================
    private static final String URL = "jdbc:oracle:thin:@unixhostname:port:oracleSID ";
    private static final String UserName = "username";
    private static final String Password = "password";
    private static final String oracleDriver = "oracle.jdbc.driver.OracleDriver";
    Class.forName(oracleDriver);
    oracleConnection = DriverManager.getConnection( URL, UserName, Password);
    =====================================

    When I run the program, it gives the exception as:
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    Can anyone tell me what i am doing wrongly and what i have to do?

    Thanks,
    Luke.

  2. #2
    Join Date
    Oct 2003
    Location
    Komsomolsk-on-Amur, Russia
    Posts
    1

    Re: ClassNotFoundException for oracle.jdbc.driver.OracleDriver

    Originally posted by lukevprem

    I try to connect to the oracle DB on a remote machine from a unix box. I use the following part of code for that:

    When I run the program, it gives the exception as:
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    Can anyone tell me what i am doing wrongly and what i have to do?
    You must to specify in your classpath an Oracle jdbc library such as classes12.zip. You can find it in the Oracle home directory, then jdbc then lib.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •