问题描述:

I want to create an Oracle Spatial Geometry over JDBC with the following Statement:

 //insert vorbereiten

try {

preStatement = conn.prepareStatement("insert into way(id, shape) "

+ "values(? ,SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(?)))");

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

try {

System.out.println("setString:");

preStatement.setString(1, "1");

Array a=conn.createArrayOf("double", new Object[]{9.23, 52.45, 9.67, 52.54});

preStatement.setArray(2, a);

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

But this does not work. Can someone please tell me how I can set the SDO_ORDINATE_ARRAY(?)-Values ?

相关阅读:
Top