Closed zjutsuper closed 5 years ago
I had a similar issue and was able to resolve it by registering the database driver before configuring the datasource. I’ve only seen this problem when deploying a WAR in Tomcat so far . It doesn’t seem to occur when deploying with an embedded Jetty.
Class.forName("com.mysql.jdbc.Driver");
I will add it at least to README
README updated
dataSource is DruidDataSource
String realUrl = this.extractRealUrl(url); String dbType = this.extractDbType(realUrl); String dbUser = info.getProperty("user"); Driver wrappedDriver = this.findDriver(realUrl);
this.findDriver(url) need using url not realUrl this version will throw Excetpion Caused by: java.sql.SQLException: Unable to find a driver that accepts jdbc:mysql://172.16.71.2:3306/tradecenter?useUnicode=true&characterEncoding=utf-8