Anu, To answer the second part of your question, if you use executeQuery again on the *same* statement, it will close the previous ResultSet. So no, you can't use another ResultSet from the SAME STATEMENT in a loop over a prior ResultSet. However, there's nothing preventing you from using multiple statements within a connection. I'm wondering what this has to do with Servlets. Perhaps it would be better continued in a different category?