• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class not found problem

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
}
}
}
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic