Commit d527f20
[fix][EC][jdbc] Add configurable validation query for different database types (#5412)
* #AI COMMIT# fix: Add DB2 validation query support for JDBC engine connection 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>
* #AI COMMIT# fix: Exclude conflicting jars from JDBC plugin assembly
- 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>
* #AI COMMIT# refactor: Make validation query configurable for different 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>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 58281e7 commit d527f20
4 files changed
Lines changed: 87 additions & 4 deletions
File tree
- linkis-engineconn-plugins/jdbc/src/main
- assembly
- java/org/apache/linkis/manager/engineplugin/jdbc
- constant
- scala/org/apache/linkis/manager/engineplugin/jdbc/conf
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
Lines changed: 63 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
67 | 118 | | |
68 | 119 | | |
69 | 120 | | |
| |||
203 | 254 | | |
204 | 255 | | |
205 | 256 | | |
206 | | - | |
207 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
208 | 262 | | |
| 263 | + | |
209 | 264 | | |
210 | 265 | | |
211 | 266 | | |
| |||
246 | 301 | | |
247 | 302 | | |
248 | 303 | | |
249 | | - | |
250 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
251 | 309 | | |
| 310 | + | |
252 | 311 | | |
253 | 312 | | |
254 | 313 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
0 commit comments