Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用jdbc的Spring集成轮询器_Spring_Jdbc - Fatal编程技术网

使用jdbc的Spring集成轮询器

使用jdbc的Spring集成轮询器,spring,jdbc,Spring,Jdbc,想要实现一些事情,比如 <int-jdbc:inbound-channel-adapter id="selectNUpdate" query="select * from table1 where col1='abc' and rownum=1" update="update table1 set col2=0 where id in (:id)" data-source="dataSource"> <int:poller max-messag

想要实现一些事情,比如

<int-jdbc:inbound-channel-adapter id="selectNUpdate" 
    query="select * from table1 where col1='abc' and rownum=1"
    update="update table1 set col2=0 where id in (:id)"
    data-source="dataSource">
    <int:poller max-messages-per-poll="1"
        fixed-rate="3000" /> 
</int-jdbc:inbound-channel-adapter>
我只想执行一个select查询,并根据记录更新同一表中的记录。 问题是:在上面的SpringXML中,若我不给出channel=则它会失败,异常情况是订户通道未配置


实现这一点的方法是什么,即使用jdbc进行选择和更新的一些轮询器不清楚为什么不能直接使用JdbcTemplate进行选择和更新


但是为了回答你的问题,我可以建议使用内置的nullChannel

谢谢Artem。你能推荐一些东西吗谢谢Artem它为我做的工作。。。。你能推荐一些好的Spring集成教程吗?抱歉,回复太晚了。如果有效,请接受答案,结束问题。SpringIO站点是一个很好的教程。好书是《Spring集成在行动》