...and how/when is it set? Something is going wrong with how you use it. Either there has been a problem establishing a connection (are there any stacktraces?) or you are using it incorrectly (e.g. there is an open connection step you are missing).
The problem is with the con.Con is null. The connection is not estabilished thats why its throwing NPE. Pl post the dbModel.java class also so that we can find out how you are estabilishing the connection.
So that is your NullPointerException. Well, we already know what causes that: the variable "con" is null. If there are no other exception messages then we can assume you are doing something wrong how you use con. Can you show use the code where con is initialised?
Originally posted by vedha vas: Hi Rajkumar balakrishnan ,
In the checkSession method, in the try part first call the valueBound(event) method after that start with the code: ps=con.prepareStatement(SQL2); ps.setString(1,sname);
You should not be calling these methods directly. DBModel implements HttpSessionBindingEvent so will be called when a session binding event occurs. Presumably the pattern is to open a single connection for a single user when their session is bound?