* Pass a geometry representation through the SQL server via prepared
* statement
*/
private static Geometry viaPrepSQL(Geometry geom, Connection conn) throws SQLException {
PreparedStatement prep = conn.prepareStatement("SELECT ?::geometry");
JtsGeometry wrapper = new JtsGeometry(geom);
prep.setObject(1, wrapper, Types.OTHER);
ResultSet rs = prep.executeQuery();
rs.next();
JtsGeometry resultwrapper = ((JtsGeometry) rs.getObject(1));
return resultwrapper.getGeometry();
}