pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedbegginer question jdbc not working
2+ messages / 2 participants
[nested] [flat]
* begginer question jdbc not working
@ 2005-11-04 02:15 Neil Dugan <postgres@butterflystitches.com.au>
2005-11-04 04:35 ` Re: begginer question jdbc not working Dave Cramer <dave@fastcrypt.com>
0 siblings, 1 reply; 2+ messages in thread
From: Neil Dugan @ 2005-11-04 02:15 UTC (permalink / raw)
To: 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.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: begginer question jdbc not working
2005-11-04 02:15 begginer question jdbc not working Neil Dugan <postgres@butterflystitches.com.au>
@ 2005-11-04 04:35 ` Dave Cramer <dave@fastcrypt.com>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Cramer @ 2005-11-04 04:35 UTC (permalink / raw)
To: Neil Dugan <postgres@butterflystitches.com.au>; +Cc: pgsql-jdbc
Neil,
Just a shot in the dark, but I'm guessing you don't have your
classpath set to the current directory.
ie CLASSPATH=./
that will find basic
then you will need to add postgresql to it as well.
Dave
On 3-Nov-05, at 9:15 PM, Neil Dugan wrote:
> 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.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-11-04 04:35 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-04 02:15 begginer question jdbc not working Neil Dugan <postgres@butterflystitches.com.au>
2005-11-04 04:35 ` Dave Cramer <dave@fastcrypt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox