Example usage for org.springframework.jdbc.datasource SingleConnectionDataSource setUrl

List of usage examples for org.springframework.jdbc.datasource SingleConnectionDataSource setUrl

Introduction

In this page you can find the example usage for org.springframework.jdbc.datasource SingleConnectionDataSource setUrl.

Prototype

public void setUrl(@Nullable String url) 

Source Link

Document

Set the JDBC URL to use for connecting through the Driver.

Usage

From source file:org.springframework.cloud.netflix.archaius.ArchaiusExternalConfiguration.java

@Bean
@Qualifier("dataSource")
public SingleConnectionDataSource initDataSource() {
    SingleConnectionDataSource dataSource = new SingleConnectionDataSource();
    dataSource.setDriverClassName("org.h2.Driver");
    dataSource.setUrl(
            "jdbc:h2:mem:test_archaius;AUTOCOMMIT=ON;DB_CLOSE_DELAY=-1;MODE=PostgreSQL;INIT=RUNSCRIPT FROM 'classpath:archaius_db_store.sql'");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    dataSource.setSuppressClose(true);/*from  w  w w.ja  va 2s  .co  m*/
    return dataSource;
}