db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Kachalo <andrew_kach...@spymac.com>
Subject Derby, CodeWarrior and MRJ
Date Thu, 03 Feb 2005 08:29:57 GMT
Hi all!

I'm new to Derby, and very interesting in such tool. But after downloading
the binary package, I cannot use it because it shows NoClassDefFoundError
exception every time I want register Derby driver on JDBC.

I use MacOS 9.1 with MacOS Runtime for Java 2.2.3 and CodeWarrior 7.1

derby.jar,derbytools.jar added to the CodeWarrior project. The same files
are copied to SystemFolder:Extensions:MRJ Libraries:MRJClasses.

My code:

try{
    Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
            
    System.out.println ("Establishing connection with a database...");
    String url = "jdbc:derby:contacts";
            
    Connection conn = DriverManager.getConnection(url,"user1","password");
}catch (ClassNotFoundException e){
    System.out.println ("Derby driver not found :(");
    //System.out.println (e.);
}catch (SQLException e){
    System.out.println ("SQL Exception caught :(");
}catch (Exception e){
    System.out.println ("exception :(");
}

The same error goes with:

DriverManager.registerDriver (new org.apache.derby.jdbc.EmbeddedDriver());

Can anyone suggest something?

Thanks for help!

-- 
Best regards Andrew Kachalo
andrew_kachalo@spymac.com


Mime
View raw message