JAVA

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • ClassNotFoundException for oracle.jdbc.driver.OracleDriver

    1 answers - 842 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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.
  • No.1 | | 525 bytes | |

    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.

Re: ClassNotFoundException for oracle.jdbc.driver.OracleDriver


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "JAVA"

DATABASE TECH