org.geotools.data.oracle
Class OracleFeatureWriter

java.lang.Object
  extended by org.geotools.data.jdbc.JDBCFeatureWriter
      extended by org.geotools.data.jdbc.JDBCTextFeatureWriter
          extended by org.geotools.data.oracle.OracleFeatureWriter
All Implemented Interfaces:
FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>

public class OracleFeatureWriter
extends JDBCTextFeatureWriter

Subclasses JDBCTextFeatureWriter to issue Oracle transactions directly as sql text statements. The super class takes care of all the nasty details, this just returns the encoded geometry. To get some speed increases Jody maintains that this class should not be used, that the updatable result sets of JDBCFeatureWriter will work better. But I couldn't get those to work at all, whereas this works great for me. We could also consider putting the option for this or jdbc in the factory for OracleDataStore. Should also consider using prepared statements for inserts, as they should work faster - this should probably be done in the superclass.

Version:
$Id: OracleFeatureWriter.java 30921 2008-07-05 07:51:23Z jgarnett $
Author:
Chris Holmes, TOPP

Field Summary
 
Fields inherited from class org.geotools.data.jdbc.JDBCTextFeatureWriter
mapper
 
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureWriter
closed, current, fidAttributes, live, queryData, reader
 
Constructor Summary
OracleFeatureWriter(FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> fReader, QueryData queryData)
           
 
Method Summary
protected  void doInsert(MutableFIDFeature current)
          Override that uses sql prepaired statements to perform the operation.
protected  void doUpdate(org.opengis.feature.simple.SimpleFeature live, org.opengis.feature.simple.SimpleFeature current)
          Override that uses sql statements to perform the operation.
protected  java.lang.String getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom, int srid)
          Turns a geometry into the textual version needed for the sql statement
 
Methods inherited from class org.geotools.data.jdbc.JDBCTextFeatureWriter
addQuotes, getGeometryInsertText, makeDeleteSql, makeInsertSql, makeSelectForUpdateSql, makeUpdateSql, remove, useQueryDataForInsert
 
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureWriter
close, encodeColumnName, encodeName, getFeatureType, hasNext, next, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleFeatureWriter

public OracleFeatureWriter(FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> fReader,
                           QueryData queryData)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getGeometryInsertText

protected java.lang.String getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom,
                                                 int srid)
                                          throws java.io.IOException
Description copied from class: JDBCTextFeatureWriter
Turns a geometry into the textual version needed for the sql statement

Specified by:
getGeometryInsertText in class JDBCTextFeatureWriter
Throws:
java.io.IOException

doUpdate

protected void doUpdate(org.opengis.feature.simple.SimpleFeature live,
                        org.opengis.feature.simple.SimpleFeature current)
                 throws java.io.IOException,
                        java.sql.SQLException
Override that uses sql statements to perform the operation.

Overrides:
doUpdate in class JDBCTextFeatureWriter
Throws:
java.io.IOException
java.sql.SQLException
See Also:
org.geotools.data.jdbc.JDBCFeatureWriter#doUpdate(org.geotools.feature.Feature, org.geotools.feature.Feature)

doInsert

protected void doInsert(MutableFIDFeature current)
                 throws java.io.IOException,
                        java.sql.SQLException
Override that uses sql prepaired statements to perform the operation.

Overrides:
doInsert in class JDBCTextFeatureWriter
Throws:
java.io.IOException
java.sql.SQLException
See Also:
JDBCFeatureWriter.doInsert(org.geotools.data.jdbc.MutableFIDFeature)


Copyright © 1996-2010 Geotools. All Rights Reserved.