use of org.apache.commons.dbcp.BasicDataSource in project sharding-jdbc by dangdangdotcom.
the class AbstractSpringDBUnitTest method createDataSource.
private DataSource createDataSource(final String dataSetFile) {
BasicDataSource result = new BasicDataSource();
result.setDriverClassName(org.h2.Driver.class.getName());
result.setUrl(String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL", getFileName(dataSetFile)));
result.setUsername("sa");
result.setPassword("");
result.setMaxActive(100);
return result;
}
use of org.apache.commons.dbcp.BasicDataSource in project sharding-jdbc by dangdangdotcom.
the class AbstractYamlShardingDataSourceTest method createDataSource.
protected static DataSource createDataSource(final String dsName) {
BasicDataSource result = new BasicDataSource();
result.setDriverClassName(org.h2.Driver.class.getName());
result.setUrl(String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL", dsName));
result.setUsername("sa");
result.setPassword("");
result.setMaxActive(100);
return result;
}
use of org.apache.commons.dbcp.BasicDataSource in project elastic-job by dangdangdotcom.
the class JobEventRdbStorageTest method setup.
@Before
public void setup() throws SQLException {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(org.h2.Driver.class.getName());
dataSource.setUrl("jdbc:h2:mem:job_event_storage");
dataSource.setUsername("sa");
dataSource.setPassword("");
storage = new JobEventRdbStorage(dataSource);
}
use of org.apache.commons.dbcp.BasicDataSource in project elastic-job by dangdangdotcom.
the class JobEventRdbListenerTest method setUp.
@Before
public void setUp() throws JobEventListenerConfigurationException, SQLException, NoSuchFieldException {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(org.h2.Driver.class.getName());
dataSource.setUrl("jdbc:h2:mem:job_event_storage");
dataSource.setUsername("sa");
dataSource.setPassword("");
JobEventRdbListener jobEventRdbListener = new JobEventRdbListener(dataSource);
ReflectionUtils.setFieldValue(jobEventRdbListener, "repository", repository);
when(jobEventRdbConfiguration.createJobEventListener()).thenReturn(jobEventRdbListener);
jobEventBus = new JobEventBus(jobEventRdbConfiguration);
}
use of org.apache.commons.dbcp.BasicDataSource in project sharding-jdbc by dangdangdotcom.
the class Main method createDataSource.
private static DataSource createDataSource(final String dataSourceName) {
BasicDataSource result = new BasicDataSource();
result.setDriverClassName(com.mysql.jdbc.Driver.class.getName());
result.setUrl(String.format("jdbc:mysql://localhost:3306/%s", dataSourceName));
result.setUsername("root");
result.setPassword("");
return result;
}
Aggregations