Tom (JDi Solutions) wrote:
> Hi all,
>
> Using mainly the examples I've managed to get shapefile reading 
> working and am looping through each feature one at a time.  I now want 
> to write these to Oracle and have created a connection to the db which 
> is at least connecting fine but have a few questions...
>
>     * To make an exact copy of the table in another datastore
>       presumably you would first get the schema of the source using
>       getSchema() and then create that schema in the destination using
>       createSchema()?
>
Correct; I have an example of doing this for PostGIS (note that 
sometimes you need to adjust the feature type a bit to match what oracle 
can do)
>
>     * In the class OracleDataStore it says this method is "not
>       currently supported".  If it were supported should it take care
>       of actually creating the database table with the appropriate
>       field types?  If so I assume therefore there is no way in
>       geotools at present to create a db table in Oracle?
>
Why not take a look at the PostGISDataStore implementation and make this 
method for Oracle? It amounts to a create table statement and setting up 
a few metadata table entries...
>
>     * After that I'm a bit confused as to what to do next.  Assuming I
>       do have a table already the OracleDataStore class has a function
>       called createFeatureWriter.
>
FeatureStore.addFeatures( features ) will do the trick. Here is the 
example from the udig training course:
- 
http://svn.refractions.net/udig/udig/branches/1.1.x/udig/tutorials/net.refractions.udig.tutorials.shpexport/src/net/refractions/udig/tutorials/shpexport/ShpExportOp.java
>
>     *   This says it creates a text based feature writer which just
>       issues SQL direct to the db but how do I get the features I've
>       read from the shapefile into it?
>
What you are doing bellow looks okay; I am not sure exactly why it is 
not compiling for you....
Jody

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to