Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes Trouble using Test.java from jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Trouble using Test.java from jdbc "Cattle Drive" - i got trampled :)" Watch "Trouble using Test.java from jdbc "Cattle Drive" - i got trampled :)" New topic
Author

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

Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Ken,
Is the AspectJ jar in your classpath?


[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
Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Thanks Jeanne! I muched up the AspectJ path.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble using Test.java from jdbc "Cattle Drive" - i got trampled :)
 
Similar Threads
MySQL Beginner Has Problem With Loading JDBC Driver
"..could not load JDBC driver."
java.sql.SQLException Access Denied
Cannot find symbol
classpath and jdbc