Skip to content

fix(jdbc-v2): report table-not-found SQLState - #3110

Merged
chernser merged 2 commits into
ClickHouse:mainfrom
hutiefang76:frank/clickhouse-java-3104-sqlstate
Sep 9, 2026
Merged

fix(jdbc-v2): report table-not-found SQLState#3110
chernser merged 2 commits into
ClickHouse:mainfrom
hutiefang76:frank/clickhouse-java-3104-sqlstate

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Summary

  • map ClickHouse UNKNOWN_TABLE responses to SQLState 42S02 in JDBC v2
  • preserve the server error code and original exception
  • keep the existing 22000 mapping for other server-side errors

Fixes #3104

Verification

  • mvn -pl jdbc-v2 -am -DskipITs -Dtest=ExceptionUtilsTest -Dsurefire.failIfNoSpecifiedTests=false test
  • changed-file Spotless check for ExceptionUtils.java and ExceptionUtilsTest.java
  • git diff --check

The regression test also verifies that unrelated server errors retain the existing SQLState.

@CLAassistant

CLAassistant commented Sep 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chernser
chernser merged commit 6d6dac8 into ClickHouse:main Sep 9, 2026
25 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JDBC v2: SQLException.getSQLState() returns 22000 (Data Exception) for all server errors, including UNKNOWN_TABLE

3 participants