connect() should fail if specifying a non-existent database in the JDBC URL
Describe the bug
Specifying a non-existent database in the JDBC URLs results in the connection being established but following server calls fails.
Steps to reproduce
- Specify a non-existent database in the URL, i.e.
jdbc:clickhouse://<host>:<port>/database
Expected behaviour
The connect should fail if the specified database doesn't exist rather than following calls after connect fails.
ClickHouse versions
- ClickHouse Server version: 22.10.1.1877
- ClickHouse JDBC version: 0.4.0 (revision: 3a53cf1)
Thanks @rogerbj. But you can still issue queries against other databases, right? Or create the database before any query as mentioned in #826.
However, I do agree it's a bit confusing. With option createDatabaseIfNotExist, connecting to a database that doesn't exist makes no real sense any longer.
This is still technically true - the underlying java client doesn't validate the database that you set. I don't think that's an issue though - the end user should know which databases they have, otherwise we'd have to do a server call just to validate for every connection.
Thank you for suggesting this, though!