begginer question jdbc not working - Mailing list pgsql-jdbc

From Neil Dugan
Subject begginer question jdbc not working
Date
Msg-id 436AC425.70801@butterflystitches.com.au
Whole thread Raw
Responses Re: begginer question jdbc not working  (Dave Cramer <dave@fastcrypt.com>)
List pgsql-jdbc
Hi I am very new to Java.

I am having trouble getting connection to a database.  I installed the
Debian package 'libpg-java' version '8.0-312-1'.

I can't seem to get it to work.  I copied the 'basic.java' example from
'/usr/share/doc/libpg-java/examples/example' to the '/tmp' directory.
Then tried to compile and run it.
$ javac basic.java
basic.java: In class 'example.basic':
basic.java: In method 'example.basic.main(java.lang.String[])':
basic.java:206: warning: The method 'setLogStream' in class
'java.sql.DriverManager' has been deprecated.
DriverManager.setLogStream(System.err);
                             ^
1 warning

$ java basic
java.lang.NoClassDefFoundError
    at java.lang.VMClassLoader.nativeDefineClass (VMClassLoader.java)
    at java.lang.VMClassLoader.defineClass (VMClassLoader.java:94)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:673)
    at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:108)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:926)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:360)
    at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1285)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:304)
    at java.lang.VirtualMachine.main (VirtualMachine.java:99)

Any help in getting this to work would be appreciated.

Regard Neil.

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Status of COPY support patch
Next
From: Dave Cramer
Date:
Subject: Re: begginer question jdbc not working