aiceflower opened a new pull request, #5412:
URL: https://github.com/apache/linkis/pull/5412

   ### 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:
   1. **ConnectionManager.java**: Added validation query mapping logic that 
auto-detects database type from JDBC URL and selects appropriate validation 
query
   2. **JDBCEngineConnConstant.java**: Added new configuration constant for 
validation query mapping
   3. **JDBCConfiguration.scala**: Added configuration item with default 
support for Oracle and DB2
   4. **distribution.xml**: Excluded conflicting jars from JDBC plugin assembly 
packaging
   
   ### 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:
   - Oracle: requires "SELECT 1 FROM DUAL"
   - DB2: requires "SELECT 1 FROM SYSIBM.SYSDUMMY1"
   
   Fixes #5411
   
   ### How was this patch tested?
   
   - [ ] Oracle database connection pool validation test
   - [ ] DB2 database connection pool validation test
   - [ ] MySQL/PostgreSQL default validation query compatibility test
   - [ ] JDBC plugin assembly packaging test (no jar conflicts)
   
   ### Does this PR introduce any user-facing change?
   
   Yes, users can now configure database-specific validation queries via:
   
   ```properties
   # Format: dbType1:query1,dbType2:query2,...
   wds.linkis.jdbc.validation.query.mapping=oracle:SELECT 1 FROM 
DUAL,db2:SELECT 1 FROM SYSIBM.SYSDUMMY1
   ```
   
   ### How was this patch tested?
   
   - Verified connection pool initialization with Oracle JDBC URL
   - Verified connection pool initialization with DB2 JDBC URL
   - Verified backward compatibility with MySQL/PostgreSQL
   
   ### Check List
   
   - [x] Update License info if needed
   - [ ] Add new UT/IT if needed
   - [ ] Need to update docs
   - [ ] Need to add warning banner in README


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to