Skip to content

Commit

Permalink
[SQLLINE-379] DB2 JDBC driver throws if SQLLine attempts to call Resu…
Browse files Browse the repository at this point in the history
…ltSet.next after last row

Based on PR #294 by Matt Innes, with additional code by Julian Hyde.

Hoping that it also fixes
[SQLLINE-291] sqlite3 java.lang.IllegalStateException: SQLite JDBC: inconsistent internal state
  • Loading branch information
Matt Innes authored and julianhyde committed Apr 8, 2020
1 parent 30e6feb commit e0f9e9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/sqlline/BufferedRows.java
Expand Up @@ -102,7 +102,10 @@ private List<Row> nextList() throws SQLException {
// Add a row of column names as the first row of the first batch.
list.add(columnNames);
}
if (limit > 0) {
if (rs.isClosed()) {
// Result set is closed. Perhaps the driver closed it automatically
// because we reached the end. Do nothing.
} else if (limit > 0) {
// Obey the limit if the limit is non-negative and this is the first
// batch.
int counter = 0;
Expand Down

0 comments on commit e0f9e9a

Please sign in to comment.