org.geotools.data.jdbc
Class JDBC2DataStore
java.lang.Object
org.geotools.data.jdbc.JDBC1DataStore
org.geotools.data.jdbc.JDBC2DataStore
- All Implemented Interfaces:
- DataStore
- Direct Known Subclasses:
- JDBCDataStore
- public abstract class JDBC2DataStore
- extends JDBC1DataStore
This JDBCDataStore is able to take advantage of additonal functionality
provided by JDBC2 level drivers - for example ConnectionPools.
This class provides a default implementation of a JDBC data store. Support
for vendor specific JDBC data stores can be easily added to Geotools by
subclassing this class and overriding the hooks provided.
At a minimum subclasses should implement the following methods:
Additionally subclasses can optionally override the following:
-
Use a specific FIDMapperFactory by overriding the
buildFIDMapperFactory(JDBCDataStoreConfig)
method, and eventually disallow
user overrides by throwing an UnsupportedOperationException
in
the setFidMapperFactory()
method.
-
allowTable
- Used to determine whether a table
name should be exposed as a feature type.
-
determineSRID
- Used to determine the
SpatialReference ID of a geometry column in a table.
-
buildSQLQuery()
- Sub classes can override this to build a custom SQL
query.
-
getResultSetType
if the standard result
set type is not satisfactory/does not work with a normal FORWARD_ONLY
resultset type
-
getConcurrency
to set the level of
concurrency for the result set used to read/write the database
Additionally subclasses may want to set the value of:
-
sqlNameEscape - character (String) to surround names of SQL objects to
support mixed-case and non-English names.
- Author:
- Amr Alam, Refractions Research, Jody Garnett, Refractions Research
Method Summary |
protected java.sql.Connection |
createConnection()
Create a connection for your JDBC1 database |
Methods inherited from class org.geotools.data.jdbc.JDBC1DataStore |
allowTable, allSameOrder, attributeNames, buildAttributeType, buildFIDMapperFactory, buildSchema, createFeatureReader, createFeatureWriter, createLockingManager, createSchema, determineFidColumnName, determineSRID, executeQuery, getAttributeIO, getAttributeTypes, getConcurrency, getConnection, getEnvelope, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureTypeHandler, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFIDMapper, getFIDMapperFactory, getGeometryAttributeIO, getJDBCFeatureReader, getLockingManager, getNameSpace, getResultSetType, getSchema, getSqlBuilder, getSqlNameEscape, getTypeNames, getView, setAutoCommit, setFIDMapper, setFIDMapperFactory, setSqlNameEscape, updateSchema |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
connectionPool
protected ConnectionPool connectionPool
JDBC2DataStore
public JDBC2DataStore(ConnectionPool connectionPool,
JDBCDataStoreConfig config)
throws java.io.IOException
- Construct a JDBCDataStore with ConnectionPool and associated
configuration.
- Parameters:
connectionPool
- config
-
- Throws:
java.io.IOException
createConnection
protected java.sql.Connection createConnection()
throws java.sql.SQLException
- Create a connection for your JDBC1 database
- Specified by:
createConnection
in class JDBC1DataStore
- Throws:
java.sql.SQLException
Copyright © GeoTools. All Rights Reserved.