cols = new String[4];
cols[0] = new String("OBJECTID");
cols[1] = layer.getSpatialColumn();
cols[2] = new String("NAME");
cols[3] = new String("IMAGETYPE");
} else {
cols = new String[3];
cols[0] = new String("OBJECTID");
cols[1] = layer.getSpatialColumn();
cols[2] = new String("NAME");
}
System.out.println("cols.length : " + cols.length);
SeQuery query = new SeQuery(conn, cols, sqlConstruct );
query.prepareQuery();
query.execute();
return query;
}
SDE信息删除操作
/**
*
* 删除 通过列对应的值
* @param id 值
* @param column 列
* @param tbName 表名
* @throws SeException
*/
public void deletePointObject(String id, String column, String tbName) throws SeException {
SeConnection conn = null;
SeLayer layer = null;
try {
conn = this.getConnection();
layer = new SeLayer(conn, tbName, "SHAPE"); // 得到对应图层
if (layer == null) {
throw new Exception("找不到空间表:" + tbName);
}
conn.startTransaction();
delete = new SeDelete(conn);
delete.fromTable(layer.getName(), column + "='" + id+"'");
conn.commitTransaction();
} catch (Exception ex) {
conn.rollbackTransaction();
} finally {
if (delete != null) {
try {
delete.close();
} catch (SeException e) {
e.printStackTrace();
throw e;
} finally {
if (conn != null) {
conn.close();
}
}
}
}
}