use of org.springframework.jdbc.datasource.SimpleDriverDataSource in project Activiti by Activiti.
the class ActivitiEngineConfiguration method dataSource.
@Bean
public DataSource dataSource() {
SimpleDriverDataSource ds = new SimpleDriverDataSource();
try {
@SuppressWarnings("unchecked") Class<? extends Driver> driverClass = (Class<? extends Driver>) Class.forName(environment.getProperty("jdbc.driver", "org.h2.Driver"));
ds.setDriverClass(driverClass);
} catch (Exception e) {
log.error("Error loading driver class", e);
}
// Connection settings
ds.setUrl(environment.getProperty("jdbc.url", "jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000"));
ds.setUsername(environment.getProperty("jdbc.username", "sa"));
ds.setPassword(environment.getProperty("jdbc.password", ""));
return ds;
}
use of org.springframework.jdbc.datasource.SimpleDriverDataSource in project uPortal by Jasig.
the class PortalPersonDirUserPasswordDaoTest method setUp.
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
this.dataSource = new SimpleDriverDataSource(new org.hsqldb.jdbcDriver(), "jdbc:hsqldb:mem:CasTest", "sa", "");
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate.execute("CREATE TABLE UP_PERSON_DIR (USER_NAME VARCHAR(1000), ENCRPTD_PSWD VARCHAR(1000))");
this.userPasswordDao = new PortalPersonDirUserPasswordDao();
this.userPasswordDao.setDataSource(this.dataSource);
}
Aggregations