Java Code Examples for org.springframework.jdbc.datasource.SimpleDriverDataSource#setUrl()

The following examples show how to use org.springframework.jdbc.datasource.SimpleDriverDataSource#setUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DatabaseConfiguration.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  SimpleDriverDataSource ds = new SimpleDriverDataSource();
  ds.setDriverClass(org.h2.Driver.class);

  // Connection settings
  ds.setUrl("jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000");
  ds.setUsername("sa");

  return ds;
}
 
Example 2
Source File: ActivitiEngineConfiguration.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  SimpleDriverDataSource ds = new SimpleDriverDataSource();
  ds.setDriverClass(org.h2.Driver.class);

  // Connection settings
  ds.setUrl("jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000");
  ds.setUsername("sa");

  return ds;
}
 
Example 3
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    SimpleDriverDataSource ds = new SimpleDriverDataSource();
    ds.setDriverClass(jdbcDriver);

    // Connection settings
    ds.setUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000");
    ds.setUsername(jdbcUsername);
    ds.setPassword(jdbcPassword);

    return ds;
}
 
Example 4
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    SimpleDriverDataSource ds = new SimpleDriverDataSource();
    ds.setDriverClass(jdbcDriver);

    // Connection settings
    ds.setUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000");
    ds.setUsername(jdbcUsername);
    ds.setPassword(jdbcPassword);

    return ds;
}
 
Example 5
Source File: DatabaseConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    SimpleDriverDataSource ds = new SimpleDriverDataSource();
    ds.setDriverClass(org.h2.Driver.class);

    // Connection settings
    ds.setUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000");
    ds.setUsername("sa");

    return ds;
}
 
Example 6
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    SimpleDriverDataSource ds = new SimpleDriverDataSource();
    ds.setDriverClass(jdbcDriver);

    // Connection settings
    ds.setUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000");
    ds.setUsername(jdbcUsername);
    ds.setPassword(jdbcPassword);

    return ds;
}
 
Example 7
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    SimpleDriverDataSource ds = new SimpleDriverDataSource();
    ds.setDriverClass(jdbcDriver);

    // Connection settings
    ds.setUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000");
    ds.setUsername(jdbcUsername);
    ds.setPassword(jdbcPassword);

    return ds;
}
 
Example 8
Source File: InitProcessEngineBySpringAnnotation.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 定义数据源
 * @return
 * @throws ClassNotFoundException
 */
@Bean
public DataSource dataSource() throws ClassNotFoundException {
    SimpleDriverDataSource simpleDriverDataSource = new SimpleDriverDataSource();
    simpleDriverDataSource.setDriverClass((Class<? extends Driver>) Class.forName("org.h2.Driver"));
    simpleDriverDataSource.setUrl("jdbc:h2:mem:aia-chapter7;DB_CLOSE_DELAY=1000");
    simpleDriverDataSource.setUsername("sa");
    simpleDriverDataSource.setPassword("");
    return simpleDriverDataSource;
}
 
Example 9
Source File: DatabaseConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
private void createSchemaIfNeeded(String dbType, String dbAddress, String dbName, String dbUser, String dbPassword, String dbSchema)
        throws SQLException {
    if (!DEFAULT_SCHEMA_NAME.equals(dbSchema)) {
        SimpleDriverDataSource ds = new SimpleDriverDataSource();
        ds.setDriverClass(Driver.class);
        ds.setUrl(String.format("jdbc:%s://%s/%s", dbType, dbAddress, dbName));
        try (Connection conn = ds.getConnection(dbUser, dbPassword); Statement statement = conn.createStatement()) {
            statement.execute("CREATE SCHEMA IF NOT EXISTS " + dbSchema);
        }
    }
}
 
Example 10
Source File: DatabaseUtil.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
public static void createSchemaIfNeeded(String dbType, String dbAddress, String dbName, String dbUser, String dbPassword, String dbSchema)
        throws SQLException {
    if (!DEFAULT_SCHEMA_NAME.equals(dbSchema)) {
        SimpleDriverDataSource ds = new SimpleDriverDataSource();
        ds.setDriverClass(Driver.class);
        ds.setUrl(String.format("jdbc:%s://%s/%s", dbType, dbAddress, dbName));
        try (Connection conn = ds.getConnection(dbUser, dbPassword); Statement statement = conn.createStatement()) {
            statement.execute("CREATE SCHEMA IF NOT EXISTS " + dbSchema);
        }
    }
}
 
Example 11
Source File: TransactionalTestConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public DataSource getDataSource() {
    SimpleDriverDataSource simpleDriverDataSource = new SimpleDriverDataSource();
    simpleDriverDataSource.setDriverClass(org.hsqldb.jdbcDriver.class);
    simpleDriverDataSource.setUrl("jdbc:hsqldb:mem:app-db");
    simpleDriverDataSource.setUsername("sa");
    simpleDriverDataSource.setPassword("");
    return simpleDriverDataSource;
}