请教一下,我用的是SDE for Oracle,现在我想通过Java API将SDE数据库中的一个点对象修改掉(比如原来的坐标是(50,50),现在该为(100,100)).代码如下:
SeUpdate update = null;
SeShape shape = null;
try {
uid = row.getInteger(idex);
shape = (SeShape) row.getShape(0);
update = new SeUpdate(conn);
SeObjectId featureId = new SeObjectId(uid);
row = update.singleRow(featureId, geomTableName, cols);
int numPts = 1;
SDEPoint[] ptArray = new SDEPoint[numPts];
ptArray[0] = new SDEPoint(100,100);
shape.generatePoint(numPts, ptArray);
row.setShape(0,shape);
update.execute();
update.close();
} catch (SeException e) {
try {
update.close();
} catch (SeException se) {
System.out.println(se.getSeError().getErrDesc());
}
e.printStackTrace();
return false;
执行到update.execute()时抛出异常:
ArcSDE Error Number : -22
Error Description : SPECIFIED SHAPE - LAYER:FID DOESN'T EXIST.
com.esri.sde.sdk.client.SeException:
at com.esri.sde.sdk.client.j.a(Unknown Source)
at com.esri.sde.sdk.client.j.e(Unknown Source)
at com.esri.sde.sdk.client.j.r(Unknown Source)
at com.esri.sde.sdk.client.j.b(Unknown Source)
at com.esri.sde.sdk.client.SeStreamOp.execute(Unknown Source)
请教一下该如何解决啊。
------解决方案--------------------
shape = (SeShape) row.getShape(0);
shape没取到吧