0

我的选择查询是

sql.selectOrder=select STID,CLLTR from GSI_DEVL.POLLUX_DATA WHERE PROCESSED='FALSE'

我的路线是

<route id="markRowsAsProcessed-Route"  >
         <!--    <from uri="timer://markRowsAsProcessed?delay=5000"/>-->
        <from uri="sqlComponent:{{sql.selectOrder}}?consumer.useIterator=false" />   
        <doTry>
              <to uri="bean:rowProcessController"/>  
            <to uri="sqlComponent:{{sql.markRows}}?batch=true"/>
            <doCatch>
                <exception>java.sql.SQLException</exception>    
                <exception>java.lang.IllegalStateException</exception>
                <exception>java.sql.SQLException</exception>
                <exception>java.lang.ClassCastException</exception> 
            </doCatch>
        </doTry>    
    </route>

我的豆是

public class RowProcessController {
    List<Map<String, Object>> stationUnMarkedList = new ArrayList<Map<String, Object>>();
    List<Map<String, Object>> stationMarkedList = new ArrayList<Map<String, Object>>();
    Map<String,Object> stationMap = null;

    @SuppressWarnings("unchecked")
    @Handler
    public List<Map<String, Object>> markRowAsProcessed(Exchange exchange)
    {
        stationUnMarkedList = (List<Map<String, Object>>)exchange.getIn().getBody();
        for(Map<String,Object> data: stationMarkedList) {
            System.out.println(data.get("STID"));
            stationMap=new HashMap<String,Object>();
            stationMap.put("stationId", ((String)data.get("STID")));
            stationMap.put("callLetter", ((String)data.get("CLLTR")));
            stationMarkedList.add(stationMap);
        }
        return stationMarkedList;
    }
}

我想将结果集处理列更新为完成或某个值。

我试过了

sql.markRows=UPDATE POLLUX_DATA SET PROCESSED='DONE' where stid=:stationId

但这不会更新数据库中的任何值。为什么不?

4

1 回答 1

0

您可以尝试将查询的命名参数表示法更改为 :# 而不是:

sql.markRows=UPDATE POLLUX_DATA SET PROCESSED='DONE' where stid=:#stationId

于 2016-01-21T15:14:10.690 回答