org.postgis
Class DriverWrapperAutoprobe
java.lang.Object
org.postgresql.Driver
org.postgis.DriverWrapper
org.postgis.DriverWrapperAutoprobe
- All Implemented Interfaces:
- java.sql.Driver
public class DriverWrapperAutoprobe
- extends DriverWrapper
DriverWrapperAutoprobe
Wraps the PostGreSQL Driver to transparently add the PostGIS Object Classes.
This avoids the need of explicit addDataType() calls from the driver users
side.
This DriverWrapper tries to autoprobe the installed PostGIS version to decide
whether to use EWKT or hex encoded EWKB as canonical text representation. It
uses the first PostGIS installation found in your namespace search path (aka
schema search path) on the server side, and this works as long as you do not
access incompatible PostGIS versions that reside in other schemas.
For usage notes, see DriverWrapper class, but use "jdbc:postgresql_autogis:"
as JDBC url prefix and org.postgis.DriverWrapperAutoprobe as driver class.
- Author:
- Markus Schaber
- See Also:
DriverWrapper
Fields inherited from class org.postgresql.Driver |
DEBUG, INFO, MAJORVERSION, MINORVERSION |
Method Summary |
protected java.lang.String |
getProtoString()
|
static java.lang.String |
getVersion()
Returns our own CVS version plus postgres Version |
static boolean |
supportsEWKB(java.sql.Connection conn)
|
protected boolean |
useLW(java.sql.Connection conn)
Do we have HexWKB as well known text representation - to be overridden by
subclasses. |
Methods inherited from class org.postgresql.Driver |
getLogLevel, getMajorVersion, getMinorVersion, getPropertyInfo, jdbcCompliant, makeSSL, notImplemented, setLogLevel, sslEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
POSTGIS_AUTOPROTOCOL
public static final java.lang.String POSTGIS_AUTOPROTOCOL
- See Also:
- Constant Field Values
REVISIONAUTO
public static final java.lang.String REVISIONAUTO
- See Also:
- Constant Field Values
DriverWrapperAutoprobe
public DriverWrapperAutoprobe()
throws java.sql.SQLException
- Default constructor.
- Throws:
java.sql.SQLException
getProtoString
protected java.lang.String getProtoString()
- Overrides:
getProtoString
in class DriverWrapper
useLW
protected boolean useLW(java.sql.Connection conn)
- Description copied from class:
DriverWrapper
- Do we have HexWKB as well known text representation - to be overridden by
subclasses.
- Overrides:
useLW
in class DriverWrapper
getVersion
public static java.lang.String getVersion()
- Returns our own CVS version plus postgres Version
supportsEWKB
public static boolean supportsEWKB(java.sql.Connection conn)
throws java.sql.SQLException
- Throws:
java.sql.SQLException