Example usage for org.apache.ibatis.datasource.unpooled UnpooledDataSource setUsername

List of usage examples for org.apache.ibatis.datasource.unpooled UnpooledDataSource setUsername

Introduction

In this page you can find the example usage for org.apache.ibatis.datasource.unpooled UnpooledDataSource setUsername.

Prototype

public void setUsername(String username) 

Source Link

Usage

From source file:com.collective.messages.persistence.dao.BaseDataTestCase.java

License:Apache License

private static UnpooledDataSource createUnpooledDataSource(Properties props) {
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(props.getProperty(DRIVER));
    ds.setUrl(props.getProperty(URL));
    ds.setUsername(props.getProperty(USERNAME));
    ds.setPassword(props.getProperty(PASSWORD));
    return ds;/*from   w  ww  . j  a v  a  2 s. c om*/
}

From source file:com.websys.config.spring.ProductionDbConfig.java

License:Open Source License

public UnpooledDataSource createUnpooledDataSource() throws IOException {
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(environment.getRequiredProperty("prod.datasource.driver"));
    ds.setUrl(environment.getRequiredProperty("prod.datasource.url"));
    ds.setUsername(environment.getRequiredProperty("prod.datasource.username"));
    ds.setPassword(environment.getRequiredProperty("prod.datasource.password"));
    return ds;/*from   w ww .  ja va  2s  .  c om*/
}

From source file:org.makersoft.shards.unit.BaseTest.java

License:Open Source License

public static UnpooledDataSource createUnpooledDataSource(String resource) throws IOException {
    Properties props = Resources.getResourceAsProperties(resource);
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(props.getProperty("driver"));
    ds.setUrl(props.getProperty("url"));
    ds.setUsername(props.getProperty("username"));
    ds.setPassword(props.getProperty("password"));
    return ds;//from w ww . j a v a  2 s  .c om
}

From source file:org.makersoft.shards.unit.BaseTest.java

License:Open Source License

public static DataSource createDataSource_1() throws IOException, SQLException {

    Properties props = Resources.getResourceAsProperties(H2_PROPERTIES);
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(props.getProperty("jdbc.driver"));
    ds.setUrl(props.getProperty("ds1.jdbc.url"));
    ds.setUsername(props.getProperty("ds1.jdbc.username"));
    ds.setPassword(props.getProperty("ds1.jdbc.password"));

    return ds;//from   w  w w . j  a va  2s .c om
}

From source file:org.makersoft.shards.unit.BaseTest.java

License:Open Source License

public static DataSource createDataSource_2() throws IOException, SQLException {

    Properties props = Resources.getResourceAsProperties(H2_PROPERTIES);
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(props.getProperty("jdbc.driver"));
    ds.setUrl(props.getProperty("ds2.jdbc.url"));
    ds.setUsername(props.getProperty("ds2.jdbc.username"));
    ds.setPassword(props.getProperty("ds2.jdbc.password"));

    return ds;//from   www  . j a  v  a2  s.c o m
}

From source file:org.makersoft.shards.unit.BaseTest.java

License:Open Source License

public static DataSource createDataSource_3() throws IOException, SQLException {

    Properties props = Resources.getResourceAsProperties(H2_PROPERTIES);
    UnpooledDataSource ds = new UnpooledDataSource();
    ds.setDriver(props.getProperty("jdbc.driver"));
    ds.setUrl(props.getProperty("ds3.jdbc.url"));
    ds.setUsername(props.getProperty("ds3.jdbc.username"));
    ds.setPassword(props.getProperty("ds3.jdbc.password"));

    return ds;/*w  ww. jav  a2 s . co  m*/
}