use of com.alibaba.druid.pool.DruidDataSource in project Mycat_plus by coderczp.
the class RehashLauncher method initDataSource.
private void initDataSource() {
dataSource = new DruidDataSource();
dataSource.setAsyncCloseConnectionEnable(true);
dataSource.setBreakAfterAcquireFailure(true);
dataSource.setDefaultAutoCommit(true);
dataSource.setDefaultReadOnly(true);
dataSource.setDriverClassName(args.getJdbcDriver());
dataSource.setEnable(true);
dataSource.setPassword(args.getPassword());
dataSource.setTestOnBorrow(true);
dataSource.setTestOnReturn(true);
dataSource.setTestWhileIdle(true);
dataSource.setUrl(args.getJdbcUrl());
dataSource.setUsername(args.getUser());
}
use of com.alibaba.druid.pool.DruidDataSource in project vip by guangdada.
the class MybatisPlusConfig method bizDataSource.
/**
* 另一个数据源
*/
private DruidDataSource bizDataSource() {
DruidDataSource dataSource = new DruidDataSource();
druidProperties.config(dataSource);
mutiDataSourceProperties.config(dataSource);
return dataSource;
}
use of com.alibaba.druid.pool.DruidDataSource in project vip by guangdada.
the class MybatisPlusConfig method dataSourceGuns.
/**
* guns的数据源
*/
private DruidDataSource dataSourceGuns() {
DruidDataSource dataSource = new DruidDataSource();
druidProperties.config(dataSource);
return dataSource;
}
use of com.alibaba.druid.pool.DruidDataSource in project spring-cloud by Rogge666.
the class DataSourceConfig method createDataSource.
/**
* 创建druid数据源
* @param dataSourceName
* @return
*/
private static DataSource createDataSource(final String dataSourceName) {
// 使用Druid连接池连接数据库
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName("com.mysql.jdbc.Driver");
druidDataSource.setUrl(String.format("jdbc:mysql://localhost:3306/%s", dataSourceName));
druidDataSource.setUsername("root");
druidDataSource.setPassword("123456");
return druidDataSource;
}
use of com.alibaba.druid.pool.DruidDataSource in project Spring-Family by Sierou-Java.
the class MasterDataSourceConfig method masterDataSource.
@Bean(name = "masterDataSource")
@Primary
@ConfigurationProperties(prefix = "master.datasource")
public DataSource masterDataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setDriverClassName(driverClass);
dataSource.setUrl(url);
dataSource.setUsername(user);
// System.out.println(SecurityAES.decrypt(password, "123"));
// dataSource.setPassword(SecurityAES.decrypt(password, "123"));
dataSource.setPassword(password);
dataSource.setMaxActive(maxActive);
dataSource.setInitialSize(initialSize);
dataSource.setMinIdle(minIdle);
// dataSource.setConnectionProperties("master.datasource.password=" + password);
return dataSource;
}
Aggregations