title: I get a nullpointerexception when connecting to oracle DataBase
body: <p>Here is the stack trace:</p>
  
  <pre><code> java.sql.SQLException
   at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:290)
  at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
  at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:702)
  at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634)
  at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:488)
  at org.apache.tomcat.jdbc.pool.ConnectionPool.&lt;init&gt;(ConnectionPool.java:144)
  at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
  at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
  at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
  at com.boeing.DBReader.Server.makeConnection(Server.java:85)
  at com.boeing.DBReader.Server.&lt;init&gt;(Server.java:26)
  at com.boeing.DBReader.Reader.main(Reader.java:13)
  Caused by: java.lang.NullPointerException
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:395)
  at   org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
  ... 11 more
  Connection closed
  </code></pre>
  
  <p>And here is the code:</p>
  
  <p>public class Server
  {</p>
  
  <pre><code>private DataSource datasource;
  
  
  public Server()
  {
      try
      {
          createConnectionToDatabase();
      } catch (Exception e)
      {
          // TODO Auto-generated catch block
          System.out.println("Exception:" + e.toString());
      }
      makeConnection();
  }
  
  private void createConnectionToDatabase() throws Exception 
  {
  String connectionString = null;
  String login = null;
  String password = null;
  
  System.out.println("In createConnectionToDatabase");
  
  PoolProperties p = new PoolProperties();
  p.setUrl("jdbc:oracle:thin:@***");
  
  p.setUrl(connectionString);
  p.setDriverClassName("oracle.jdbc.OracleDriver");
  p.setUsername("**");
  p.setPassword("**");
  
  p.setJmxEnabled(true);
  p.setTestWhileIdle(false);
  p.setTestOnBorrow(true);
  p.setValidationQuery("SELECT 1 from dual");
  p.setTestOnReturn(false);
  p.setValidationInterval(30000);
  p.setTimeBetweenEvictionRunsMillis(30000);
  p.setMaxActive(100);
  p.setInitialSize(10);
  p.setMaxWait(10000);
  p.setRemoveAbandonedTimeout(600);
  p.setMinEvictableIdleTimeMillis(30000);
  p.setMinIdle(10);
  p.setLogAbandoned(true);
  p.setRemoveAbandoned(true);
  p.setJdbcInterceptors("org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"
          + "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer");
  
  datasource = new DataSource();
  datasource.setPoolProperties(p);
  
  
  }
  
  private void closeConnection(Connection con) {
      if (con != null) {
          try {
              con.close();
          } catch (Exception ignore) {
              System.out.println("Could not close connection, WTF?");
          }
      }
  }
  
  private void makeConnection()
  {
      Connection con = null;
      String queryString = "SQL QUERY GOES HERE ";
      try {
          System.out.println("Connection attempt");
          con = datasource.getConnection();
  
          System.out.println("Connection made no issues");
  
      } catch (Exception e) {
          System.out.println("Exception:" + e.toString());
          e.printStackTrace();
      } finally {
          closeConnection(con);
          System.out.println("Connection closed");
      }
  
  
  }
  </code></pre>
  
  <p>I have the driver attached to the build path.. What am I doing wrong? This is set up without maven, and just a normal java project. </p>
  
  <p>Thanks!</p>