• 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

Help on mysql

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,
I am using MySQL as a database and am trying to run a sample program to fetch and display data from a table...
I am getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sitepoint.ToDoList.<init>(ToDoList.java:12)
at com.sitepoint.ToDoTest.main(ToDoTest.java:6)

Is this a classpath problem. I am using eclipse ide to run the project. Also i am using the following driver: mysql-connector-java-3.1.13-bin-g.jar

Here is the driver and connection string i am using:
"com.mysql.jdbc.Driver", "jdbc:IJDB://localhost/TODO?user=db2admin&password=db2admin"

Please help me resolve.

Also when i try to run it from command i get the following:
The java class could not be loaded. java.lang.UnsupportedClassVersionError:

Thanks & Regards,
Abhi.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Abhi,
It sounds like there are two issues here.

java.lang.NoClassDefFoundError: org/aspectj/lang/Signature


This is telling you that some class uses AspectJ. This is an Aspect Oriented Programming framework. You need in your classpath in addition to the mysql jar.

The java class could not be loaded. java.lang.UnsupportedClassVersionError:


This may be telling you that you are using a jar file that was compiled against a version of java greater than the one you are running against.
 
Jeanne Boyarsky
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since these are both classpath issues and not specific to JDBC, I'm going to move this post to our Java in General forum.
 
Abhishek Dharwadkar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey thanks,
I found the mistake. I was using the wrong jar file. When i used the correct one it worked.

Thanks a lot you guys,
Abhi.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic