title: Issue in closing JDBC Connection
body: <p>I have a jdbc connection which I'm trying to close but its returning a NullPointerException.</p>
  
  <pre><code>finally
      {
          try
          {
              if(load.dbConnection!=null)
              {
                  load.dbConnection.close();
                  LOGGER.info("Connection closed successfully");
              }
          }
          catch(Exception e)
          {
              LOGGER.info("Exception is closing db connection"+e.getLocalizedMessage()+" "+e.getMessage()+" "+e.toString());
  
          }
      }
  </code></pre>
  
  <p>The stack trace is as shown:</p>
  
  <pre><code>Exception occured nullLevel [0] - File Name: 'loadData.java' Method Name: 'verifyFiles' Line Number: '896' Message: 'java.lang.Exception'
  Level [1] - File Name: 'loadData.java' Method Name: '&lt;init&gt;' Line Number: '106' Message: 'java.lang.Exception'
  Level [2] - File Name: 'loadData.java' Method Name: 'main' Line Number: '119' Message: 'java.lang.Exception'
  </code></pre>
  
  <p>I the above code I'm checking for null condition in spite of that why is the control entering the block and trying to close connection and also giving me a java.lang.NullPointerException.</p>
  
  <pre><code>//Initial assignment
  loadData load = null;
  
      try
      {
      load = new loadData(); //Here the constructor calls 3 functions and exception occurs in one of those functions.
  
      }
      catch(Exception e){....}
      finally
      {
      //The finally code shown above
      }
  </code></pre>
  
  <p>SO in the above case when exception occurs in the constructor will the load remain null as shown in first assignment.</p>