db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <karth...@gmail.com>
Subject Re: Eclipse Plug-in Lab code is failing to find driver in derbyclient.jar
Date Sun, 18 Feb 2007 23:11:54 GMT
A. Rick Anderson wrote:
> I hit the send button a little too quickly.  You are correct.  The 
> client driver is in the derbyclient.jar file, not the derby.jar file. 
> Unfortunately, at least from a debugging perspective, they are both in 
> the build path of my project.
> I've gone back and literally stripped the entire lab to the absolute 
> minimum below, but I am getting the exact same behavior.  It throws an 
> exception when I attempt to get the ClientDriver connection.
> This seems to be related to the Eclipse plug-in, because I was able to 
> do all of the "Getting Started" labs from the command line without any 
> issues.
> Has anyone else been able to complete the lab associated with the 
> Eclipse Plug-in for 10.2.2?
> package org.apache.derby.plugin.lab;
> import java.sql.Connection;
> import java.sql.DriverManager;
> public class Jays2 {
>    private static final String derbyClientDriver =
>       "org.apache.derby.jdbc.ClientDriver";
>    private static final String derbyClientURL =
>       "jdbc:derby://localhost:1527/jayDB:user=APP;password=APP;";
>    public static void main(String[] args) throws Exception {
>          Class.forName(derbyClientDriver);
> /*dies*/ Connection conn = DriverManager.getConnection(derbyClientURL);
>          conn.close();
>    } // method main
> } // class Jays2
I am using the 10.2.2 plugins on Eclipse 3.1 and 3.2 and it works for me 
in both (even tried your simple program
and that works too). What version of Eclipse do you have ?

I assume you have added the Derby nature to your project (using the 
Derby plugins) and that is how the
Derby jars show up in the project's build path.
Are there any errors in your <Eclipse workspace/.metadata/.log file ? 
Just to rule out any issue with the Derby plug-ins,
all the error related to the plugins get logged there.

Did you try adding just the derbyclient.jar into your project's build 
path manually (without using the Derby plugins) and
then run your program.


View raw message