Example usage for org.apache.commons.dbcp BasicDataSource setUrl

List of usage examples for org.apache.commons.dbcp BasicDataSource setUrl

Introduction

In this page you can find the example usage for org.apache.commons.dbcp BasicDataSource setUrl.

Prototype

public synchronized void setUrl(String url) 

Source Link

Document

Sets the #url .

Note: this method currently has no effect once the pool has been initialized.

Usage

From source file:com.joseph.california.app.conf.ConnectionConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/hello");
    ds.setUsername("app");
    ds.setPassword("app");
    return ds;//from  ww  w . j  av  a 2  s . c  o m
}

From source file:com.mycompany.carshop.app.conf.ConnectionConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/carshop");
    ds.setUsername("carshopadmin");
    ds.setPassword("admin");
    return ds;/*from  w ww .j  a v a2  s.co m*/
}

From source file:com.nobu.dvdrentalweb.app.conf.ConnectionConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/Dvd2");
    ds.setUsername("dvd");
    ds.setPassword("dvd");
    return ds;/*  w w w . ja  va 2 s.  c  om*/
}

From source file:ConnectionConfigTest.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/sample");
    ds.setUsername("app");
    ds.setPassword("app");
    return ds;/*from  ww w .  j  av a2  s .  com*/
}

From source file:br.com.shopcarpet.config.JpaConfig.java

/**
 * A metodo dataSource retorna a conexao do banco de dados.
 *///from   w w w  .  j a  v  a 2s  .  c o m
@Bean
public DataSource getDataSource() {
    final BasicDataSource ds = new BasicDataSource();
    ds.setDriverClassName("com.mysql.jdbc.Driver");
    ds.setUrl("jdbc:mysql://localhost/carpet");
    ds.setUsername("carpet");
    ds.setPassword("carpet123");
    return ds;
}

From source file:com.ameer.testweb.app.conf.ConnectionConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/payroll");
    ds.setUsername("testweb");
    ds.setPassword("admin");
    return ds;/*w  w w .j av a  2s. co m*/
}

From source file:com.packtpub.spring.ws.javaconfig.config.HibernateConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource dataSource = new BasicDataSource();
    dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName"));
    dataSource.setUrl(env.getProperty("jdbc.url"));
    dataSource.setUsername(env.getProperty("jdbc.username"));
    dataSource.setPassword(env.getProperty("jdbc.password"));
    return dataSource;
}

From source file:com.dangdang.ddframe.rdb.transaction.soft.base.AbstractSoftTransactionIntegrationTest.java

private DataSource createDataSource(final String dataSourceName) {
    BasicDataSource result = new BasicDataSource();
    result.setDriverClassName(org.h2.Driver.class.getName());
    result.setUrl("jdbc:h2:mem:" + dataSourceName);
    result.setUsername("sa");
    result.setPassword("");
    return result;
}

From source file:com.stickyd.app.conf.ConnectionConfig.java

@Bean
public DataSource dataSource() {
    BasicDataSource ds = new org.apache.commons.dbcp.BasicDataSource();
    ds.setDriverClassName("org.apache.derby.jdbc.ClientDriver");
    ds.setUrl("jdbc:derby://localhost:1527/stickyd");
    ds.setUsername("admin1");
    ds.setPassword("admin1");
    return ds;//from w ww.j a v a2s  .co  m
}

From source file:net.slipp.config.MainConfig.java

@Bean(destroyMethod = "close")
public DataSource dataSource() {
    BasicDataSource dataSource = new BasicDataSource();
    dataSource.setDriverClassName(environment.getProperty("jdbc.driverClassName"));
    dataSource.setUrl(environment.getProperty("jdbc.url"));
    dataSource.setUsername(environment.getProperty("jdbc.username"));
    dataSource.setPassword(environment.getProperty("jdbc.password"));
    return dataSource;
}