This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mySQL jdbc Connector/J compiled natively (at last!)


I've finally got the mySQL jdbc driver to compile and build natively with
GCJ. It took me the best part of the weekend, but it works. Since java.sql
is not platform dependent, it will probably work on any GCJ-supported
platform. I've tested on GCJ/minGW (win32).

It's truly a horror story.

Older versions of the driver (jdbc1) won't compile, because they do not
satisfy the java.sql interface requirements in libgcj. I'm talking about
tens of methods added to java.sql.ResultSet and other core interfaces since
jdbc1. Newer versions of the driver, jdbc2 and jdbc3, won't compile, because
they expect new interfaces to be present, not available in libgcj. I'm
talking about java.sql.SavePoint, java.sql.ParameterMetaData, and a bunch of
new constants like java.sql.ResultSet.HOLD_CURSOR_OVER_COMMIT and so on. Not
that they are that useful, but they do break older drivers.

In my impression very few (!) jdbc drivers will be able to compile with the
combination of requirements and unavailable interfaces in libgcj. I'm
definitely not blaming the the libgcj implementors. It's simply a property
of the java.sql design. I haven't run into the problem, but I'm sure that
installing a newer version of the JRE will almost automatically break
existing jdbc drivers. Closed-sources jdbc drivers and dependent
applications will then be beyond repair, until the driver vendor comes up
with a new version of the driver that satisfies the newly increased java.sql
requirements. It's failure by design. They could have versioned the java.sql
interfaces, but that would not have done any good to reduce the resulting
complexity.

If you think anybody would be interested in using mysql with GCJ, I'm
definitely willing to hand over the modified source code and build files to
the mysql afficionados. Or else, make it available on some web site or so.
Feel free to pitch in.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]