List of usage examples for org.apache.commons.dbcp PoolingConnection createStatement
public Statement createStatement() throws SQLException
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); }