Hi Timothy

Reading your email (possibly incorrectly?) but it seems that you only have difficulty when you execute the program?

it may be to do with the classpath and the JVM not being able to find the required jars?

see here for more info on the class path (esp. the gotchas section):
http://mindprod.com/jgloss/classpath.html

I am not an eclipse user but other IDEs allow control over the class path and packaged libs etc.

Hope that helps

Trevor

Quoting Timothy Allen <[email protected]>:

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
[email protected]
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









--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply via email to