title: java.lang.ClassNotFoundException: org.postgresql.Driver problem
body: <p>I've been working on a web project with Java EE and PostgreSQL and it runs perfectly. I tried moving it to another machine, but now it's not connecting to the database anymore.</p>
  
  <p>I tried multiple solutions but nothing works so far:</p>
  
  <ul>
  <li>adding postgresql.jar to java build path</li>
  <li>moving it to the /lib file of tomcat server</li>
  </ul>
  
  <p>Hers is my connection to database class:</p>
  
  <pre><code>public class DBConnexion {
      private static Connection con=null;
  
  
  private DBConnexion(){
      try
      {
          try {
              Class.forName("org.postgresql.Driver");
              //getConnection(url:dataBase name, owner name , password) 
              con=(Connection)DriverManager.getConnection("jdbc:postgresql:septentrion", "postgres","123");
          } catch (ClassNotFoundException e) {
              e.printStackTrace();
          }
      }
      catch(SQLException e1)
      {
          e1.printStackTrace();
      }
  }
  
  public static Connection getInstance()
  {
      if(con==null)
          new DBConnexion();
      return con;
  }
  
  
  
  }
  </code></pre>