ClassNotFoundException for oracle.jdbc.driver.OracleDriver
1 answers - 842 bytes -
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