title: Memory Leak when calling Stored Procedure
body: <p>I'm getting a memory leak somewhere in my program, and using some tools I think this is the location in my code.  So, is there something wrong with this function and how the stored procedure is called?</p>
  
  <p><code>CustomSQLConn</code> is given to the class when it is created.</p>
  
  <pre><code>private void flagDeleted(ABCDocument mydoc){
      try {           
  
          ResultSet rs1 = null;
          try{
              CallableStatement cs1;
              cs1 = CustomSQLConn.prepareCall("{ call flagFolderDeleted(?) }");
              cs1.setInt(1, mydoc.getId());
              cs1.execute();
          }catch (Exception e){
              System.out.println("Got an exception: " + e.getMessage()); 
              e.printStackTrace();
          }finally{
              if(rs1 != null) rs1.close();
              rs1 = null;
          }
      }catch (Exception e) {
          System.out.println("Got an exception: " + e.getMessage()); 
          e.printStackTrace();
      }
  } // END flagDeleted    
  </code></pre>
  
  <p>The connection is not being closed here either, since the class uses it for other processes.</p>