GCJ jdbc driver compilation

From: Gianluigi <davassi(at)yahoo(dot)it>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: GCJ jdbc driver compilation
Date: 2005-09-17 11:08:48
Message-ID: 20050917110848.65847.qmail@web26608.mail.ukl.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi to all,
i have a problem: i'm trying to compile with GCJ a
java program that uses jdbc driver
(postgresql-8.0-311.jdbc3.jar ) under Mingw:
the program have that statement

Class.forName("org.postgresql.Driver");

i can compile it but when i try to execute it i have
that error:

java.lang.ClassNotFoundException:
org.postgresql.Driver not found in [file:.\, core:/]

also if i try to set my CLASSPATH mingw shell variable
in the right way. I have also
postgresql-8.0-311.jdbc3.jar in the same directory of
executable.
So i try to force the loading of the class:

private static final Class class1 =
gnu.java.locale.Calendar.class;
private static final Class class2 =
gnu.java.locale.LocaleInformation.class;
private static final Class class4 =
org.postgresql.Driver.class;

but now the compiler fails at linking time:

$ gcj --main=PwServer PwServer.java -o pwserver
--classpath=/home/user/pwserver/

PwServer.java: In class `PwServer':
PwServer.java: In method `<clinit>()':
PwServer.java:30: error: Class `org.postgresql.Driver'
not found in type declaration.
private static final Class class4 =
org.postgresql.Driver.class;
^
1 error

user(at)JACOPOPC ~/pwserver
$ gcj --main=PwServer PwServer.java -o pwserver
--classpath=/home/user/pwserver/postgresql-8.0-311.jdbc3.jar

C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa48d):
In function `ZN8PwServer18__U3c_clinit(unsigned e_E,
void)':
C:/Games/1.0/home/user/pwserver/PwServer.java:1:
undefined reference to
`org::postgresql::Driver::class$'
C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa4fb):C:/Games/1.0/home/user/pwserver/PwServer.java:30:
undefined reference to
`org::postgresql::Driver::class$'
C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa50e):C:/Games/1.0/home/user/pwserver/PwServer.java:30:
undefined reference to
`org::postgresql::Driver::class$'
collect2: ld returned 1 exit status

So i try to compile the jdbc driver as a shared
library with that command:

# gcj --shared postgresql-8.0-311.jdbc3.jar -o
libpo.so

but the result is that:

org/postgresql/ssl/MakeSSL.java: In class
`org.postgresql.ssl.MakeSSL':
org/postgresql/ssl/MakeSSL.java: In method
`org.postgresql.ssl.MakeSSL.convert(org.postgresql.core.PGStream,java.util.Properties)':
org/postgresql/ssl/MakeSSL.java:27: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:27: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:37: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:37: confused by
earlier errors, bailing out

At this time i dunno what to do............any
suggestion or help are very well accepted!!!
Thank,
Muzero from italy


___________________________________
Yahoo! Messenger: chiamate gratuite in tutto il mondo
http://it.messenger.yahoo.com

Browse pgsql-jdbc by date

  From Date Subject
Next Message andres 2005-09-19 18:08:26 UPDATE with database name alias
Previous Message Oliver Jowett 2005-09-16 21:03:27 Re: org.postgresql.util.PSQLException: Eingabe/Ausgabe-Fehler