Hi Friends,
I am trying to access Oracle database using java. But I am unable to
load the JDBC driver. The statement:
String sDriver = "oracle.jdbc.driver.OracleDriver";
try
{
Class.forName( sDriver ).newInstance();
}
catch( Exception e )
{
...
}
the above statement is throwing exception and I am not sure whether
any settings need to be done (any path settings ? ). I am using
Oracle9i. All help appreciated.
thanks in advance,
Sanjay.
Michael Rauscher - 28 Dec 2004 14:36 GMT
[...]
> the above statement is throwing exception and I am not sure whether
> any settings need to be done (any path settings ? ). I am using
> Oracle9i. All help appreciated.
I assume it's an ClassNotFoundException. In that case, most probably you
didn't include the driver in the classpath.
I don't know the filename for Oracle 9i but for Oracle 8i the file was
called classes12.zip. Given that, the java command line should look
something like
java -cp /path/to/driver/classes12.zip ...
Bye
Michael