Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

MYSQL JDBC NoClassDefFoundError: org/aspectj/lang/Signature

843854Apr 15 2005 — edited Apr 23 2007
i am trying to connect to a database via java using JDBC i have installed:

jdk1.5.0_01
mysql-connector-java-3.1.8-bin-g.jar
MySQL Server 4.1

Java works fine, MYSQL works fine from the command prompt but when it comes to testing using this simple java program

public class JdbcExample1 {

public static void main(String args[]) {
Connection con = null;

try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("localhost", "username", "password");

if(!con.isClosed())
System.out.println("Successfully connected to MySQL server...");

} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {}
}
}
}

this compiles fine but when run i get the following error message

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 JdbcExample1.main(JdbcExample1.java:10)

class path is set as .;C:\Program Files\Java\jdk1.5.0_01\jre\lib\ext\mysql-connector-java-3.1.8-bin.java

any help or input on this error would be appreciated

thanks in advanced Neil
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2007
Added on Apr 15 2005
20 comments
1,370 views