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 Logger |
logger |
static String |
POSTGIS_PROTOCOL |
static String |
POSTGRES_PROTOCOL |
static 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(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.
|
Connection |
connect(String url,
Properties info)
Creates a postgresql connection, and then adds the PostGIS data types to
it calling addpgtypes()
|
Logger |
getParentLogger() |
protected String |
getProtoString() |
protected static DriverWrapper.TypesAdder |
getTypesAdder(org.postgresql.Driver d) |
static String |
getVersion()
Returns our own CVS version plus postgres Version
|
protected String |
mangleURL(String url)
Mangles the PostGIS URL to return the original PostGreSQL URL
|
protected boolean |
useLW(Connection result)
Do we have HexWKB as well known text representation - to be overridden by
subclasses.
|
protected static final Logger logger
public static final String POSTGRES_PROTOCOL
public static final String POSTGIS_PROTOCOL
public static final String REVISION
protected static DriverWrapper.TypesAdder ta72
protected static DriverWrapper.TypesAdder ta74
protected static DriverWrapper.TypesAdder ta80
protected DriverWrapper.TypesAdder typesAdder
public DriverWrapper() throws SQLException
SQLException
protected static DriverWrapper.TypesAdder getTypesAdder(org.postgresql.Driver d) throws SQLException
SQLException
public Connection connect(String url, Properties info) throws SQLException
connect
in interface 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 argumentsSQLException
- if a database access error occursDriver.connect(java.lang.String, java.util.Properties)
,
Driver
protected boolean useLW(Connection result)
public boolean acceptsURL(String url) throws SQLException
acceptsURL
in interface Driver
acceptsURL
in class org.postgresql.Driver
url
- the URL of the driverSQLException
- Passed through from the underlying PostgreSQL
driver, should not happen.Driver.acceptsURL(java.lang.String)
public static String getVersion()
public static void addGISTypes(org.postgresql.PGConnection pgconn) throws SQLException
SQLException
public static void addGISTypes80(org.postgresql.PGConnection pgconn) throws SQLException
SQLException
public static void addGISTypes72(org.postgresql.PGConnection pgconn) throws SQLException
SQLException
protected String mangleURL(String url) throws SQLException
SQLException
protected String getProtoString()
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface Driver
getParentLogger
in class org.postgresql.Driver
SQLFeatureNotSupportedException
Copyright © 2014. All rights reserved.