File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes how class.forname() works? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how class.forname() works?" Watch "how class.forname() works?" New topic
Author

how class.forname() works?

rogelio uribe
Greenhorn

Joined: Aug 01, 2001
Posts: 14
Hi there:
I'm not clear at all, about the method Class.forName(), I'm trying to use it on my program, but I'm getting the error:
java.io.Exception: Bad Path: <describing PATH>

the code is:
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.err.print("ClassNotFoundException: " + e.getMessage());
System.exit(1);
}

so, I'm not sure about the meaning of the argument to call this method.
Can anybody help?
Thanx


Roger
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
actually you are using it correctly.
the problem is not related to the use of the Class.forName() . your code works fine in my computer.
perhaps it is a classpath related issue?
or maybe you dont have Jdbc classes?
check to see if u have the java.sql package?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how class.forname() works?
 
Similar Threads
load a class
Class.forName()
Class.forName
Using the Class class
jdbc