|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.jdbc.JDBCFeatureWriter org.geotools.data.jdbc.JDBCPSFeatureWriter
An abstract class that uses prepared statements to insert, update and delete features from the database. Useful when the resultset got from the database is not updatable, and to get peak performance thru the use of prepared statements and batch updates.
Assumptions made by the code:
Field Summary |
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureWriter |
closed, current, fidAttributes, listenerManager, live, queryData, reader |
Constructor Summary | |
JDBCPSFeatureWriter(FeatureReader fReader,
QueryData queryData)
Creates a new instance of JDBCFeatureWriter |
Method Summary | |
void |
close()
Release the underlying resources. |
protected java.sql.PreparedStatement |
createDeleteStatement(java.sql.Connection conn,
FeatureType featureType)
Creates the prepared statement for feature deletes |
protected java.sql.PreparedStatement |
createInsertStatement(java.sql.Connection conn,
FeatureType featureType)
Creates the prepared statement for feature inserts |
protected java.sql.PreparedStatement |
createUpdateStatement(java.sql.Connection conn,
FeatureType featureType)
Creates the prepared statement for feature updates |
protected void |
doInsert(MutableFIDFeature current)
Override that uses prepared statements to perform the operation. |
protected void |
doUpdate(Feature live,
Feature current)
Override that uses sql statements to perform the operation. |
protected abstract java.lang.String |
getGeometryPlaceHolder(AttributeType type)
Returns the placeholder for the geometry in the insert/update statement. |
protected void |
remove(MutableFIDFeature current)
Override that uses prepared statements to perform the operation. |
protected boolean |
useQueryDataForInsert()
This version does not use QueryData udpate/insert/remove methods, but uses separate prepared statements instead |
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureWriter |
getFeatureType, hasNext, next, remove, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCPSFeatureWriter(FeatureReader fReader, QueryData queryData) throws java.io.IOException
fReader
- queryData
-
java.io.IOException
Method Detail |
protected void doInsert(MutableFIDFeature current) throws java.io.IOException, java.sql.SQLException
doInsert
in class JDBCFeatureWriter
current
-
java.sql.SQLException
java.io.IOException
JDBCFeatureWriter.doInsert(org.geotools.data.jdbc.MutableFIDFeature)
protected java.sql.PreparedStatement createInsertStatement(java.sql.Connection conn, FeatureType featureType) throws java.sql.SQLException
conn
- featureType
-
java.sql.SQLException
protected abstract java.lang.String getGeometryPlaceHolder(AttributeType type)
type
-
protected void remove(MutableFIDFeature current) throws java.io.IOException, java.sql.SQLException
java.io.IOException
java.sql.SQLException
JDBCFeatureWriter.doInsert(org.geotools.data.jdbc.MutableFIDFeature)
protected java.sql.PreparedStatement createDeleteStatement(java.sql.Connection conn, FeatureType featureType) throws java.sql.SQLException
conn
- featureType
-
java.sql.SQLException
protected java.sql.PreparedStatement createUpdateStatement(java.sql.Connection conn, FeatureType featureType) throws java.sql.SQLException
conn
- featureType
-
java.sql.SQLException
protected void doUpdate(Feature live, Feature current) throws java.io.IOException, java.sql.SQLException
doUpdate
in class JDBCFeatureWriter
java.io.IOException
java.sql.SQLException
JDBCFeatureWriter.doUpdate(org.geotools.feature.Feature,
org.geotools.feature.Feature)
protected boolean useQueryDataForInsert()
useQueryDataForInsert
in class JDBCFeatureWriter
JDBCFeatureWriter.useQueryDataForInsert()
public void close() throws java.io.IOException
FeatureWriter
close
in interface FeatureWriter
close
in class JDBCFeatureWriter
java.io.IOException
FeatureWriter.close()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |