Hi,

I have route where in i process some data, I want this processed data to be
used as input  to the uri which will insert to the table.

rom("timer://Timer?period=55000")
            .setBody(constant(metaDataBuff.toString()))
            .to("jdbc:myDataSource") 
            .process(new Processor() {
                   public void process(Exchange exchange) throws Exception {
                       
                       ArrayList<HashMap> results =
(ArrayList<HashMap>)exchange.getIn().getBody();
                       exchange.getIn().setBody(" ");
                       for (int i = 0; i < results.size(); i++)
                       {
                           //exchange.getIn().setBody("Hello "+body);
                           HashMap result = results.get(i);
                         JsonArray   arr =
RowCreatorRuleMatcher.Match(result,dataRuleMap,arr);
                        //   System.out.println(insBuff.toString());
                               
                       }
                       System.out.println(arr.toString());
                       exchange.getIn().setBody(arr);
                       //System.out.println(insBuff.toString());
                  }
            })
            .marshal()
            .json(JsonLibrary.Jackson)
            .setBody(constant(insBuff.toString()))
            .to("jdbc:myDataSource");



--
View this message in context: 
http://camel.465427.n5.nabble.com/Retriving-data-from-json-and-inserting-to-the-tables-tp5781641.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to