db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Kelly <Char...@CharlieKelly.com>
Subject Re: I cannot link to Derby from a java program in ECLIPSE, and I cannot find out why
Date Tue, 09 Nov 2010 18:35:03 GMT
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_ <mailto:Timothy_Allen@uk.ibm.com>_
> __Visit IBM Software Accelerated Value Online_ 
> <http://www.ibm.com/software/support/acceleratedvalue/>
> _
> _<http://www.linkedin.com/groups?gid=1650807><https://twitter.com/IBMSoftwareValu><http://www.ibm.com/developerworks/spaces/SoftwareAcceleratedValue>

>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> /
> /
>
> /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/
>
>
>
>
>
>


Mime
View raw message