Good morning,
please correct on jdbc4 for DB2 squirrel code to avoid this error:
2023-11-15 14:05:14:399 [pool-1-thread-1] ERROR net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo - failed to load table names
com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.19.1063] Operation not valid: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(Unknown Source)
at com.ibm.db2.jcc.am.ResultSet.nextX(Unknown Source)
at com.ibm.db2.jcc.am.ResultSet.next(Unknown Source)
at net.sourceforge.squirrel_sql.fw.sql.databasemetadata.SQLDatabaseMetaData.getTables(SQLDatabaseMetaData.java:952)
at net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo.privateLoadTables(SchemaInfo.java:1256)
at net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo.loadTables(SchemaInfo.java:459)
at net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo._loadAllObjects(SchemaInfo.java:343)
at net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo.privateLoadAll(SchemaInfo.java:284)
at net.sourceforge.squirrel_sql.client.session.schemainfo.SchemaInfo.initialLoad(SchemaInfo.java:182)
at net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:255)
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.base/java.lang.Thread.run(Thread.java:1623)
Old form WITHOUT check statement isClosed():
Statement statement = results.getStatement();
if (statement != null)
{
connection = statement.getConnection(); // ** failed here
statement.close();
}
To new form WITH check statement isClosed():
Statement statement = results.getStatement();
if (statement != null && !statement.isClosed()) {
{
connection = statement.getConnection();
statement.close();
}
As I can't reproduce the bug neither on DB2/LINUXX8664 nor on DB2 UDB for AS/400 and as your stack trace is outdated I'm sure the bug was already fixed with bug #1472, see
https://sourceforge.net/p/squirrel-sql/bugs/1472/
To get rid of the problem I suggest to upgrade to the latest version or snapshot.