This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am trying to search for the cust id based on these three constraints. Will it work? Is it ok to use three columns to compare data?
"select cust id from customers where fname = ? and lname = ? and flatno = ?";
This looks like an ordinary parametrized query. I don't see anything ORM related here, so I am moving it to the JDBC forums. You can add as many restrictions as you would like in your where clause. However having a space in cust id looks suspect.