Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Creation of Pipelined SQL/NOSQL Queries in Java
- Query query1 = "select customer.id from customer where customer.name = 'ABC'";
- Query query2 = "select account.id from account where account.custid in {$1}";
- // $1 will be the input of second query
- from(query1).inputto(query2).printOutput();
- from("direct:start")
- .setBody(constant("select customer.id as ID from customer where customer.name = 'ABC'"))
- .to("jdbc:myDataSource")
- //now, use simple/ognl to extract the first result and the 'ID' from the Map in the body
- .setBody(simple("select account.id from account where account.custid in ${body[0][ID]}"))
- .to("jdbc:myDataSource")
- .log("ACCOUNT IDS = ${body}");
Add Comment
Please, Sign In to add comment