This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one 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.