org.geotools.data.oracle
Class OracleDataStore

java.lang.Object
  extended byorg.geotools.data.jdbc.JDBC1DataStore
      extended byorg.geotools.data.jdbc.JDBC2DataStore
          extended byorg.geotools.data.jdbc.JDBCDataStore
              extended byorg.geotools.data.oracle.OracleDataStore
All Implemented Interfaces:
DataStore

public class OracleDataStore
extends JDBCDataStore

Author:
Sean Geoghegan, Defence Science and Technology Organisation.

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
OracleDataStore(ConnectionPool connectionPool, JDBCDataStoreConfig config)
           
OracleDataStore(ConnectionPool connectionPool, java.lang.String schemaName, java.util.Map fidGeneration)
           
OracleDataStore(ConnectionPool connectionPool, java.lang.String namespace, java.lang.String schemaName, java.util.Map fidGeneration)
           
 
Method Summary
protected  boolean allowTable(java.lang.String tablename)
          Crops non feature type tables.
protected  AttributeType buildAttributeType(java.sql.ResultSet rs)
          Overrides the buildAttributeType method to check for SDO_GEOMETRY columns.
protected  JDBCFeatureWriter createFeatureWriter(FeatureReader fReader, QueryData queryData)
          Returns a Oracle text based feature writer that just issues the sql statements directly, as text.
protected  org.opengis.referencing.crs.CoordinateReferenceSystem determineCRS(int srid)
           
protected  int determineSRID(java.lang.String tableName, java.lang.String geometryColumnName)
          Provides a hook for subclasses to determine the SRID of a geometry column.
 com.vividsolutions.jts.geom.Envelope getEnvelope(java.lang.String typeName)
          Retrieve approx bounds of all Features.
protected  AttributeIO getGeometryAttributeIO(AttributeType type, QueryData queryData)
          Hook to create the geometry attribute IO for a vendor specific data source.
 SQLBuilder getSqlBuilder(java.lang.String typeName)
          Hook for subclass to return a different sql builder.
 
Methods inherited from class org.geotools.data.jdbc.JDBC2DataStore
createConnection
 
Methods inherited from class org.geotools.data.jdbc.JDBC1DataStore
allSameOrder, attributeNames, buildFIDMapperFactory, buildSchema, createFeatureReader, createLockingManager, createSchema, determineFidColumnName, executeQuery, getAttributeIO, getAttributeTypes, getConcurrency, getConnection, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureTypeHandler, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFIDMapper, getFIDMapperFactory, getJDBCFeatureReader, getLockingManager, getNameSpace, getResultSetType, getSchema, 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
 

Constructor Detail

OracleDataStore

public OracleDataStore(ConnectionPool connectionPool,
                       JDBCDataStoreConfig config)
                throws java.io.IOException
Parameters:
connectionPool -
config -
Throws:
java.io.IOException

OracleDataStore

public OracleDataStore(ConnectionPool connectionPool,
                       java.lang.String schemaName,
                       java.util.Map fidGeneration)
                throws java.io.IOException
Parameters:
connectionPool -
Throws:
DataSourceException
java.io.IOException

OracleDataStore

public OracleDataStore(ConnectionPool connectionPool,
                       java.lang.String namespace,
                       java.lang.String schemaName,
                       java.util.Map fidGeneration)
                throws java.io.IOException
Parameters:
connectionPool -
namespace -
Throws:
DataSourceException
java.io.IOException
Method Detail

allowTable

protected boolean allowTable(java.lang.String tablename)
Crops non feature type tables. There are alot of additional tables in a Oracle tablespace. This tries to remove some of them. If the schemaName is provided in the Constructor then the job of narrowing down tables will be mush easier. Otherwise there are alot of Meta tables and SDO tables to cull. This method tries to remove as many as possible.

Overrides:
allowTable in class JDBC1DataStore
Parameters:
tablename - A table name to check.
Returns:
True if the table should be exposed as a FeatureType, false if it should be ignored.
See Also:
JDBC1DataStore.allowTable(java.lang.String)

buildAttributeType

protected AttributeType buildAttributeType(java.sql.ResultSet rs)
                                    throws java.io.IOException
Overrides the buildAttributeType method to check for SDO_GEOMETRY columns.

Overrides:
buildAttributeType in class JDBC1DataStore
Parameters:
rs - The ResultSet containing the result of a DatabaseMetaData.getColumns call.
Returns:
The AttributeType built from the ResultSet or null if the column should be excluded from the schema.
Throws:
java.io.IOException - If an error occurs processing the ResultSet.
See Also:
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10826.pdf TODO: Determine the specific type of the geometry.

determineCRS

protected org.opengis.referencing.crs.CoordinateReferenceSystem determineCRS(int srid)
                                                                      throws java.io.IOException
Throws:
java.io.IOException

determineSRID

protected int determineSRID(java.lang.String tableName,
                            java.lang.String geometryColumnName)
                     throws java.io.IOException
Description copied from class: JDBC1DataStore
Provides a hook for subclasses to determine the SRID of a geometry column.

This allows SRIDs to be determined in a Vendor specific way and to be cached by the default implementation. To retreive these srids, get the FeatureTypeInfo object for the table and call getSRID(geometryColumnName). This will allow storage of SRIDs for multiple geometry columns in each table.

If no SRID can be found, subclasses should return -1. The default implementation always returns -1.

Overrides:
determineSRID in class JDBC1DataStore
Parameters:
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.
Returns:
The SRID for the geometry column in the table or -1.
Throws:
java.io.IOException
See Also:
JDBC1DataStore.determineSRID(java.lang.String, java.lang.String)

getSqlBuilder

public SQLBuilder getSqlBuilder(java.lang.String typeName)
                         throws java.io.IOException
Description copied from class: JDBC1DataStore
Hook for subclass to return a different sql builder.

Overrides:
getSqlBuilder in class JDBC1DataStore
Parameters:
typeName - The typename for the sql builder.
Returns:
A new sql builder.
Throws:
java.io.IOException - if anything goes wrong.
See Also:
JDBC1DataStore.getSqlBuilder(java.lang.String)

getGeometryAttributeIO

protected AttributeIO getGeometryAttributeIO(AttributeType type,
                                             QueryData queryData)
                                      throws java.io.IOException
Description copied from class: JDBC1DataStore
Hook to create the geometry attribute IO for a vendor specific data source.

Specified by:
getGeometryAttributeIO in class JDBC1DataStore
Parameters:
type - The AttributeType to read.
queryData - The connection holder
Returns:
The AttributeIO that will read and write the geometry from the results.
Throws:
java.io.IOException - DOCUMENT ME!
See Also:
JDBC1DataStore.getGeometryAttributeIO(org.geotools.feature.AttributeType, org.geotools.data.jdbc.QueryData)

createFeatureWriter

protected JDBCFeatureWriter createFeatureWriter(FeatureReader fReader,
                                                QueryData queryData)
                                         throws java.io.IOException
Returns a Oracle text based feature writer that just issues the sql statements directly, as text. Jody and Sean say things will go faster if we use updatable resultsets and all that jazz, but I can't get those to work, and this does, so I'm going forth with it.

Overrides:
createFeatureWriter in class JDBC1DataStore
Throws:
java.io.IOException
Task:
TODO: Comment out this method and try out the default JDBC FeatureWriter - Jody thinks it will go faster. It will need to be debugged, however, as it would not work.

getEnvelope

public com.vividsolutions.jts.geom.Envelope getEnvelope(java.lang.String typeName)
Retrieve approx bounds of all Features.

This result is suitable for a quick map display, illustrating the data. This value is often stored as metadata in databases such as oraclespatial.

Overrides:
getEnvelope in class JDBC1DataStore
Returns:
null as a generic implementation is not provided.


Copyright © GeoTools. All Rights Reserved.