Store the values of rs14.getInt() and rs13.getInt() before using it. It reduces most of the confusion. which adds to further , as connect DB , html out all happening inside the
Servlet itself ( pretty awkward) !! change the design to atleast separate DB and View