Search in sources :

Example 6 with SimpleDriverDataSource

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;
}
Also used : Driver(java.sql.Driver) SimpleDriverDataSource(org.springframework.jdbc.datasource.SimpleDriverDataSource) ProcessEngineFactoryBean(org.activiti.spring.ProcessEngineFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 7 with SimpleDriverDataSource

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);
}
Also used : SimpleDriverDataSource(org.springframework.jdbc.datasource.SimpleDriverDataSource) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate)

Aggregations

SimpleDriverDataSource (org.springframework.jdbc.datasource.SimpleDriverDataSource)7 Bean (org.springframework.context.annotation.Bean)4 ProcessEngineFactoryBean (org.activiti.spring.ProcessEngineFactoryBean)3 Driver (java.sql.Driver)2 DataSource (javax.sql.DataSource)1 CloudException (org.springframework.cloud.CloudException)1 ServiceConnectorCreationException (org.springframework.cloud.service.ServiceConnectorCreationException)1 JdbcTemplate (org.springframework.jdbc.core.JdbcTemplate)1 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)1