It would be great if this forum helps me in the right direction.
A first step in the right direction would be to not be dealing with result sets in the JSP page at all. Factor such processing out into a controller servlet. And check out the Model 2/MVC pattern for web applications.
Your problem could be calling rs.getString() twice on the same column. Save the value received from rs.getString() in a variable, and then use it twice. As Bear suggested, check out the MVC pattern, and try to keep your JDBC code out of JSPs, it will make debugging and maintenance much easier.
The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny GillTweets