| Author |
JDBC would'nt connect to mysql
|
Vasanthan Dharmar
Greenhorn
Joined: Jun 30, 2005
Posts: 2
|
|
I have been trying to connect to MYSQl database. Just learning JDBC and this is my first sample program.I use netbeans IDE. I also tried executing it from the command prompt and still i get hte same error. Compiles fine but throws up this 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) I searched the web and came across few solutions 1) Checked the class pathlike 100 times. 2)Used mysql-connector-java-bin-3.1.8 instead of mysql-connector-java-bin-3.1.8-g 3)unzipped the aspectjrt.jar file and set included that directory to the class path. Still doesnt seem to work! Got suggestions to help me out? [ July 01, 2005: Message edited by: Bear Bibeault ] [Jeanne added code tags] [ July 02, 2005: Message edited by: Jeanne Boyarsky ]
|
 |
Sonny Gill
Ranch Hand
Joined: Feb 02, 2002
Posts: 1211
|
|
Vasanthan, It definately looks like a classpath issue. But, if you are just learning JDBC, I suggest you not mix it up with any Aspect J stuff. That will narrow down the code that you need to check to find the cause of error.
|
The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
|
 |
Vasanthan Dharmar
Greenhorn
Joined: Jun 30, 2005
Posts: 2
|
|
Yep, I do take it as my fault. I use netbeans ide. I have set up the class path My libray. When i expand the my library icon. I do see the org.aspectj.lang.signature class file. This library is also included the project. So basically stumped.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26193
|
|
Vasanthan, Welcome to JavaRanch! Since this looks like a question about using Netbeans with AspectJ, I'm moving this to our IDEs forum.
|
[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
|
 |
Matan Mazursky
Greenhorn
Joined: Jul 11, 2005
Posts: 9
|
|
haha, netbeans JDBC I struggled with this for a while myself. here's my code: import java.sql.*; public void connect() throws Exception { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=m1a2t3a4n5"); } This works after having added to libraries the appropriate JAR, who's name is: mysql-connector-java-3.1.10-bin.jar Tell me if you need that JAR.
|
 |
 |
|
|
subject: JDBC would'nt connect to mysql
|
|
|