I am trying to connect with mysql database.my program is having main method. when i am compiling and running the program from the command prompt my program is working fine. I am using netbeans
IDE. when i try to run the priogram directly using netbeans i getting this exception during runtime.
java. lang. No Class Def Found Error :
org/ aspectj/ lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:155)
at DataCheck.main(DataCheck.java:20)
Exception in
thread "main"
I know that this is something related to the classpath.But i have tried everything i can do. here is the code that i use to connect with the database.
Class.forName ( "com.mysql.jdbc.Driver" );
Connection con= DriverManager.getConnection ("jdbc:mysql://localhost:3306/myapp" , "root" , "admin");
please help me. I get the same exception when i try to connect using
servlets also. but the program is working fine in command prompt.
regards Surendar