|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.data.jdbc.JDBCFeatureSource
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:
| Constructor Summary | |
JDBCFeatureSource(JDBCDataStore jdbcDataStore,
FeatureType featureType)
JDBCFeatureSource creation. |
|
| Method Summary | |
void |
addFeatureListener(FeatureListener listener)
Adds FeatureListener to the JDBCDataStore against this FeatureSource. |
protected void |
close(java.sql.Connection conn,
Transaction trans,
java.sql.SQLException sqle)
|
protected void |
close(java.sql.ResultSet rs)
|
protected void |
close(java.sql.Statement statement)
|
int |
count(Query query,
Transaction transaction)
Direct SQL query number of rows in query. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
Retrieve Bounds of all Features. |
com.vividsolutions.jts.geom.Envelope |
getBounds(Query query)
Retrieve Bounds of Query results. |
protected java.sql.Connection |
getConnection()
|
int |
getCount(Query query)
Retrieve total number of Query results. |
DataStore |
getDataStore()
Retrieve DataStore for this FetureSource. |
FeatureResults |
getFeatures()
Retrieve all Features |
FeatureResults |
getFeatures(Filter filter)
Retrieve all Feature matching the Filter |
FeatureResults |
getFeatures(Query request)
Provides an interface to for the Resutls of a Query. |
JDBCDataStore |
getJDBCDataStore()
Allows access to JDBCDataStore(). |
FeatureType |
getSchema()
Retrieve FeatureType represented by this FeatureSource |
Transaction |
getTransaction()
Retrieve the Transaction this FeatureSource is opperating against. |
void |
removeFeatureListener(FeatureListener listener)
Remove FeatureListener to the JDBCDataStore against this FeatureSource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JDBCFeatureSource(JDBCDataStore jdbcDataStore,
FeatureType featureType)
Constructs a FeatureStore that opperates against the provided jdbcDataStore to serve up the contents of featureType.
jdbcDataStore - DataStore containing contentsfeatureType - FeatureType being served| Method Detail |
public DataStore getDataStore()
getDataStore in interface FeatureSourceFeatureSource.getDataStore()public JDBCDataStore getJDBCDataStore()
Subclass must implement
public void addFeatureListener(FeatureListener listener)
addFeatureListener in interface FeatureSourcelistener - FeatureSource.addFeatureListener(org.geotools.data.FeatureListener)public void removeFeatureListener(FeatureListener listener)
removeFeatureListener in interface FeatureSourcelistener - FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener)public Transaction getTransaction()
For a plain JDBCFeatureSource that cannot modify this will always be Transaction.AUTO_COMMIT.
public FeatureResults getFeatures(Query request)
throws java.io.IOException
Various queries can be made against the results, the most basic being to retrieve Features.
getFeatures in interface FeatureSourcerequest - a datasource query object. It encapsulates requested
information, such as typeName, maxFeatures and filter.
java.io.IOExceptionFeatureSource.getFeatures(org.geotools.data.Query)
public FeatureResults getFeatures(Filter filter)
throws java.io.IOException
getFeatures in interface FeatureSourcefilter - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
public FeatureResults getFeatures()
throws java.io.IOException
getFeatures in interface FeatureSourcejava.io.IOException - DOCUMENT ME!
public com.vividsolutions.jts.geom.Envelope getBounds()
throws java.io.IOException
Currently returns null, consider getFeatures().getBounds() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getBounds in interface FeatureSourcejava.io.IOException - DOCUMENT ME!public com.vividsolutions.jts.geom.Envelope getBounds(Query query)
Currently returns null, consider getFeatures( query ).getBounds() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getBounds in interface FeatureSourcequery - Query we are requesting the bounds of
public int getCount(Query query)
Currently returns -1, consider getFeatures( query ).getCount() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getCount in interface FeatureSourcequery - Query we are requesting the count of
public int count(Query query,
Transaction transaction)
throws java.io.IOException
Note this is a low level SQL statment and if it fails the provided Transaction will be rolled back.
Will return -1 if optimization can not be used
query - transaction -
java.io.IOException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!public FeatureType getSchema()
getSchema in interface FeatureSourceFeatureSource.getSchema()
protected java.sql.Connection getConnection()
throws java.io.IOException
java.io.IOException
protected void close(java.sql.Connection conn,
Transaction trans,
java.sql.SQLException sqle)
protected void close(java.sql.ResultSet rs)
protected void close(java.sql.Statement statement)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||