Examples of queryForInt()


Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        assertTrue(userTO.getPropagationTOs().isEmpty());

        Exception exception = null;
        try {
            jdbcTemplate.queryForInt("SELECT id FROM test WHERE id=?", userTO.getUsername());
        } catch (EmptyResultDataAccessException e) {
            exception = e;
        }
        assertNotNull(exception);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        assertTrue(userTO.getPropagationTOs().isEmpty());

        Exception exception = null;
        try {
            jdbcTemplate.queryForInt("SELECT id FROM test WHERE id=?", userTO.getUsername());
        } catch (EmptyResultDataAccessException e) {
            exception = e;
        }
        assertNotNull(exception);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        // if this is a new node, insert it
        if( id == null ) {
            JdbcSettings parent = (JdbcSettings) getParent();
            template.update( "INSERT INTO SETTINGS (KEY, PARENT, USER) VALUES (?, ?, ?)", new Object[] { getName(),
                    parent == null ? null : parent.getId(), user } );
            id = Integer.valueOf( template.queryForInt( "SELECT MAX(ID) FROM SETTINGS" ) );
        } else {
            for( Iterator iter = remove.iterator(); iter.hasNext(); ) {
                String key = (String) iter.next();
                template.update( "REMOVE FROM SETTINGS_VALUES WHERE SETTINGS_ID=? AND KEY=?", new Object[] { id, key } );
            }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

      query.getRowsExpected() == 3);

    JdbcTemplate helper = new JdbcTemplate(mockDataSource);
    for (int i = 0; i < results.length; i++) {
      // BREAKS ON ' in name
      int dbCount = helper.queryForInt(
          "SELECT COUNT(FORENAME) FROM CUSTMR WHERE FORENAME='" + results[i] + "'", (Object[]) null);
      assertTrue("found in db", dbCount == 1);
    }

    for (int i = 0; i < dbResults.length; i++) {
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        assertTrue(userTO.getPropagationTOs().isEmpty());

        Exception exception = null;
        try {
            jdbcTemplate.queryForInt("SELECT id FROM test WHERE id=?", userTO.getUsername());
        } catch (EmptyResultDataAccessException e) {
            exception = e;
        }
        assertNotNull(exception);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        assertTrue(userTO.getPropagationTOs().isEmpty());

        Exception exception = null;
        try {
            jdbcTemplate.queryForInt("SELECT id FROM test WHERE id=?", userTO.getUsername());
        } catch (EmptyResultDataAccessException e) {
            exception = e;
        }
        assertNotNull(exception);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

    String schemaPrefix = Strings.isNullOrEmpty(schema) ? "" : schema + ".";
    JdbcTemplate jt = new JdbcTemplate(ds);
    String query = String.format(
        "select count(*) from %sdocument where instance_id=%s",
        schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) == 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_segment s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) == 1);
    query = String
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

        schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) == 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_segment s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) == 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_sentence s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) > 1);
    query = String
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) == 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_sentence s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) > 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_token s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) > 1);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()

            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) > 1);
    query = String
        .format("select count(*) from %sdocument d inner join %sanno_base ab on ab.document_id = d.document_id inner join %sanno_token s on s.anno_base_id = ab.anno_base_id where d.instance_id=%s",
            schemaPrefix, schemaPrefix, schemaPrefix, key);
    Assert.assertTrue(query, jt.queryForInt(query) > 1);
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.