• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JDBC would'nt connect to mysql

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Vasanthan Dharmar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 42056
926
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
Vasanthan,
Welcome to JavaRanch!

Since this looks like a question about using Netbeans with AspectJ, I'm moving this to our IDEs forum.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic