Package org.apache.ibatis.datasource.unpooled

Examples of org.apache.ibatis.datasource.unpooled.UnpooledDataSource


    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(ResultMapReferencePersonMapper.class);
    configuration.addMapper(ResultMapReferencePetMapper.class);
View Full Code Here


  public static final String H2_PROPERTIES = "databases/h2.properties";
  public static final String MYSQL_PROPERTIES = "databases/mysql.properties";

  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;
  }
View Full Code Here

  }

  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;
  }
View Full Code Here

  }

  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;
  }
View Full Code Here

  }
 
  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;
  }
View Full Code Here

          && password != null) {
        /*
         * to test JDBC driver class
         */
        try {
          dataSource = new UnpooledDataSource(driverClassName, connectionUrl,
                                              login, password);
        } catch (Exception e) {
          LOG.log(Level.WARNING,
                  "Caught Exception while testing driver class name", e);
          message = res.getString(TEST_DRIVER_CLASS);
View Full Code Here

TOP

Related Classes of org.apache.ibatis.datasource.unpooled.UnpooledDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.