[fix][EC][jdbc] Add configurable validation query for different database types#5412
Merged
casionone merged 3 commits intoapache:masterfrom Apr 13, 2026
Merged
Conversation
…nection pool - Add DB2-specific validation query "SELECT 1 FROM SYSIBM.SYSDUMMY1" - Same pattern as existing Oracle validation query handling - Fixes DB2 connection pool validation error when using datasource name Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Exclude Jetty jars to avoid version conflicts with public-module - Exclude SLF4J bindings to prevent multiple binding errors - Exclude Hadoop jars to use shared public-module versions These exclusions prevent class loading conflicts when JDBC engine starts and uses jars from both plugin lib and public-module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t database types - Add configuration parameter 'wds.linkis.jdbc.validation.query.mapping' - Default mapping: oracle:SELECT 1 FROM DUAL,db2:SELECT 1 FROM SYSIBM.SYSDUMMY1 - Remove hardcoded database-specific validation query logic - To add new database type, just update configuration, no code change needed Benefits: - Configuration-driven approach for extensibility - Easy to add support for new databases without modifying source code - Default values work for most common databases Usage example: Add to linkis-engineconn.properties: wds.linkis.jdbc.validation.query.mapping=oracle:SELECT 1 FROM DUAL,db2:SELECT 1 FROM SYSIBM.SYSDUMMY1,postgresql:SELECT 1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds configurable validation query support for JDBC engine connection pool, enabling proper connection validation for Oracle, DB2, and other databases that require non-standard validation queries.
Changes:
Why are the changes needed?
JDBC engine connection pool uses "SELECT 1" as the default validation query, which works for MySQL and PostgreSQL but fails for:
Fixes #5411
How was this patch tested?
Does this PR introduce any user-facing change?
Yes, users can now configure database-specific validation queries via:
How was this patch tested?
Check List