title: Unable to Connect with my Database 000webhost.com
body: <pre><code>  try {
          String connectionURL = "jdbc:mysql://sql4.000webhost.com/a7291194_xxx";
          Connection connection = null; 
          Class.forName("com.mysql.jdbc.Driver").newInstance(); 
          connection = DriverManager.getConnection(connectionURL, "a7291194_xxx", "xxx");
          if(!connection.isClosed())
               System.out.println("Successfully connected to " + "MySQL server using TCP/IP...");
          connection.close();
      }catch(Exception ex){
          System.out.println("Unable to connect to database"+ex);
      }   
  </code></pre>
  
  <p>With the following connector code I am trying to connect with the database on 000webhost.com but it gives me an error:</p>
  
  <pre><code>    CommunicationsException: Communications link failure
  
      The last packet sent successfully to the server was 0 milliseconds ago. 
      The driver has not received any packets from the server.
  </code></pre>
  
  <p>I am trying my best for the first time as I am totally new to webhosting so please help me thanks in advance!</p>