在java中可以通过KSQL.select或者SQL.select返回Table,可以直接修改Table中的数据,然后保存,数据库中的数据就会更新
参考如下:
public static void table(){
String ksql = "select rq.* from AP_RQ rq where rq.fName = 'noticeTest'";
Table table = KSQL.select(ksql, null,"/appdemo/test/data", null);
Iterator<Row> it = table.iterator();
while (it.hasNext()) {
Row row = (Row) it.next();
row.setString("fCode", row.getValue("fCode")+"test") ;
}
table.getMetaData().setStoreByConcept("AP_RQ",true);
table.save("/appdemo/test/data");
}
评一波