hey i am writing a class file which takes values from database and adds them to arraylist and then a servlet uses those arraylist
to generate a web page..
the problem is that the servlet returns NULL POINTER EXCEPTION sometimes and sometimes the values are returned and are shown on the page.
usually this happens when i start the database and tomcat everything works fine but after refreshing the page 4-5 times or loading similar pages ..it starts to return NULL POINTER EXCEPTION ....i think this might be because of the fact that i am not closing the connections in the class file..
i am showing the code, can anyone suggest how to close connections according to this code.
Servlet
class file
thanks in advance