Example usage for org.apache.commons.dbcp PoolingConnection createStatement

List of usage examples for org.apache.commons.dbcp PoolingConnection createStatement

Introduction

In this page you can find the example usage for org.apache.commons.dbcp PoolingConnection createStatement.

Prototype

public Statement createStatement() throws SQLException 

Source Link

Usage

From source file:org.opennms.features.newts.converter.eventd.EventdStresser.java

synchronized public static Integer getEventCount(PoolingConnection pool) throws SQLException {
    Statement statement = pool.createStatement();
    ResultSet result = statement.executeQuery(
            "select count(*) from events where (eventuei = 'MATCH-ANY-UEI' or eventuei = 'uei.opennms.org/traps/eventTrap')");
    result.next();/*from  ww w .j a v a 2  s .c  o m*/
    int count = result.getInt(1);
    result.close();
    statement.close();
    return Integer.valueOf(count);
}