现在有一个Flux<List<Map<String, Object>>>
,我想将每个Map<String, Object>
插入数据库。
数据库操作(我用的不是r2dbc而是rxjava2-jdbc):</p>
public Mono<Integer> DBInsert(Map<String, Object> item) {
try {
String createSql =
"INSERT INTO TESTTABLE (ID, PICID) VALUES (?, ?)";
Flowable<Integer> counts = instance
.getDB()
.update(createSql)
.parameters(item.get("id"),item.get("picId"))
.counts();
return Mono.from(counts);
} catch (Throwable e) {
e.printStackTrace();
throw new RuntimeException();
}
}
我需要得到结果。