The problem is in
con. In your constructor, you're assigning to a local variable, not to your instance field. I also would make
pstmt and
rs local variables, because you assign them, do stuff with them, and then close them. Outside of your method(s) they have no usable state.
Liutauras Vilda wrote:Check if these during the execution aren't null (lines based on your posted code: 57, 58).
Or even better, use try-with-resources. Using local variables instead of instance fields: