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()

      }
    } finally {
      DataSourceUtils.releaseConnection(con, ds);
    }

    int count = jdbcTemplate.queryForInt("select count(*) from records");
    Assert.assertEquals("Did not load the data correctly", 200, count);

    stopTunnelServer();
    removeService(VCAP_MYSQL_SERVICE);
    logger.info("Time elapsed: " + (System.currentTimeMillis() - start) / 1000.0d + " sec");
View Full Code Here

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

      }
    } finally {
      DataSourceUtils.releaseConnection(con, ds);
    }

    int count = jdbcTemplate.queryForInt("select count(*) from records");
    Assert.assertEquals("Did not load the data correctly", 200, count);

    stopTunnelServer();
    removeService(VCAP_POSTGRES_SERVICE);
    logger.info("Time elapsed: " + (System.currentTimeMillis() - start) / 1000.0d + " sec");
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()

        JdbcTemplate jt = JuConnUtils.asJdbcTemplate(conn);

        jt.execute(String.format("DROP SCHEMA `%s`", schemaInfo.getName()));
       
        for (String user : users) {
          int cnt = jt.queryForInt(String.format("select count(*) from mysql.user where user = '%s'", user));
          if (cnt > 0) {
            jt.execute(String.format("DROP USER `%s`", user));
          }
        }
      }
View Full Code Here

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

   */
  int internalGetRecentMEBEntries(final Integer userId)
  {
    final JdbcTemplate jdbc = new JdbcTemplate(dataSource);
    try {
      int counter = jdbc.queryForInt("SELECT COUNT(*) FROM t_meb_entry where owner_fk=" + userId + " and status='RECENT'");
      if (accessChecker.isLoggedInUserMemberOfAdminGroup() == true) {
        counter += jdbc.queryForInt("SELECT COUNT(*) FROM t_meb_entry where owner_fk is null");
      }
      return counter;
    } catch (final Exception ex) {
View Full Code Here

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

  {
    final JdbcTemplate jdbc = new JdbcTemplate(dataSource);
    try {
      int counter = jdbc.queryForInt("SELECT COUNT(*) FROM t_meb_entry where owner_fk=" + userId + " and status='RECENT'");
      if (accessChecker.isLoggedInUserMemberOfAdminGroup() == true) {
        counter += jdbc.queryForInt("SELECT COUNT(*) FROM t_meb_entry where owner_fk is null");
      }
      return counter;
    } catch (final Exception ex) {
      log.error(ex.getMessage(), ex);
      return 0;
View Full Code Here

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

            counter[0]++;
          }
          return null;
        }
      });
      int no = jdbc.queryForInt("select count(*)" + sql);
      if (no > 0) {
        log.warn("" + no + " of data base history entries aren't fixed.");
      }
      sql = " from t_history_property_delta where property_type like '%_$$_javassist_%'";
      jdbc.query("select id, property_type" + sql, new ResultSetExtractor() {
View Full Code Here

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

            counter[0]++;
          }
          return null;
        }
      });
      no = jdbc.queryForInt("select count(*)" + sql);
      if (no > 0) {
        log.warn("" + no + " of data base history entries aren't fixed.");
      }
    } catch (final Exception ex) {
      log.error(ex.getMessage(), ex);
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.