Chris, Jody, ...
 
I'm following up with the Oracle Geometry thread from about a month ago. At this time I didn't know how to insert a null geometry into Oracle through JDBC. After trying a couple combination of the setNull method, I figured it out.
 
Here's my code snippet, this will work the same with the Geotools Encoder.

if(geom != null){

       OraWriter ow = (new OraWriter((OracleConnection)connection));

       ow.setSRID(1000003005);

       proc.setObject( param++, ow.write(geom));

}else{

       proc.setNull( param++, Types.STRUCT, "MDSYS.SDO_GEOMETRY");

}

 
Cheers,
 
David

Reply via email to