title: Cannot find JDBC driver
body: <pre><code>try
          {
              String userName = "root";
              String password = "";
              //&lt;facility&gt; is my database
              String url = "jdbc:mysql://localhost/facility";
              Class.forName ("com.mysql.jdbc.Driver").newInstance ();
              conn = DriverManager.getConnection (url, userName, password);
              System.out.println ("Database connection established");
          }
          catch (Exception e)
          {
              System.out.println ("Cannot connect to database server " +e.getClass().getName());
  
          }
  </code></pre>
  
  <p><em><strong>output> Cannot connect to database server java.lang.ClassNotFoundException</em></strong></p>