How to use apache camel to read data from mysql table and write into another table

坚强是说给别人听的谎言 提交于 2019-12-05 19:11:18

the camel-jdbc component expects SQL text, so the body should contain an insert statement...

so, you need to parse the results from your select stmt which returns ArrayList<HashMap<String, Object>>...the split() gets you to HashMap<String, Object>, so you can extract those map values using camel-simple...

something like this...

.setBody(simple("insert into employee values('${body[id]','${body[name]}')"))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!