Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how class.forname() works?

 
rogelio uribe
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic