Does anyone have any experience with Oracle spatial using JDBC and 
sdo_cs.transform?

If I execute the following SQL statement using a tool such as TOAD then 
I get a correct value for the point in the oracle column.

INSERT INTO node (id, position) VALUES (53, 
SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, 26910, SDO_POINT_TYPE(489535.0, 
5457841.0, NULL), NULL, NULL), 4269))

Point geometry:
(2001, 4269, (-123.143865452971, 49.2732377100255, ), , )

If I execute the same statement using JDBC in a Statement or 
PreparedStatement the Point in the oracle column has 0,0 for the 
coordinates.

Point: geometry
(2001, 4269, (0, 0, ), , )

In both cases the SQL is exactly the same.

my JDBC code is

String insertSql = "INSERT INTO node (id, position) VALUES (" + id
+ ", SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, " + geometrySrid
+ ", SDO_POINT_TYPE(" + coordinate2d.x + ", " + coordinate2d.y
+ ", NULL), NULL, NULL), " + srid + "))";
Statement insertStatement = connection.createStatement();
try {
insertStatement.execute(insertSql);
} finally {
JdbcUtils.closeStatement(insertStatement);
connection.commit();
}

Any ideas why this is happening?

I've tried to do the coordinate transformation in a separate call and 
pass in the STRUCT returned from that, using JGeometry to create a 
STRUCT for the value, using a WKT geometry and none of these approaches 
seem to work

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to