silversteak opened a new issue, #19607:
URL: https://github.com/apache/shardingsphere/issues/19607

   ## ComboPooledDataSource not compatible with apache shardingsphere. 
   
   I am currently trying to implement shardingshpere in my current company's 
codebase. Previously created an example project using HikariDataSource and it 
worked fine. 
   
   Now in companies code base uses c3p0.ComboPooledDataSource as datasource. So 
when am trying to create shardingshphere datasource using this datasource its 
failing. 
   
   In HikariDatasource, the standardProps are coming correct.
   <img width="734" alt="image" 
src="https://user-images.githubusercontent.com/25997886/181229436-e6492019-0bdf-4f0b-8ac7-8c508e4e2024.png";>
   
   But in c3p0.ComboPooledDataSource, the standardProps are giving just 
password only.
   <img width="734" alt="image" 
src="https://user-images.githubusercontent.com/25997886/181229691-dc137910-ac57-4144-811f-6d5fed3802ea.png";>
   
   The main cause of the issue is that in c3p0.ComboPooledDataSource, the 
properties are stored in different format. `Like username as user and url as 
jdbcUrl.` 
   <img width="982" alt="image" 
src="https://user-images.githubusercontent.com/25997886/181230461-42eb9ecd-af15-4925-8059-5081a0417283.png";>
   
   
   `Thats why am getting a nullpointer exception here since both the keys are 
username and url`
   <img width="982" alt="image" 
src="https://user-images.githubusercontent.com/25997886/181230180-b2b2f3b8-2be1-41ab-a011-13efe2a1f0a8.png";>
   
   I was under the assumption that apache shardingsphere is compatible with all 
kinds of datasource. I am stuck here. 
   
   
   Please help me out if possible. 
   
   Datasource Config 
   
   ```
   dataSources:
     ds:
       dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource
       driverClassName: com.mysql.jdbc.Driver
       jdbcUrl: 
jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
       user: root
       username: root
       password: password
       max-active: 16
   ```
   
   pom.xml
   ```
   <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>5.1.2</version>
   </dependency>
   <dependency>
                   <groupId>com.mchange</groupId>
                   <artifactId>c3p0</artifactId>
                   <version>0.9.5.1</version>
   </dependency>
   
   ```
   
   
   


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

Reply via email to