This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: shared library
Tom wrote:
> For #2 do you mean you have to link using `-ljdbc'?
> If so then that is normal. Right now using gcj isn't much different
> from using gcc or g++. You have to link against the libraries you
> use. I'm surprised that your application could link without this.
That's how jdbc works - you load the driver by name. The jdbc stuff in libgcj
takes care of everything else...
java.sql.DriverManager.registerDriver (Class.forName
("org.postgresql.Driver").newInstance());
I think the problem here is that you've chosen a poor name for the driver
library. Try calling it `lib-org-postgresql.so' instead of `libjdbc.so'.
That's the name libgcj needs in order to find the driver class. strace your
application to see the various combinations of names libgcj is attempting.
Better yet - simply download and build the postgresql jdbc driver from rhug...
http://sources.redhat.com/rhug.
AG