Package net.postgis.jdbc
Class DriverWrapperAutoprobe
- java.lang.Object
-
- org.postgresql.Driver
-
- net.postgis.jdbc.DriverWrapper
-
- net.postgis.jdbc.DriverWrapperAutoprobe
-
- All Implemented Interfaces:
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 net.postgis.jdbc.DriverWrapperAutoprobe as driver class.- Author:
- Markus Schaber <[email protected]>
- See Also:
DriverWrapper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.postgis.jdbc.DriverWrapper
DriverWrapper.TypesAdder, DriverWrapper.TypesAdder72, DriverWrapper.TypesAdder74, DriverWrapper.TypesAdder80
-
-
Field Summary
Fields Modifier and Type Field Description static StringPOSTGIS_AUTOPROTOCOLstatic StringREVISIONAUTO-
Fields inherited from class net.postgis.jdbc.DriverWrapper
logger, POSTGIS_PROTOCOL, POSTGRES_PROTOCOL, REVISION, ta72, ta74, ta80, typesAdder
-
-
Constructor Summary
Constructors Constructor Description DriverWrapperAutoprobe()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetProtoString()static StringgetVersion()Returns our own CVS version plus postgres Versionstatic booleansupportsEWKB(Connection conn)protected booleanuseLW(Connection conn)Do we have HexWKB as well known text representation - to be overridden by subclasses.-
Methods inherited from class net.postgis.jdbc.DriverWrapper
acceptsURL, addGISTypes, addGISTypes72, addGISTypes80, connect, getParentLogger, getTypesAdder, mangleURL
-
-
-
-
Field Detail
-
POSTGIS_AUTOPROTOCOL
public static final String POSTGIS_AUTOPROTOCOL
- See Also:
- Constant Field Values
-
REVISIONAUTO
public static final String REVISIONAUTO
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DriverWrapperAutoprobe
public DriverWrapperAutoprobe() throws SQLExceptionDefault constructor.- Throws:
SQLException- when a SQLExceptin occurs
-
-
Method Detail
-
getProtoString
protected String getProtoString()
- Overrides:
getProtoStringin classDriverWrapper
-
useLW
protected boolean useLW(Connection conn)
Description copied from class:DriverWrapperDo we have HexWKB as well known text representation - to be overridden by subclasses.- Overrides:
useLWin classDriverWrapper- Parameters:
conn- Connection to check- Returns:
- true if using EWKB, false otherwise
-
getVersion
public static String getVersion()
Returns our own CVS version plus postgres Version- Returns:
- String value reprenstation of the version
-
supportsEWKB
public static boolean supportsEWKB(Connection conn) throws SQLException
- Throws:
SQLException
-
-