Does it throw an Exception? Is there a reason why are you incrementing the i variable in the loop in which you iterate over the ResultSet? FWIW, while i don't know the nature of what you are...