Hi TImothy,

How are you linking the derby jar file in Eclipse?

Charlie

On 11/9/2010 7:38 AM, Timothy Allen wrote:

Hello,

I wonder if you can help me.

1/
I link to Derby using an embedded driver using Eclipse using database connections, I can see the data in the databases

2/
I link to Derby using the ij tool


3/
I simply cannot get my java program to read a db at all

I have tried both of  the commands below.



//private static String dbURL = "jdbc:derby://localhost:1527/myDB;create=true;user=me;password=mine";
   private static String dbURL = "jdbc:derby:myDB;create=true;"
;



//Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
            Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();


The only result I get is below. Please, what is wrong ? This seems impossible to solve!

Thanks


java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at myapp.Restaurants.createConnection(Restaurants.java:34)
        at myapp.Restaurants.main(Restaurants.java:23)
Exception in thread "main" java.lang.NullPointerException
        at myapp.Restaurants.insertRestaurants(Restaurants.java:51)
        at myapp.Restaurants.main(Restaurants.java:24)
Timothy Allen, Accelerated Value Leader
World Wide IBM Software Accelerated Value Program
Phone: + 44 (0)2088 443191
Internal Phone: 363191
Mobile:0787 2816836

Timothy_Allen@uk.ibm.com
Visit IBM Software Accelerated Value Online

     

 





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU