Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException while loading the JDBC driver for HSQLDB

 
Pavan Kumar Dittakavi
Ranch Hand
Posts: 106
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,

I have downloaded the HSQLDB and have created a sample table in it. I have been following the link for the same. Im unable to load the driver using the Class.forName method. It basically complains of the following message. Im relatively new to JDBC please suggest what I might be missing here.

Thanks,
Pavan.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You missed setting your classpath. In particular it has to include the jar which contains the JDBC driver.
 
Pavan Kumar Dittakavi
Ranch Hand
Posts: 106
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I have already set the class path to the directory that contains the jar file you mentioned. It still is throwing me this error. Am I missing something here.

Thanks.,
Pavan.

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't include the folder with the JAR file to your class path, add the JAR file itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic