aspose file tools*
The moose likes JDBC and the fly likes prolems on loading the oracle thin driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "prolems on loading the oracle thin driver" Watch "prolems on loading the oracle thin driver" New topic
Author

prolems on loading the oracle thin driver

nalluri gowri
Greenhorn

Joined: Jun 24, 2013
Posts: 2

import java.sql.*;
class SimpleJdbc
{
public static void main(String ar[])
{
try{
class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(Exception e)
{
System.out.println(e);
}
}
}
nalluri gowri
Greenhorn

Joined: Jun 24, 2013
Posts: 2
nalluri gowri wrote:
import java.sql.*;
class SimpleJdbc
{
public static void main(String ar[])
{
try{
class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Mahender Parkipandla
Greenhorn

Joined: Dec 28, 2009
Posts: 21
What error you come across?
What problem you have faced? You have not given more details?
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2531
    
    8

Did you include the ".newInstance()" part?

Class.forName("oracle.jdbc.OracleDriver").newInstance();

More importantly is the JDBC file in the classpath?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

K. Tsang wrote:Did you include the ".newInstance()" part?

Class.forName("oracle.jdbc.OracleDriver").newInstance();?

This shouldn't be necessary. The driver registers itself when the class is loaded, and Class.forName() causes the target class to be loaded.

More importantly is the JDBC file in the classpath?

That's probably the question here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prolems on loading the oracle thin driver