无论怎么改都报错,数据库用的Mysql,url在eclipse都能连接,druid用的最新的1.2.5应该不是版本问题,mysql也是匹配的版本,jdbc.properties也是放在resources资源下,网上能试的都试过了都不行


无论怎么改都报错,数据库用的Mysql,url在eclipse都能连接,druid用的最新的1.2.5应该不是版本问题,mysql也是匹配的版本,jdbc.properties也是放在resources资源下,网上能试的都试过了都不行


Properties properties = new Properties();
try (InputStream rs = getClassLoader().getResourceAsStream("druid.properties")) {
properties.load(rs);
} catch (IOException e) {
e.printStackTrace();
}
DruidDataSource dataSource = new DruidDataSource();
dataSource.configFromPropety(properties);
DruidPooledConnection connection = dataSource.getConnection();