Navdeep,
I guess your solution will work. As this is the receiver JDBC scenario I didn't write any select query and don't know where to write because if it a sender JDBC there is a provision in communication channel where i can write select & update query. Here I don't know where to write and test. Please help me how to achieve it.