|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectJDBC1DataStore
JDBC2DataStore
JDBCDataStore
DB2DataStore
public class DB2DataStore
DB2 DataStore implementation.
Instances of this class should only be obtained via DB2DataStoreFactory.createDataStore or DataStoreFinder.getDataStore.
modules/plugin/db2 (gt-db2.jar)
Field Summary |
---|
Fields inherited from class JDBC2DataStore |
---|
dataSource |
Fields inherited from class JDBC1DataStore |
---|
allowWriteOnVolatileFIDs, config, listenerManager, sqlNameEscape, transactionIsolation, TYPE_MAPPINGS, typeHandler |
Constructor Summary | |
---|---|
DB2DataStore(DataSource dataSource,
JDBCDataStoreConfig config,
String dbURL)
The only supported constructor for a DB2DataStore. |
Method Summary | |
---|---|
protected AttributeDescriptor |
buildAttributeType(ResultSet rs)
Handles DB2-specific geometry types. |
protected FIDMapperFactory |
buildFIDMapperFactory(JDBCDataStoreConfig config)
Creates a DB2-specific FIDMapperFactory. |
protected JDBCFeatureWriter |
createFeatureWriter(FeatureReader featureReader,
QueryData queryData)
Overrides the method in JDBCDataStore so that a DB2FeatureWriter is created. |
protected int |
determineSRID(String tableName,
String geometryColumnName)
Get the SRID associated with a geometry column. |
protected QueryData |
executeQuery(FeatureTypeInfo featureTypeInfo,
String tableName,
String sqlQuery,
Transaction transaction,
boolean forWrite)
Overrides the method in JDBCDataStore because it includes PostGIS-specific handling to setAutoCommit(false) which causes problems for DB2 because the transaction is still uncommitted when the connection is closed. |
DataSource |
getDataSource()
|
FeatureReader<SimpleFeatureType,SimpleFeature> |
getFeatureReader(SimpleFeatureType requestType,
Filter filter,
Transaction transaction)
This is a public entry point to the DataStore. |
FeatureSource<SimpleFeatureType,SimpleFeature> |
getFeatureSource(String typeName)
Gets a DB2-specific feature source. |
protected FeatureTypeHandler |
getFeatureTypeHandler(JDBCDataStoreConfig config)
Create a DB2-specific FeatureTypeHandler. |
protected AttributeIO |
getGeometryAttributeIO(AttributeDescriptor type,
QueryData queryData)
Gets the handler to convert a geometry database value to a JTS geometry. |
SQLBuilder |
getSqlBuilder(String typeName)
Gets the DB2-specific SQL builder object. |
String |
getTableSchema()
Gets the table schema associated with this data store. |
String[] |
getTypeNames()
Gets the names of tables (types) that contain a spatial column. |
void |
refreshCatalog()
Reloads the spatial catalog from the database. |
Methods inherited from class JDBC2DataStore |
---|
createConnection, dispose, finalize |
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface DataStore |
---|
getFeatureReader, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getSchema, getView, updateSchema |
Methods inherited from interface DataAccess |
---|
createSchema, dispose, getFeatureSource, getInfo, getNames, getSchema, updateSchema |
Constructor Detail |
---|
public DB2DataStore(DataSource dataSource, JDBCDataStoreConfig config, String dbURL) throws IOException
connectionPool
- the initialized DB2 connection poolconfig
- the JDBCDataStoreConfigurationdbURL
- the database URL of the form
jdbc:db2://hostname:hostport/dbname
IOException
Method Detail |
---|
public DataSource getDataSource()
protected AttributeDescriptor buildAttributeType(ResultSet rs) throws IOException
buildAttributeType
in class JDBC1DataStore
rs
- The ResultSet containing the result of a
DatabaseMetaData.getColumns call.
IOException
- If an error occurs processing the ResultSet.protected FIDMapperFactory buildFIDMapperFactory(JDBCDataStoreConfig config)
buildFIDMapperFactory
in class JDBC1DataStore
config
- not used.
protected int determineSRID(String tableName, String geometryColumnName) throws IOException
The value returned is the EPSG coordinate system identifier, not the DB2 srs_id.
determineSRID
in class JDBC1DataStore
tableName
- The name of the table to get the SRID for.geometryColumnName
- The name of the geometry column within the
table to get SRID for.
IOException
protected FeatureTypeHandler getFeatureTypeHandler(JDBCDataStoreConfig config) throws IOException
getFeatureTypeHandler
in class JDBC1DataStore
config
- a JDBCDataStoreConfig.
IOException
- if the feature type handler could not be created.protected AttributeIO getGeometryAttributeIO(AttributeDescriptor type, QueryData queryData)
getGeometryAttributeIO
in class JDBC1DataStore
type
- not used.queryData
- not used.
public SQLBuilder getSqlBuilder(String typeName) throws IOException
getSqlBuilder
in class JDBC1DataStore
typeName
- Name of the type to build the SQL for.
IOException
public String[] getTypeNames() throws IOException
getTypeNames
in interface DataStore
getTypeNames
in class JDBC1DataStore
IOException
- if the spatial catalog can not be accessed.org.geotools.data.DataStore#getFeatureTypes()
public void refreshCatalog() throws IOException
This is useful in case anything changed after the datastore was initialized.
IOException
SQLException
public String getTableSchema()
At some point this may change if multiple schemas are supported by a data store.
public FeatureSource<SimpleFeatureType,SimpleFeature> getFeatureSource(String typeName) throws IOException
getFeatureSource
in interface DataStore
getFeatureSource
in class JDBC1DataStore
typeName
-
IOException
- if the feature source could not be created.DataStore.getFeatureSource(java.lang.String)
protected QueryData executeQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite) throws IOException
executeQuery
in class JDBC1DataStore
featureTypeInfo
- tableName
- sqlQuery
- The SQL query to execute.transaction
- The Transaction is included here for handling
transaction connections at a later stage. It is not currently
used.forWrite
-
IOException
DataSourceException
- If an error occurs performing the query.protected JDBCFeatureWriter createFeatureWriter(FeatureReader featureReader, QueryData queryData) throws IOException
createFeatureWriter
in class JDBC1DataStore
featureReader
- queryData
-
IOException
JDBC1DataStore.createFeatureWriter(org.geotools.data.FeatureReader,
org.geotools.data.jdbc.QueryData)
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(SimpleFeatureType requestType, Filter filter, Transaction transaction) throws IOException
We have given some though to changing this api to be based on query.
Currently the is is the only way to retype your features to different name spaces.
(non-Javadoc)
getFeatureReader
in class JDBC1DataStore
IOException
org.geotools.data.DataStore#getFeatureReader(org.geotools.feature.FeatureType,
Filter, org.geotools.data.Transaction)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |