Error conecting to MySQL DB

Hi all,

I'm trying to connect to a MySQL db using:

Class.forName("com.mysql.jdbc.Driver");

and I get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature

I've searched the forums (and web) and its a problem others have had to with classpaths not being set correctly - however the mysql-connector-java-5.0.4-bin.jar I downloaded does not include the path:

org/aspect/lang/Signature

I've download 4 different versions of it and they all have the path:

org\gjt\mm\mysql\

and in that directory isDriver.java.

I'm very new to Java (you may have already guessed that... ) - can anyone shed any light on the matter?

big thanks for any advice,

Des

[822 byte] By [Desmond22a] at [2007-11-26 15:25:26]
# 1
If you have not already, you should read this tutorial: [url http://www.developer.com/java/data/article.php/3417381]Using JDBC with MySQL, Getting Started[/url] HTH~Bill
abillconsla at 2007-7-8 21:41:01 > top of Java-index,Java Essentials,New To Java...
# 2

> Hi all,

>

> I'm trying to connect to a MySQL db using:

> [code]

> Class.forName("com.mysql.jdbc.Driver");

> /code]

> and I get the error:

> Exception in thread "main"

> java.lang.NoClassDefFoundError:

> org/aspectj/lang/Signature

>

> I've searched the forums (and web) and its a problem

> others have had to with classpaths not being set

> correctly - however the

> mysql-connector-java-5.0.4-bin.jar I downloaded does

> not include the path:

> org/aspect/lang/Signature

> I've download 4 different versions of it and they all

> have the path:

> org\gjt\mm\mysql\

> and in that directory is Driver.java.

>

> I'm very new to Java (you may have already guessed

> that... ) - can anyone shed any light on the

> matter?

>

> big thanks for any advice,

> Des

I italicized a part of your post. According to your post this seems to be a problem regarding AspectJ not MySQL. It seems you wish to use AspectJ but have not included its jarfile(s) on your classpath.

I'm only guessing that you are trying to use AspectJ, but as far as I know, the MySQL drivers themselves do not require it. I believe it would be a violation of the JDBC driver standards for the Driver to require it, but I may be mistaken.

masijade.a at 2007-7-8 21:41:01 > top of Java-index,Java Essentials,New To Java...
# 3
I use MySQL and do not have AspectJ - FWIW.
abillconsla at 2007-7-8 21:41:01 > top of Java-index,Java Essentials,New To Java...
# 4
yep got it working - think I was in a mess with the class path, thanks for the tips
Desmond22a at 2007-7-8 21:41:01 > top of Java-index,Java Essentials,New To Java...
# 5
Welcome, if I helped.
abillconsla at 2007-7-8 21:41:01 > top of Java-index,Java Essentials,New To Java...