aiceflower opened a new issue, #5411:
URL: https://github.com/apache/linkis/issues/5411

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/linkis/issues) and found no similar issues.
   
   ### Linkis Component
   
   - [ ] linkis-commons
   - [ ] linkis-computation-governance
   - [ ] linkis-dist
   - [x] linkis-engineconn-plugin
   - [ ] linkis-extensions
   - [ ] linkis-orchestrator
   - [ ] linkis-public-enhancements
   - [ ] linkis-spring-cloud-services
   - [ ] linkis-web
   
   ### Description
   
   JDBC engine connection pool uses "SELECT 1" as the default validation query, 
which works for MySQL and PostgreSQL but fails for Oracle and DB2 databases:
   
   - Oracle requires: "SELECT 1 FROM DUAL"
   - DB2 requires: "SELECT 1 FROM SYSIBM.SYSDUMMY1"
   
   Currently, the code only hardcodes Oracle support but lacks DB2 support and 
a configurable mechanism for other databases.
   
   ### Steps to reproduce
   
   1. Configure a JDBC data source with Oracle or DB2 connection
   2. Enable connection pool validation (`testWhileIdle=true`)
   3. The validation query fails with SQL syntax error
   
   ### Expected behavior
   
   JDBC engine should support configurable validation queries for different 
database types:
   - Auto-detect database type from JDBC URL
   - Use appropriate validation query for each database
   - Allow users to customize validation query mapping via configuration
   
   ### Your environment
   
   - Linkis version used: 1.9.0+
   - Database types affected: Oracle, DB2
   
   ### Anything else
   
   This PR adds:
   1. New configuration `wds.linkis.jdbc.validation.query.mapping` for custom 
validation queries
   2. Default support for Oracle and DB2 databases
   3. Auto-detection based on JDBC URL patterns
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!


-- 
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