Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.RowCallbackHandler


   * only the ordering of these first three columns.
   */
  public void loadBeanDefinitions(String sql) {
    Assert.notNull(this.jdbcTemplate, "Not fully configured - specify DataSource or JdbcTemplate");
    final Properties props = new Properties();
    this.jdbcTemplate.query(sql, new RowCallbackHandler() {
      public void processRow(ResultSet rs) throws SQLException {
        String beanName = rs.getString(1);
        String property = rs.getString(2);
        String value = rs.getString(3);
        // Make a properties entry by combining bean name and property.
View Full Code Here


    NamedParameterJdbcTemplate jt = new NamedParameterJdbcTemplate(mockDataSource);
    Map params = new HashMap();
    params.put("id", new SqlParameterValue(Types.DECIMAL, new Integer(1)));
    params.put("country", "UK");
    final List customers = new LinkedList();
    jt.query(SELECT_NAMED_PARAMETERS, params, new RowCallbackHandler() {
      public void processRow(ResultSet rs) throws SQLException {
        Customer cust = new Customer();
        cust.setId(rs.getInt(COLUMN_NAMES[0]));
        cust.setForename(rs.getString(COLUMN_NAMES[1]));
        customers.add(cust);
View Full Code Here

            return new StreamingStatementCreator(originalCreator);
          }

        };
        final AtomicInteger rowNum = new AtomicInteger(0);
        template.query(sql, params, new RowCallbackHandler() {

          @Override
          public void processRow(ResultSet rs) throws SQLException {
            handler.handleRow(mapper.mapRow(rs, rowNum.incrementAndGet()));
          }
View Full Code Here

   * @see org.apache.ctakes.ytex.libsvm.LibSVMUtil#loadClassLabels(java.lang.String, java.util.Set)
   */
  public SortedMap<Integer, Map<String, Integer>> loadClassLabels(
      String strQuery, final Set<String> labels) {
    final SortedMap<Integer, Map<String, Integer>> instanceLabelsMap = new TreeMap<Integer, Map<String, Integer>>();
    jdbcTemplate.query(strQuery, new RowCallbackHandler() {

      @Override
      public void processRow(ResultSet rs) throws SQLException {
        int instanceId = rs.getInt(1);
        String label = rs.getString(2);
View Full Code Here

  private void loadDocumentIds(final List<Long> documentIds,
      final List<Long> testDocumentIds, final String instanceIDQuery) {
    txTemplate.execute(new TransactionCallback<Object>() {
      @Override
      public List<Integer> doInTransaction(TransactionStatus arg0) {
        jdbcTemplate.query(instanceIDQuery, new RowCallbackHandler() {
          Boolean trainFlag = null;

          /**
           * <ul>
           * <li>1st column - document id
View Full Code Here

   */
  @Override
  public Map<String, Double> getFrequencies(String freqQuery) {
    // get the raw frequency
    final Map<String, Double> rawFreq = new HashMap<String, Double>();
    jdbcTemplate.query(freqQuery, new RowCallbackHandler() {

      @Override
      public void processRow(ResultSet rs) throws SQLException {
        rawFreq.put(rs.getString(1), rs.getDouble(2));
      }
View Full Code Here

      // }
      //
      // } @Override
      public Object doInTransaction(TransactionStatus txStatus) {
        prepare(prepareScript, prepareScriptDelimiter, params);
        namedJdbcTemplate.query(sql, params, new RowCallbackHandler() {

          @Override
          public void processRow(ResultSet rs) throws SQLException {
            long instanceId = rs.getLong(1);
            String word = rs.getString(2);
View Full Code Here

        // ResultSet.TYPE_FORWARD_ONLY,
        // ResultSet.CONCUR_READ_ONLY);
        // }
        //
        // }
            , new RowCallbackHandler() {

              @Override
              public void processRow(ResultSet rs)
                  throws SQLException {
                long instanceId = rs.getLong(1);
View Full Code Here

            return conn.prepareStatement(sql,
                ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY);
          }

        }, new RowCallbackHandler() {
          private Set<String> numericColumnHeaders;
          private Set<String> nominalColumnHeaders;

          private void initMetaData(ResultSet rs) throws SQLException {
            if (numericColumnHeaders == null) {
View Full Code Here

            return conn.prepareStatement(sql,
                ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY);
          }

        }, new RowCallbackHandler() {

          @Override
          public void processRow(ResultSet rs) throws SQLException {
            int instanceId = rs.getInt(1);
            String word = rs.getString(2);
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.RowCallbackHandler

Copyright © 2018 www.massapicom. 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.