Description
Hello gurus,
I'm new to SquirrelSQL. I encounter the error that confuses me.
I installed SquirrelSQL 4.8.0 om Mac M2, with Sonoma. I have JDK 21. SquirrelSQL runs fine. I can connect to Mysql and IBM Db2 servers without issues. I can query the databases and get the results. I can edit data.
What is however doesn't work is any refactor command. Whenever I try to alter table or add a column I consistently get an exception:
ERROR net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand - Unexpected exception on sql generation: SQLDatabaseMetaData == null
java.lang.IllegalArgumentException: SQLDatabaseMetaData == null
at net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectInfo.<init>(DatabaseObjectInfo.java:69)
at net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo.<init>(TableColumnInfo.java:56)
at net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.getColumnInfo(ColumnDetailDialog.java:259)
at net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddColumnCommand.generateSQLStatements(AddColumnCommand.java:88)
at net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand$1.run(AbstractRefactoringCommand.java:200)
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.base/java.lang.Thread.run(Thread.java:1623)
This behavior is identical with both IBM Db2 and Mysql databases. I also installed SquirrelSQL 4.8.0 on my older Intel Mac with Mojave and JDK 17. Same issue. I couldn't find on Google anything related to this.
What's wrong here? How to solve the problem with refactoring? Thank you for your help.
P.S.
To copy the above log entries I checked the SquirrelSQL log files and see that it is full of the similar exceptions like this (though I don't observe these errors in the GUI):
ERROR net.sourceforge.squirrel_sql.client.session.messagepanel.MessagePanel - privateShowMessage: Exception was: SQLDatabaseMetaData == null
java.lang.IllegalArgumentException: SQLDatabaseMetaData == null
at net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectInfo.<init>(DatabaseObjectInfo.java:69)
at net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo.<init>(TableColumnInfo.java:56)
at net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.getColumnInfo(ColumnDetailDialog.java:259)
at net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddColumnCommand.generateSQLStatements(AddColumnCommand.java:88)
at net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand$1.run(AbstractRefactoringCommand.java:200)
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.base/java.lang.Thread.run(Thread.java:1583)
[UPDATE]: I installed SquirrelSQL on my third PC, Fedora 40 x86_64, with OpenJDK 21. Same thing. I'm now sure that either I'm doing something fundamentally wrong, or this client has a bug. I'm doing just clean install with necessary DB plugins, then driver installation, then alias creation. No any other configurations made, so this works as described out of the box.
[UPDATE 2]: Yeah, the previous version, 4.7.1, doesn't contain this bug (at least on Fedora) and works as expected.