iamif3000 opened a new issue #8524:
URL: https://github.com/apache/shardingsphere/issues/8524
### Which version of ShardingSphere did you use?
v4.1.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
jdbc
### Expected behavior
### Actual behavior
throws exception
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
If I package the program to jar and run the jar file, I'll get
```
Exception in thread "main" java.lang.UnsupportedOperationException: Cannot
support database type 'MySQL'
at
org.apache.shardingsphere.sql.parser.core.parser.SQLParserFactory.newInstance(SQLParserFactory.java:55)
at
org.apache.shardingsphere.sql.parser.core.parser.SQLParserExecutor.towPhaseParse(SQLParserExecutor.java:55)
at
org.apache.shardingsphere.sql.parser.core.parser.SQLParserExecutor.execute(SQLParserExecutor.java:47)
at
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:79)
at
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)
at
org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97)
at
org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89)
at
org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
at
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlaveStatement.execute(MasterSlaveStatement.java:161)
at com.test.TestMain.main(TestMain.java:50)
# code --- start
File yamlFile = new File(args[0]);
DataSource ds = YamlMasterSlaveDataSourceFactory.createDataSource(yamlFile);
Connection conn = ds.getConnection("proxy", "p123456");
Statement stmt = conn.createStatement()
stmt.execute("truncate table jmeter_test");
for ... {
stmt.execute("insert into jmeter_test values (null, now(), now(), now(),
now(), " +
"now(), now(), now(), now(), now(), " +
"now(), now(), now(), now(), now(), " +
"now(), now(), now(), now(), now(), " +
"now(), now(), now(), now(), now(), " +
"now(), unix_timestamp(), unix_timestamp(), unix_timestamp(),
unix_timestamp())");
}
...
# code --- end
# config-master_slave.yaml --- start
dataSources:
# 配置第 1 个数据源
ds_master: !!com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
url:
jdbc:mysql://192.168.252.246:3306/proxy?serverTimezone=UTC&useSSL=false
username: proxy
password: p123456
initialSize: 10 #连接池初始化连接数
minIdle: 10 #连接池最小连接数
maxActive: 10 #连接池最大连接数
# 配置第 2 个数据源
ds_slave0: !!com.alibaba.druid.pool.DruidDataSource
#!!org.apache.commons.dbcp2.BasicDataSource
#!!com.zaxxer.hikari.HikariDataSource
#!!com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
url:
jdbc:mysql://192.168.252.237:3306/proxy?serverTimezone=UTC&useSSL=false
username: proxy
password: p123456
initialSize: 10 #连接池初始化连接数
minIdle: 10 #连接池最小连接数
maxActive: 10 #连接池最大连接数
masterSlaveRule:
name: ds_ms
masterDataSourceName: ds_master
slaveDataSourceNames: [ds_slave0]
# config-master_slave.yaml --- end
```
### Example codes for reproduce this issue (such as a github link).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]