Package org.dbunit.ext.mysql

Examples of org.dbunit.ext.mysql.MySqlConnection


   
    JdbcMetaDataExtractor extractor = new JdbcMetaDataExtractor(jdbcConnection);
    String userName = extractor.getUserName();
   
    try {
      IDatabaseConnection dbUnitConn = new MySqlConnection(jdbcConnection, userName);
      return dbUnitConn;
    } catch (DatabaseUnitException e) {
      throw new IllegalStateException(
          "It's not possible to create a MySql DbUnit connection: "
              + e.getMessage(), e);
View Full Code Here


        Class.forName("com.mysql.jdbc.Driver");
        cloudConn = createConnection("cloud");
        usageConn = createConnection("usage");

        dbuCloudConn = new MySqlConnection(cloudConn, properties.getProperty("db.cloud.name"));
        dbuUsageConn = new MySqlConnection(usageConn, properties.getProperty("db.usage.name"));
        cloudDataSet = getCloudDataSet();
        usageDataSet = getUsageDataSet();
        DatabaseOperation.CLEAN_INSERT.execute(dbuCloudConn, cloudDataSet);
        DatabaseOperation.CLEAN_INSERT.execute(dbuUsageConn, usageDataSet);
    }
View Full Code Here

        Connection connection = dataSource.getConnection();
        String jdbcUrl = connection.getMetaData().getURL();
        if (StringUtils.contains(jdbcUrl, ":h2:")) {
            return new H2Connection(connection, null);
        } else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
            return new MySqlConnection(connection, null);
        } else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
            return new OracleConnection(connection, null);
        } else {
            return new DatabaseConnection(connection);
        }
View Full Code Here

  @Override
  protected IDatabaseConnection getDbUnitConnection()
      throws DatabaseUnitException, SQLException {
    DatabaseMetaData databaseMetaData = getConnection().getMetaData();
   
    IDatabaseConnection dbconn = new MySqlConnection(getConnection(), databaseMetaData.getUserName());
    return dbconn;
  }
View Full Code Here

TOP

Related Classes of org.dbunit.ext.mysql.MySqlConnection

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.