Example usage for org.springframework.jdbc.core RowCountCallbackHandler getRowCount

List of usage examples for org.springframework.jdbc.core RowCountCallbackHandler getRowCount

Introduction

In this page you can find the example usage for org.springframework.jdbc.core RowCountCallbackHandler getRowCount.

Prototype

public final int getRowCount() 

Source Link

Document

Return the row count of this ResultSet.

Usage

From source file:io.github.benas.jql.core.QueryExecutor.java

public int count(String countQuery) {
    RowCountCallbackHandler rowCountCallbackHandler = new RowCountCallbackHandler();
    jdbcTemplate.query(countQuery, rowCountCallbackHandler);
    return rowCountCallbackHandler.getRowCount();
}

From source file:gov.nih.nci.cabig.ctms.tools.configuration.DatabaseBackedConfigurationTest.java

private <V> void assertNotSet(ConfigurationProperty<V> property) {
    RowCountCallbackHandler counter = new RowCountCallbackHandler();
    jdbc.query(String.format("SELECT * FROM %s WHERE key=?", DEFAULT_TABLE), new Object[] { property.getKey() },
            counter);/*  w w  w  .jav  a2 s  .  com*/
    assertEquals(property + " is set", 0, counter.getRowCount());
}

From source file:org.opennms.core.test.db.TemporaryDatabase.java

public int countRows(String sql, Object... values) {
    RowCountCallbackHandler counter = new RowCountCallbackHandler();
    getJdbcTemplate().getJdbcOperations().query(sql, values, counter);
    return counter.getRowCount();
}

From source file:org.opennms.core.test.db.TemporaryDatabasePostgreSQL.java

public int countRows(String sql, Object... values) {
    RowCountCallbackHandler counter = new RowCountCallbackHandler();
    getJdbcTemplate().query(sql, values, counter);
    return counter.getRowCount();
}