db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Allen <Timothy_Al...@uk.ibm.com>
Subject I cannot link to Derby from a java program in ECLIPSE, and I cannot find out why
Date Tue, 09 Nov 2010 15:38:58 GMT

I wonder if you can help me.

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

I link to Derby using the ij tool

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
   private static String dbURL = "jdbc:derby:myDB;create=true;"


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


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
Visit IBM Software Accelerated Value Online



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

View raw message