[postgis-users] org.postgresql.Connection missing in PostGIS jar

Markus Schaber schabi at logix-tt.com
Wed Apr 26 02:43:00 PDT 2006


Hi, Cathy,

Cathy Y. Walters wrote:
> There does exist a PGConnection class in postgresql jar, but the sample code
> in the manual uses org.postgresql.Connection.
>
> Does the sample code work?

The sample code is rather old, the class was called Connection in
PostgreSQL 7.2. Either 7.3 or 7.4 renamed the Class to PGConnection.

We should update that parts of the manual, but due to time constraints I
did not do it up to now. The README file in the jdbc2 directory is up to
date.

The example code and regression tests in the jdbc2 subdirectory shold
work fine (at least they did when I last checked), if any of them don't
work, please report it as a bug here.

If you're interested in more details, read on:

The reason for stubbin/org/postgresql/Connection.class to exist is that
we wanted to Compile PostGIS in a way that runs against all 7.2 up to
8.1 (and future) pgjdbc versions.

So we compile "fake" PGConnection / Connection classes which mimic the
necessary fragments of the pgjdbc interface, found in the stubsrc
directory, into the stubbin, and compile PostGIS against those.

For running, you need a postgresql.jar/pgjdbc.jar of any supported
version, PostGIS will use magic trickery and rely on the dynamic class
loading to find out which one to actually use.

Personally, I'd prefer to drop all that black magic now, and depend on a
reasonably new pgjdbc driver[1]. But there was some resistance from
distro packagers, which wanted to backport PostGIS to distributions
which only contain PostgreSQL 7.2.


HTH,
Markus

[1] Probably 8.0 or 8.1, which can be used against older servers.


-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list