org.geotools.data.jdbc
Class JDBCFeatureSource

Object
  extended by JDBCFeatureSource
All Implemented Interfaces:
FeatureSource<SimpleFeatureType,SimpleFeature>
Direct Known Subclasses:
DB2FeatureSource, JDBCFeatureStore

Deprecated. scheduled for removal in 2.7, use classes in org.geotools.jdbc

public class JDBCFeatureSource
extends Object
implements FeatureSource<SimpleFeatureType,SimpleFeature>

A JDBCFeatureSource that can opperate as a starting point for your own implementations.

This class is distinct from the AbstractFeatureSource implementations as JDBC provides us with so many opertunities for optimization.

Client code must implement: It is recomended that clients implement optimizations for:

Author:
Jody Garnett, Refractions Research
Module:
modules/library/jdbc (gt-jdbc.jar)

Nested Class Summary
protected  class JDBCFeatureSource.JDBCQueryCapabilities
          Deprecated. A default QueryCapabilities implementation for JDBCFeatureSource with template methods JDBCFeatureSource subclasses may override.
 
Field Summary
protected  QueryCapabilities queryCapabilities
          Deprecated.  
 
Constructor Summary
JDBCFeatureSource(JDBC1DataStore jdbcDataStore, SimpleFeatureType featureType)
          Deprecated. JDBCFeatureSource creation.
 
Method Summary
 void addFeatureListener(FeatureListener listener)
          Deprecated. Adds FeatureListener to the JDBCDataStore against this FeatureSource.
protected  void close(Connection conn, Transaction trans, SQLException sqle)
          Deprecated.  
protected  void close(ResultSet rs)
          Deprecated.  
protected  void close(Statement statement)
          Deprecated.  
 int count(Query query, Transaction transaction)
          Deprecated. Direct SQL query number of rows in query.
 ReferencedEnvelope getBounds()
          Deprecated. Retrieve Bounds of all Features.
 ReferencedEnvelope getBounds(Query query)
          Deprecated. Retrieve Bounds of Query results.
protected  Connection getConnection()
          Deprecated.  
 int getCount(Query query)
          Deprecated. Retrieve total number of Query results.
 DataStore getDataStore()
          Deprecated. Retrieve DataStore for this FetureSource.
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures()
          Deprecated. Retrieve all Features
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Filter filter)
          Deprecated. Retrieve all Feature matching the Filter
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Query request)
          Deprecated. Provides an interface to for the Resutls of a Query.
 ResourceInfo getInfo()
          Deprecated. Information describing the contents of this resoruce.
 JDBC1DataStore getJDBCDataStore()
          Deprecated. Allows access to JDBCDataStore().
 Name getName()
          Deprecated. Returns the same name than the feature type (ie, getSchema().getName() to honor the simple feature land common practice of calling the same both the Features produces and their types
 QueryCapabilities getQueryCapabilities()
          Deprecated. Returns the default jdbc query capabilities, subclasses should override to advertise their specific capabilities where they differ.
 SimpleFeatureType getSchema()
          Deprecated. Retrieve FeatureType represented by this FeatureSource
 Set getSupportedHints()
          Deprecated. By default, only detached feature is supported
 Transaction getTransaction()
          Deprecated. Retrieve the Transaction this FeatureSource is opperating against.
 void removeFeatureListener(FeatureListener listener)
          Deprecated. Remove FeatureListener to the JDBCDataStore against this FeatureSource.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryCapabilities

protected QueryCapabilities queryCapabilities
Deprecated. 
Constructor Detail

JDBCFeatureSource

public JDBCFeatureSource(JDBC1DataStore jdbcDataStore,
                         SimpleFeatureType featureType)
Deprecated. 
JDBCFeatureSource creation.

Constructs a FeatureStore that opperates against the provided jdbcDataStore to serve up the contents of featureType.

Parameters:
jdbcDataStore - DataStore containing contents
featureType - FeatureType being served
Method Detail

getName

public Name getName()
Deprecated. 
Returns the same name than the feature type (ie, getSchema().getName() to honor the simple feature land common practice of calling the same both the Features produces and their types

Specified by:
getName in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
the name of the AttributeDescriptor for the Features served by this FeatureSource
Since:
2.5
See Also:
FeatureSource.getName()

getInfo

public ResourceInfo getInfo()
Deprecated. 
Description copied from interface: FeatureSource
Information describing the contents of this resoruce.

Please note that for FeatureContent:


getDataStore

public DataStore getDataStore()
Deprecated. 
Retrieve DataStore for this FetureSource.

Specified by:
getDataStore in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
DataStore implementing this FeatureStore
See Also:
FeatureSource.getDataStore()

getJDBCDataStore

public JDBC1DataStore getJDBCDataStore()
Deprecated. 
Allows access to JDBCDataStore(). Description

Subclass must implement

Returns:
JDBDataStore managing this FeatureSource

addFeatureListener

public void addFeatureListener(FeatureListener listener)
Deprecated. 
Adds FeatureListener to the JDBCDataStore against this FeatureSource.

Specified by:
addFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
listener -
See Also:
FeatureSource.addFeatureListener(org.geotools.data.FeatureListener)

removeFeatureListener

public void removeFeatureListener(FeatureListener listener)
Deprecated. 
Remove FeatureListener to the JDBCDataStore against this FeatureSource.

Specified by:
removeFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
listener -
See Also:
FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener)

getTransaction

public Transaction getTransaction()
Deprecated. 
Retrieve the Transaction this FeatureSource is opperating against.

For a plain JDBCFeatureSource that cannot modify this will always be Transaction.AUTO_COMMIT.

Returns:
DOCUMENT ME!

getFeatures

public FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Query request)
                                                               throws IOException
Deprecated. 
Provides an interface to for the Resutls of a Query.

Various queries can be made against the results, the most basic being to retrieve Features.

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
request -
Returns:
Collection The collection to put the features into.
Throws:
IOException
See Also:
FeatureSource.getFeatures(org.geotools.data.Query)

getFeatures

public FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Filter filter)
                                                               throws IOException
Deprecated. 
Retrieve all Feature matching the Filter

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
filter - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!

getFeatures

public FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures()
                                                               throws IOException
Deprecated. 
Retrieve all Features

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!

getBounds

public ReferencedEnvelope getBounds()
                             throws IOException
Deprecated. 
Retrieve Bounds of all Features.

Currently returns null, consider getFeatures().getBounds() instead.

Subclasses may override this method to perform the appropriate optimization for this result.

Specified by:
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
null representing the lack of an optimization
Throws:
IOException - DOCUMENT ME!

getBounds

public ReferencedEnvelope getBounds(Query query)
                             throws IOException
Deprecated. 
Retrieve Bounds of Query results.

Currently returns null, consider getFeatures( query ).getBounds() instead.

Subclasses may override this method to perform the appropriate optimization for this result.

Specified by:
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
query - Query we are requesting the bounds of
Returns:
null representing the lack of an optimization
Throws:
IOException - DOCUMENT ME!

getCount

public int getCount(Query query)
             throws IOException
Deprecated. 
Retrieve total number of Query results.

SQL: SELECT COUNT(*) as cnt FROM table WHERE filter

Specified by:
getCount in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
query - Query we are requesting the count of
Returns:
Count of indicated query
Throws:
IOException - if there are errors getting the count

count

public int count(Query query,
                 Transaction transaction)
          throws IOException
Deprecated. 
Direct SQL query number of rows in query.

Note this is a low level SQL statement and if it fails the provided Transaction will be rolled back.

SQL: SELECT COUNT(*) as cnt FROM table WHERE filter

Parameters:
query -
transaction -
Returns:
Number of rows in query, or -1 if not optimizable.
Throws:
IOException - Usual on the basis of a filter error

getSchema

public SimpleFeatureType getSchema()
Deprecated. 
Retrieve FeatureType represented by this FeatureSource

Specified by:
getSchema in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
FeatureType for FeatureSource
See Also:
FeatureSource.getSchema()

getConnection

protected Connection getConnection()
                            throws IOException
Deprecated. 
Throws:
IOException

close

protected void close(Connection conn,
                     Transaction trans,
                     SQLException sqle)
Deprecated. 

close

protected void close(ResultSet rs)
Deprecated. 

close

protected void close(Statement statement)
Deprecated. 

getSupportedHints

public Set getSupportedHints()
Deprecated. 
By default, only detached feature is supported

Specified by:
getSupportedHints in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
a set of RenderingHints#Key objects (eventually empty, never null).

getQueryCapabilities

public QueryCapabilities getQueryCapabilities()
Deprecated. 
Returns the default jdbc query capabilities, subclasses should override to advertise their specific capabilities where they differ.

For instance, the capabilities returned:

Specified by:
getQueryCapabilities in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
a QueryCapabilities object containing the native query capabilities.
See Also:
FeatureSource.getQueryCapabilities()


Copyright © 1996-2010 Geotools. All Rights Reserved.