org.postgis
public class DriverWrapper extends org.postgresql.Driver
<driver-class>org.postgis.DriverWrapper</driver-class>
If you don't like or want to use the DriverWrapper, you have two
alternatives, see the README file.
Also note that the addDataType() methods known from earlier pgjdbc versions
are deprecated in pgjdbc 8.0, see the commented code variants in the
addGisTypes() method.
This wrapper always uses EWKT as canonical text representation, and thus
works against PostGIS 1.x servers as well as 0.x (tested with 0.8, 0.9 and
1.0).DriverWrapperLW
,
DriverWrapperAutoprobe
Modifier and Type | Class and Description |
---|---|
protected static class |
DriverWrapper.TypesAdder
Base class for the three typewrapper implementations
|
protected static class |
DriverWrapper.TypesAdder72
addGISTypes for V7.2 pgjdbc
|
protected static class |
DriverWrapper.TypesAdder74
addGISTypes for V7.3 and V7.4 pgjdbc
|
protected static class |
DriverWrapper.TypesAdder80
addGISTypes for V8.0 (and hopefully newer) pgjdbc
|
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
logger |
static java.lang.String |
POSTGIS_PROTOCOL |
static java.lang.String |
POSTGRES_PROTOCOL |
static java.lang.String |
REVISION |
protected static DriverWrapper.TypesAdder |
ta72 |
protected static DriverWrapper.TypesAdder |
ta74 |
protected static DriverWrapper.TypesAdder |
ta80 |
protected DriverWrapper.TypesAdder |
typesAdder |
Constructor and Description |
---|
DriverWrapper()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(java.lang.String url)
Check whether the driver thinks he can handle the given URL.
|
static void |
addGISTypes(org.postgresql.PGConnection pgconn)
adds the JTS/PostGIS Data types to a PG 7.3+ Connection.
|
static void |
addGISTypes72(org.postgresql.PGConnection pgconn)
adds the JTS/PostGIS Data types to a PG 7.2 Connection.
|
static void |
addGISTypes80(org.postgresql.PGConnection pgconn)
adds the JTS/PostGIS Data types to a PG 8.0+ Connection.
|
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
Creates a postgresql connection, and then adds the PostGIS data types to
it calling addpgtypes()
|
java.util.logging.Logger |
getParentLogger() |
protected java.lang.String |
getProtoString() |
protected static DriverWrapper.TypesAdder |
getTypesAdder(org.postgresql.Driver d) |
static java.lang.String |
getVersion()
Returns our own CVS version plus postgres Version
|
protected java.lang.String |
mangleURL(java.lang.String url)
Mangles the PostGIS URL to return the original PostGreSQL URL
|
protected boolean |
useLW(java.sql.Connection result)
Do we have HexWKB as well known text representation - to be overridden by
subclasses.
|
protected static final java.util.logging.Logger logger
public static final java.lang.String POSTGRES_PROTOCOL
public static final java.lang.String POSTGIS_PROTOCOL
public static final java.lang.String REVISION
protected static DriverWrapper.TypesAdder ta72
protected static DriverWrapper.TypesAdder ta74
protected static DriverWrapper.TypesAdder ta80
protected DriverWrapper.TypesAdder typesAdder
public DriverWrapper() throws java.sql.SQLException
java.sql.SQLException
protected static DriverWrapper.TypesAdder getTypesAdder(org.postgresql.Driver d) throws java.sql.SQLException
java.sql.SQLException
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
connect
in interface java.sql.Driver
connect
in class org.postgresql.Driver
url
- the URL of the database to connect toinfo
- a list of arbitrary tag/value pairs as connection argumentsjava.sql.SQLException
- if a database access error occursDriver.connect(java.lang.String, java.util.Properties)
,
Driver
protected boolean useLW(java.sql.Connection result)
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
acceptsURL
in interface java.sql.Driver
acceptsURL
in class org.postgresql.Driver
url
- the URL of the driverjava.sql.SQLException
- Passed through from the underlying PostgreSQL
driver, should not happen.Driver.acceptsURL(java.lang.String)
public static java.lang.String getVersion()
public static void addGISTypes(org.postgresql.PGConnection pgconn) throws java.sql.SQLException
java.sql.SQLException
public static void addGISTypes80(org.postgresql.PGConnection pgconn) throws java.sql.SQLException
java.sql.SQLException
public static void addGISTypes72(org.postgresql.PGConnection pgconn) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String mangleURL(java.lang.String url) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String getProtoString()
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in class org.postgresql.Driver
java.sql.SQLFeatureNotSupportedException
Copyright © 2016. All Rights Reserved.