[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about using libpgjava



>>>>> "Brett" == Brett Smith <bcsmit1@engr.uky.edu> writes:

Brett> I know that free PostgreSQL JDBC drivers exist in the libpgjava
Brett> package, and have them installed.  I would like to find out,
Brett> however, whether it's possible to use these drivers with any
Brett> free Java implementations

I believe Anthony Green has used this package with gcj in the past.
I haven't done it myself.

Brett>    $ gcj-3.2 basic.java
Brett> returns:
Brett> basic.java: In class `example.basic':
Brett> basic.java: In method `example.basic.doexample()':
Brett> basic.java:91: Class `org.postgresql.PGStatement' not found in type declaration.

This means you have to add the postgresql jar file to your classpath.
See the gcj manual for information on doing that.  Simplest would be
to use a `-I' option, just like with the C compiler.

Brett> Adding a --main=basic to the gcj command line did not appear
Brett> to help much, either:
Brett> /tmp/ccItxrfU.o(.text+0x1d): In function `main':
Brett> /tmp/ccr9ULpD.i: undefined reference to `basic::class$'
Brett> collect2: ld returned 1 exit status

Your class is in package `example'.  You must pass the fully qualified
class name to --main:

    gcj --main=example.basic basic.java

(It would be more typical to write `example/basic.java'.  FYI.)

Brett> gij-3.2 reported a similar exception, with a very intricate
Brett> low-level stack trace.

gij, like `java' and kaffe, also takes the fully-qualified class name
as its argument.

Tom



Reply to: