Example usage for org.apache.commons.dbutils QueryRunner QueryRunner

List of usage examples for org.apache.commons.dbutils QueryRunner QueryRunner

Introduction

In this page you can find the example usage for org.apache.commons.dbutils QueryRunner QueryRunner.

Prototype

public QueryRunner(DataSource ds, boolean pmdKnownBroken) 

Source Link

Document

Constructor for QueryRunner that takes a DataSource and controls the use of ParameterMetaData.

Usage

From source file:com.gs.obevo.dbmetadata.impl.dialects.AbstractDbMetadataManagerIT.java

@Before
public void setup() throws Exception {
    DataSource ds = getDataSource();
    mgr = createMetadataManager();// w w w.j a  va2  s .  c  o m
    mgr.setDataSource(ds);

    QueryRunner jdbc = new QueryRunner(ds, isPmdKnownBroken());

    setCurrentSchema(jdbc);

    for (String sql : splitSql(getDropSqlFile())) {
        try {
            jdbc.update(sql);
        } catch (Exception ignore) {
            LOG.info("Ignoring error here for dropping tables (simplest way to do this), {}",
                    ignore.getMessage());
        }
    }

    for (String sql : splitSql(getAddSqlFile())) {
        jdbc.update(sql);
    }
}