title: No suitable driver found for jdbc?
body: <p>I took this example from Oracle's website and I am not able to implement it. It keeps on showing an error. I have already added the mysql 5.1 driver jar to my projects lib folder 
  and also to my build path. How do I fix my code ? </p>
  
  <p>link - <a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html" rel="nofollow">http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html</a></p>
  
  <p>error -</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:JavaEE://localHost:3306/
      at java.sql.DriverManager.getConnection(DriverManager.java:602)
      at java.sql.DriverManager.getConnection(DriverManager.java:154)
      at com.beans.us.dao.Data.getConnection(Data.java:25)
      at com.beans.us.dao.Data.main(Data.java:43)
  Cannot connect to database
  </code></pre>
  
  <p>code - </p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.SQLException;
  import java.util.Properties;
  
  public class Data {
  
      public static Connection getConnection() {
  
          Connection conn = null;
          Properties connectionProps = new Properties();
          String userName = "root";
          String password = "root";
          String dbms = "JavaEE";
          String serverName = "localHost";
          String portNumber = "3306";
  
          connectionProps.put("user", userName);
          connectionProps.put("password", password);
  
          try {
  
              conn = DriverManager.getConnection("jdbc:" + dbms + "://"
                      + serverName + ":" + portNumber + "/", connectionProps);
          } catch (SQLException sQLException) {
              sQLException.printStackTrace();
          }
  
          if (conn != null) {
              System.out.println("Connected to database");
          } else {
              System.out.println("Cannot connect to database");
          }
  
          return conn;
      }
  
      public static void main(String[] args) {
  
          getConnection();
  
      }
  
  }
  </code></pre>