title: Null URL in JDBC Connection
body: <p>I am trying to connect with mysql with Java.
  I am using db.properties files to get the connection details.</p>
  
  <p>I am kind of new guy to work with the db.properties file. What is the wrong with my code??</p>
  
  <p>It is as below</p>
  
  <pre><code>#mysql DB properties
  #DB_DRIVER_CLASS=com.mysql.jdbc.Driver
  #DB_URL=jdbc:mysql://localhost:8080/ci_intro
  #DB_USERNAME=root
  #DB_PASSWORD=
  </code></pre>
  
  <p>My Java Class file is</p>
  
  <pre><code>import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.sql.DriverManager;
  import java.sql.Connection;
  import java.sql.SQLException;
  import java.util.Properties;
  
  public class JDBCExample {
  
  public static void main(String[] argv) throws IOException,
          ClassNotFoundException, SQLException {
  
      System.out
              .println("-------- MySQL JDBC Connection Testing ------------");
  
      Properties props = new Properties();
      FileInputStream in = new FileInputStream("db.properties");
      props.load(in);
      in.close();
  
      String driver = props.getProperty("DB_DRIVER_CLASS");
      if (driver != null) {
          Class.forName(driver);
      }
  
      String url = props.getProperty("DB_URL");
      String username = props.getProperty("DB_USERNAME");
      String password = props.getProperty("DB_PASSWORD");
  
      Connection con = DriverManager.getConnection(url, username, password);
  
      if (con != null) {
          System.out.println("You made it, take control your database now!");
      } else {
          System.out.println("Failed to make connection!");
      }
  }
  }
  </code></pre>
  
  <p>I'm getting below error</p>
  
  <pre><code>-------- MySQL JDBC Connection Testing ------------
  Exception in thread "main" java.sql.SQLException: The url cannot be null
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at com.avn.notificationengine.JDBCExample.main(JDBCExample.java:33)
  </code></pre>