This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prolems on loading the oracle thin driver

 
nalluri gowri
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error you come across?
What problem you have faced? You have not given more details?
 
K. Tsang
Bartender
Pie
Posts: 3225
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you include the ".newInstance()" part?

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

More importantly is the JDBC file in the classpath?
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic