title: Connection pooling on a Tomcat 7
body: <p>I am having issues with implementing connection pooling on a tomcat7.
  For some reason tomcat is trying to connect with my machines username. I have been googlin it for a while now but without a luck.</p>
  
  <pre><code>org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory 
  (FATAL: role "caspinol" does not exist)
  Cant connect to db
  Log In failed: An Exception has occurred! java.lang.NullPointerException
  java.lang.NullPointerException
   at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)...
  </code></pre>
  
  <p>My context.xml looks as follows:</p>
  
  <pre><code>&lt;Resource auth="Container" name="jdbc/postgres" type="javax.sql.DataSource" user="biller" password="biller" 
              driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432" maxActive="150"
              schema="biller" maxIdle="4"/&gt;
  </code></pre>
  
  <p>And the web.xml:</p>
  
  <pre><code>&lt;resource-ref&gt;
      &lt;description&gt;postgreSQL Datasource&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/postgres&lt;/res-ref-name&gt;
      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
  &lt;/resource-ref&gt;
  </code></pre>
  
  <p>I am using jdbc4.jar postgres driver.
  I appreciate if somebody can have a look and point out what is the mistake</p>
  
  <p>Thanks in advance</p>