Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class not found problem

 
Takia Fluker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem finding the class in my program. I'm using J++
Can someone help me please?

import sun.jdbc.odbc.JdbcOdbcDriver;

public class DBConnection
{
public static void main(String[] args)
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Class load successful");
}
catch(ClassNotFoundException cnfe){
System.out.println("Class Not Found");
}
}
}
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm using J++

Seriously?! Stop it at once! Unless you have a very good reason for using a much maligned, long obsolete proprietory technology.

As to your error - you need to add the jar file to your classpath which contains the class sun.jdbc.odbc.JdbcOdbcDriver.
 
Takia Fluker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul!

I know J++ is crappy but this is what my teacher wants
I'm been using MS-DOS and NetBeans as well

Thanks for your help! You rock!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic