Regarding postgres, you need to copy the lib file in classpath in case of
webapplication need to copy to the tomcat common lib folder also.
One more thing please check the permission in postgres with pg_hba.conf file.
Also i not able to do please give us what error you are getting