|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.jdbc.JDBC1DataStore org.geotools.data.jdbc.JDBC2DataStore org.geotools.data.jdbc.JDBCDataStore org.geotools.data.db2.DB2DataStore
DB2 DataStore implementation.
Instances of this class should only be obtained via DB2DataStoreFactory.createDataStore or DataStoreFinder.getDataStore.
Field Summary |
Fields inherited from class org.geotools.data.jdbc.JDBC2DataStore |
connectionPool |
Fields inherited from class org.geotools.data.jdbc.JDBC1DataStore |
allowWriteOnVolatileFIDs, config, listenerManager, sqlNameEscape, TYPE_MAPPINGS, typeHandler |
Constructor Summary | |
DB2DataStore(ConnectionPool connectionPool,
JDBCDataStoreConfig config,
java.lang.String dbURL)
The only supported constructor for a DB2DataStore. |
Method Summary | |
protected AttributeType |
buildAttributeType(java.sql.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(java.lang.String tableName,
java.lang.String geometryColumnName)
Get the SRID associated with a geometry column. |
protected QueryData |
executeQuery(FeatureTypeInfo featureTypeInfo,
java.lang.String tableName,
java.lang.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. |
FeatureSource |
getFeatureSource(java.lang.String typeName)
Gets a DB2-specific feature source. |
protected FeatureTypeHandler |
getFeatureTypeHandler(JDBCDataStoreConfig config)
Create a DB2-specific FeatureTypeHandler. |
protected AttributeIO |
getGeometryAttributeIO(AttributeType type,
QueryData queryData)
Gets the handler to convert a geometry database value to a JTS geometry. |
SQLBuilder |
getSqlBuilder(java.lang.String typeName)
Gets the DB2-specific SQL builder object. |
java.lang.String |
getTableSchema()
Gets the table schema associated with this data store. |
java.lang.String[] |
getTypeNames()
Gets the names of tables (types) that contain a spatial column. |
Methods inherited from class org.geotools.data.jdbc.JDBC2DataStore |
createConnection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DB2DataStore(ConnectionPool connectionPool, JDBCDataStoreConfig config, java.lang.String dbURL) throws java.io.IOException
connectionPool
- the initialized DB2 connection poolconfig
- the JDBCDataStoreConfigurationdbURL
- the database URL of the form
jdbc:db2://hostname:hostport/dbname
java.io.IOException
Method Detail |
protected AttributeType buildAttributeType(java.sql.ResultSet rs) throws java.io.IOException
buildAttributeType
in class JDBC1DataStore
rs
- The ResultSet containing the result of a
DatabaseMetaData.getColumns call.
java.io.IOException
- If an error occurs processing the ResultSet.protected FIDMapperFactory buildFIDMapperFactory(JDBCDataStoreConfig config)
buildFIDMapperFactory
in class JDBC1DataStore
config
- not used.
protected int determineSRID(java.lang.String tableName, java.lang.String geometryColumnName) throws java.io.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.
java.io.IOException
protected FeatureTypeHandler getFeatureTypeHandler(JDBCDataStoreConfig config) throws java.io.IOException
getFeatureTypeHandler
in class JDBC1DataStore
config
- a JDBCDataStoreConfig.
java.io.IOException
- if the feature type handler could not be created.protected AttributeIO getGeometryAttributeIO(AttributeType type, QueryData queryData)
getGeometryAttributeIO
in class JDBC1DataStore
type
- not used.queryData
- not used.
public SQLBuilder getSqlBuilder(java.lang.String typeName) throws java.io.IOException
getSqlBuilder
in class JDBC1DataStore
typeName
- Name of the type to build the SQL for.
java.io.IOException
public java.lang.String[] getTypeNames() throws java.io.IOException
getTypeNames
in interface DataStore
getTypeNames
in class JDBC1DataStore
java.io.IOException
- if the spatial catalog can not be accessed.org.geotools.data.DataStore#getFeatureTypes()
public java.lang.String getTableSchema()
At some point this may change if multiple schemas are supported by a data store.
public FeatureSource getFeatureSource(java.lang.String typeName) throws java.io.IOException
getFeatureSource
in interface DataStore
getFeatureSource
in class JDBC1DataStore
typeName
-
java.io.IOException
- if the feature source could not be created.DataStore.getFeatureSource(java.lang.String)
protected QueryData executeQuery(FeatureTypeInfo featureTypeInfo, java.lang.String tableName, java.lang.String sqlQuery, Transaction transaction, boolean forWrite) throws java.io.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
-
java.io.IOException
DataSourceException
- If an error occurs performing the query.protected JDBCFeatureWriter createFeatureWriter(FeatureReader featureReader, QueryData queryData) throws java.io.IOException
createFeatureWriter
in class JDBC1DataStore
featureReader
- queryData
-
java.io.IOException
JDBC1DataStore.createFeatureWriter(org.geotools.data.FeatureReader,
org.geotools.data.jdbc.QueryData)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |