| | |
| | | |
| | | |
| | | private DruidDataSource creatSqlServer(String enabled, String ip,String port,String db,String user,String password) throws SQLException { |
| | | // -Djdk.tls.client.protocols=TLSv1.2 JVM启动参数 |
| | | DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); |
| | | Properties properties = new Properties(); |
| | | properties.setProperty("druid.enabled", enabled); |
| | | properties.setProperty("druid.driverClassName","com.microsoft.sqlserver.jdbc.SQLServerDriver"); |
| | | properties.setProperty("druid.url","jdbc:sqlserver://"+ ip+":"+ port+";DatabaseName="+ db+ |
| | | ";&characterEncoding=utf8;encrypt=false"); |
| | | ";trustServerCertificate=true;encrypt=false;characterEncoding=utf8"); |
| | | properties.setProperty("druid.username", user); |
| | | properties.setProperty("druid.password", password); |
| | | dataSource.restart(properties); |