aspose file tools*
The moose likes Java in General and the fly likes Help on mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help on mysql " Watch "Help on mysql " New topic
Author

Help on mysql

Abhishek Dharwadkar
Ranch Hand

Joined: Aug 02, 2006
Posts: 44
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.


"I may not have gone where I intended to go, but I think I have ended up where I needed to be"<br /> <br />"He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it"<br /> <br />--by Douglas Adams<br /> <br />[SCJP - 96%, SCWCD - 88%, SCBCD - May 2008]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

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

Joined: Aug 02, 2006
Posts: 44
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help on mysql