title: MySQL JDBC error on connection
body: <p>I am trying to establish a connection to remote mysql db. I have put the jar connector to<code>war/WEB-INF/lib</code> folder and added a library (build path).</p>
  
  <p>Still I am getting this error:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:sql4.freemysqlhosting.net
      at java.sql.DriverManager.getConnection(Unknown Source)
  </code></pre>
  
  <p>Here is the full code:</p>
  
  <pre><code>/**
   * 
   */
  package com.infograph.dbconnection;
  
  import java.sql.DriverManager;
  import java.sql.Connection;
  import java.sql.SQLException;
  
  /**
   * @author Vlad
   *
   */
  public class DBConnection 
  {
      /**
       * 
       */
      public DBConnection() 
      {
          try 
          {
              Class.forName("com.mysql.jdbc.Driver");
          } 
          catch (ClassNotFoundException e) 
          {
              System.out.println("Where is your MySQL JDBC Driver?");
              e.printStackTrace();
              return;
          }
  
          System.out.println("MySQL JDBC Driver Registered!");
          Connection connection = null;
  
          try 
          {
              connection = DriverManager.getConnection("jdbc:sql4.freemysqlhosting.net","user", "pass");
  
          } 
          catch (SQLException e1) 
          {
              System.out.println("Connection Failed! Check output console");
              e1.printStackTrace();
              return;
          }
  
          if (connection != null) 
          {
              System.out.println("You made it, take control your database now!");
          } 
          else 
          {
              System.out.println("Failed to make connection!");
          }
      }
  }
  </code></pre>
  
  <p>What is the problem?? 10x!</p>