Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble using Test.java from jdbc "Cattle Drive" - i got trampled :)

 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to run the Test.java program from the jdbc "Cattle Drive"
and get the following error:

C:\InterviewStudy\jdbc>java Test
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Sign
ature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at Test.main(Test.java:10)

The program is:

import java.sql.* ;

public class Test
{

public static void main( String[] args )
{
try
{
Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
try
{
Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/soup", "root", null );

try
{
Statement statement = con.createStatement();

ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");

while ( rs.next() )
{
System.out.println( rs.getString( "TITLE" ) );
}
rs.close();
statement.close();
}
catch ( SQLException e )
{
System.out.println( "JDBC error: " + e );
}
finally
{
con.close();
}
}
catch( SQLException e )
{
System.out.println( "could not get JDBC connection: " + e );
}
}

Can someone please give me some insight into why this is happening?

Thank you,

Ken
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ken,
Is the AspectJ jar in your classpath?
 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne! I muched up the AspectJ path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic