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

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

Introduction

In this page you can find the example usage for org.springframework.jdbc.datasource DriverManagerDataSource 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:com.qpark.eip.core.spring.lockedoperation.TestConfig.java

/**
 * Get the {@link DataSource} auto wired in the
 * {@link EipLockedoperationConfig}.//from www . j a  v  a  2 s  . c om
 *
 * @return The {@link DataSource}
 */
@Bean(name = EipLockedoperationConfig.DATASOURCE_BEAN_NAME)
public DataSource DataSource() {
    DriverManagerDataSource bean = new DriverManagerDataSource();
    bean.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
    bean.setUrl("jdbc:hsqldb:file:target/hsqldb/testHSQLDB.bin");
    bean.setUsername("platformUser");
    bean.setPassword("platformUserPwd");
    return bean;
}

From source file:com.teradata.benchto.driver.jdbc.MultipleDataSourcesConfiguration.java

private DataSource createDataSource(DataSourceProperties properties) {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(properties.getDriverClassName());
    dataSource.setUrl(properties.getUrl());
    dataSource.setUsername(properties.getUsername());
    dataSource.setPassword(properties.getPassword());
    return dataSource;
}

From source file:at.christophwurst.orm.config.AppConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.mariadb.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://localhost/WorkLogDb");
    dataSource.setUsername("workloguser");
    dataSource.setPassword("worklogpassword");
    return dataSource;
}

From source file:com.anyun.sample.config.DatabaseConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(driverClassName);
    dataSource.setUrl(url);
    dataSource.setUsername(username);/*from w  w w  .j a  v a  2  s .c o m*/
    dataSource.setPassword(password);
    return new LocalTransactionDataSource(dataSource);
}

From source file:com.mycompany.swing2explore.config.PersistenceJPAConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://localhost:3306/spring2explore");
    dataSource.setUsername("root");
    dataSource.setPassword("pwdroot");
    return dataSource;
}

From source file:org.hellospring4.config.PersistenceConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://192.168.1.75:3306/MUSICOPY");
    dataSource.setUsername("springtest");
    dataSource.setPassword("test");

    return dataSource;
}

From source file:be.wolkmaan.klimtoren.web.config.PersistenceConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName(env.getProperty("jdbc.driverClassName"));
    ds.setUrl(env.getProperty("jdbc.url"));
    ds.setUsername(env.getProperty("jdbc.username"));
    ds.setPassword(env.getProperty("jdbc.password"));
    return ds;/*from w w w.jav a 2  s  .  c o m*/
}

From source file:com.aerolinea.config.WebConfig.java

@Bean
public DriverManagerDataSource restDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://localhost:3306/aerolinea?zeroDateTimeBehavior=convertToNull");
    dataSource.setUsername("root");
    dataSource.setPassword("tic506");

    return dataSource;
}

From source file:com.oasisdigital.sdre.ApplicationConfig.java

/**
 * Bootstraps an in-memory HSQL database.
 * /*w ww  .j  av a 2 s.c  om*/
 * @return
 * @see http 
 *      ://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jdbc.html#jdbc-embedded-database
 *      -support
 */
@Bean
public DataSource dataSource() {
    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName("org.hsqldb.jdbcDriver");
    ds.setUrl("jdbc:hsqldb:file:OD-test-db");
    ds.setUsername("sa");
    ds.setPassword("");
    return ds;
}

From source file:com.xiovr.unibot.config.JdbcConfig.java

/**
 * @return create bean for jdbc driver/*from   ww  w  .j  av  a2s .c o  m*/
 */
@Bean(name = "dataSource")
public DataSource getDataSource() {
    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName(env.getProperty("jdbc.driverClassName"));
    ds.setUrl(env.getProperty("jdbc.url"));
    ds.setUsername(env.getProperty("jdbc.username"));
    ds.setPassword(env.getProperty("jdbc.password"));
    return ds;
    //      EmbeddedDatabaseBuilder edb = new EmbeddedDatabaseBuilder();
    //      edb.setType(EmbeddedDatabaseType.HSQL).
    //         setName("e5botdb").
    //         addScripts("classpath:/sql/hsql_create.sql",
    //               "classpath:/sql/hsql_data.sql");

    //      return edb.build();
}