you never call establishConnection in your Dao class.
As result of this con is null.
add the method establishConnection in the constructor of personDao:
public personDao(){
establishConnection();
}
and try it again.
Furthermore read the Java code conventions.
A class name should start with uppercase: PersonDao would by correct and it follows the Camelcase code conventions.
you never call
establishConnectionin yourDaoclass. As result of thisconis null.add the method
establishConnectionin theconstructorofpersonDao:and try it again.
Furthermore read the
Java code conventions. A class name should start with uppercase:PersonDaowould by correct and it follows theCamelcasecode conventions.