|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(JDBC1DataStore 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. |
FeatureCollection |
getFeatures()
Retrieve all Features |
FeatureCollection |
getFeatures(Filter filter)
Retrieve all Feature matching the Filter |
FeatureCollection |
getFeatures(Query request)
Provides an interface to for the Resutls of a Query. |
JDBC1DataStore |
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(JDBC1DataStore 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 servedMethod Detail |
public DataStore getDataStore()
getDataStore
in interface FeatureSource
FeatureSource.getDataStore()
public JDBC1DataStore getJDBCDataStore()
Subclass must implement
public void addFeatureListener(FeatureListener listener)
addFeatureListener
in interface FeatureSource
listener
- FeatureSource.addFeatureListener(org.geotools.data.FeatureListener)
public void removeFeatureListener(FeatureListener listener)
removeFeatureListener
in interface FeatureSource
listener
- FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener)
public Transaction getTransaction()
For a plain JDBCFeatureSource that cannot modify this will always be Transaction.AUTO_COMMIT.
public FeatureCollection 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 FeatureSource
request
-
java.io.IOException
FeatureSource.getFeatures(org.geotools.data.Query)
public FeatureCollection getFeatures(Filter filter) throws java.io.IOException
getFeatures
in interface FeatureSource
filter
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!public FeatureCollection getFeatures() throws java.io.IOException
getFeatures
in interface FeatureSource
java.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 FeatureSource
java.io.IOException
- DOCUMENT ME!public com.vividsolutions.jts.geom.Envelope getBounds(Query query) throws java.io.IOException
Currently returns null, consider getFeatures( query ).getBounds() instead.
Subclasses may override this method to perform the appropriate optimization for this result.
getBounds
in interface FeatureSource
query
- Query we are requesting the bounds of
java.io.IOException
- DOCUMENT ME!public int getCount(Query query) throws java.io.IOException
SQL: SELECT COUNT(*) as cnt FROM table WHERE filter
getCount
in interface FeatureSource
query
- Query we are requesting the count of
java.io.IOException
- if there are errors getting the countpublic 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.
SQL: SELECT COUNT(*) as cnt FROM table WHERE filter
query
- transaction
-
java.io.IOException
- Usual on the basis of a filter errorpublic FeatureType getSchema()
getSchema
in interface FeatureSource
FeatureSource.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 |