title: java.sql.sqlRecoverableException: Closed statement: next
body: <p>My code throws</p>
  
  <pre><code>java.sql.sqlRecoverableException: Sentencia cerrada: next
  </code></pre>
  
  <p>which, in English, I guess it would be:</p>
  
  <pre><code>java.sql.sqlRecoverableException: Closed statement: next
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>public TransactionArray() throws SQLException {
  
    /* Obtenemos la tabla de transacciones. */
    Connection connection;
    connection = ConnectionManager.getConnection(STATISTIC_DATA_BASE);
    Statement stmt = null;
    String query =
            "select * " +
            "from " + "dCellStatistic" + ".F_Transaction";
    ResultSet rs = null;
    try {
       stmt = connection.createStatement();
       rs = stmt.executeQuery(query);
    } catch (SQLException e ) {
       e.printStackTrace();
    } finally {
       if (stmt != null) { stmt.close(); }
    }
  
    /* Construimos las transacciones a partir de los registros. */
    List&lt;Transaction&gt; transactionList = new ArrayList&lt;Transaction&gt;();
    while (rs.next()) { //THE PROBLEM ARISES IN THIS LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       transactionList.add(new Transaction(rs));
    }
    array = transactionList.toArray(new Transaction[transactionList.size()]);
  </code></pre>
  
  <p>}</p>
  
  <p>Any clues of what I may be doing wrong? I have seen two threads on Code Ranch about similar issues, but none of them seemed to provide a solution for my case.</p>