我的代码抛出
java.sql.sqlRecoverableException: Sentencia cerrada: next
在英语中,我想应该是:
java.sql.sqlRecoverableException: Closed statement: next
这是我的代码:
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<Transaction> transactionList = new ArrayList<Transaction>();
while (rs.next()) { //THE PROBLEM ARISES IN THIS LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
transactionList.add(new Transaction(rs));
}
array = transactionList.toArray(new Transaction[transactionList.size()]);
}
我可能做错了什么的任何线索?我在 Code Ranch 上看到过两个关于类似问题的帖子,但似乎没有一个可以为我的案例提供解决方案。