Closed yabets closed 1 year ago
How have you set up the new H2 jar? Which H2 version was used to create your database file?
Following steps worked for me.
$ echo "quit" | java -cp /tmp/h2-2.0.206.jar org.h2.tools.Shell -url "jdbc:h2:/tmp/test" -user "sa"
Welcome to H2 Shell 2.0.206 (2022-01-04) Exit with Ctrl+C Commands are case insensitive; SQL statements end with ';' help or ? Display this help list Toggle result list / stack trace mode maxwidth Set maximum column width (default is 100) autocommit Enable or disable autocommit history Show the last 20 statements quit or exit Close the connection and exit
sql> Connection closed
2. connect using the H2 console
```console
$ java -jar /tmp/h2-2.0.206.jar
Some addition to my former comment.
The issue happen when IntelliJ tries to fetch the table names, using the statement
SELECT CATALOG_NAME FROM INFORMATION_SCHEMA.CATALOGS
this statement is only supported for H2 1.4.200 and older.
As workaround to use IntelliJ with newer H2 drivers the old behavior can be activated by adding OLD_INFORMATION_SCHEMA=TRUE
to the connect string.
Linking the related issue in the IntelliJ IDEA tracker: https://youtrack.jetbrains.com/issue/IDEA-287220
Is it okay to close the current GitHub issue, as this repository is not directly about product bugs?
Also, the original issue https://youtrack.jetbrains.com/issue/IDEA-287220 is fixed now. I think we need to close GitHub issue too.
Intellij 2021.3.1 Ultimate does not have Provided Driver for H2 above version 1.4.200. Customs jar(h2-2.0.206.jar) will pass Test Connection but cannot open the database file. It fail with the following error message: [42S02][42102] org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "CATALOGS" not found; SQL statement: select CATALOG_NAME from INFORMATION_SCHEMA.CATALOGS [42102-206]
I am able to access the database from H2 console. This is an issue from IntelliJ Database navigation tool.