Originally posted by seema prakash:
3. I click on buttonCancel. Here I dispose the sks object and set it to null.This means the object is refering to null but it is present ?
No, it means the sks
variable is referring to null. The object that it used to refer to may still exist, or if nothing else refers to it then it may have been garbage collected. But you have no way of knowing about that.
4. Now I want to disconnect from the database. So, I want to check if skillSearch.sks.conn is null. It is at this point I get the null pointer exception.
what may be the reason? Where am I going wrong ? Please help.
If you are going to need the object that the sks variable refers to later, for example to check its "conn" attribute, then don't set sks to null.
Or you are calling the object's dispose() method; why isn't that closing the connection? Why do you need to check later?