Have you tried to print what there is in ResultSet?
have you tried something like that if you are writing JDBC code in a JSP-
A ResultSet points to its current row of data. Initially the cursor is positioned before the first row. The next method moves the pointer to the next row, and because it returns false when there are no more rows in the ResultSet object.
Joined: Apr 05, 2011
Thanks Ankit. I think that your example is the way to do it. My problem is that right now I can only read. I can't test my code becuse my school's Tomcat server is down.
If you know for sure that there will be at most one row in your result set you can replace the "while" with an "if":
If you know for sure there will always be exactly one result, like in this case, you can even skip the if and just call rs.next() once: