Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.SingleColumnRowMapper


  }

  public Object queryForObject(String sql, SqlParameterSource paramSource, Class requiredType)
      throws DataAccessException {

    return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType));
  }
View Full Code Here


    return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType));
  }

  public Object queryForObject(String sql, Map paramMap, Class requiredType) throws DataAccessException {
    return queryForObject(sql, paramMap, new SingleColumnRowMapper(requiredType));
  }
View Full Code Here

    return queryForInt(sql, new MapSqlParameterSource(paramMap));
  }

  public List queryForList(String sql, SqlParameterSource paramSource, Class elementType)
      throws DataAccessException {
    return query(sql, paramSource, new SingleColumnRowMapper(elementType));
  }
View Full Code Here

  }

  public Object queryForObject(String sql, SqlParameterSource paramSource, Class requiredType)
      throws DataAccessException {

    return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType));
  }
View Full Code Here

    return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType));
  }

  public Object queryForObject(String sql, Map paramMap, Class requiredType) throws DataAccessException {
    return queryForObject(sql, paramMap, new SingleColumnRowMapper(requiredType));
  }
View Full Code Here

    return queryForInt(sql, new MapSqlParameterSource(paramMap));
  }

  public List queryForList(String sql, SqlParameterSource paramSource, Class elementType)
      throws DataAccessException {
    return query(sql, paramSource, new SingleColumnRowMapper(elementType));
  }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public static List<String> findSchemas(JdbcTemplate jdbcTemplate, final String schemaPattern) {
        try {
            if (StringUtils.isEmpty(schemaPattern)) {
                return jdbcTemplate.query("show databases", new SingleColumnRowMapper(String.class));
            }
            return jdbcTemplate.query("show databases like ?", new Object[] { schemaPattern },
                                      new SingleColumnRowMapper(String.class));
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new ArrayList<String>();
        }
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public static List<String> findSchemas(JdbcTemplate jdbcTemplate, final String schemaPattern) {
        try {
            if (StringUtils.isEmpty(schemaPattern)) {
                return jdbcTemplate.query("show databases", new SingleColumnRowMapper(String.class));
            }
            return jdbcTemplate.query("show databases like ?",
                new Object[] { schemaPattern },
                new SingleColumnRowMapper(String.class));
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new ArrayList<String>();
        }
    }
View Full Code Here

  }

  public long getLastModified(Object templateSource) {
    if(StringUtils.hasText(timestampColumn)) {
      String templateName = (String)templateSource;
        Object timestamp = getJdbcTemplate().queryForObject(getSql(timestampColumn),new Object[]{templateName},new SingleColumnRowMapper());
        if(timestamp instanceof Number) {
          return ((Number)timestamp).longValue();
        }else if(timestamp instanceof Date) {
          return ((Date)timestamp).getTime();
        }else {
View Full Code Here

        // 返回单列的查询的(或者返回只有2列的Map类型查询的)
        if (TypeUtils.isColumnType(rowType)) {
            if (returnClassType == Map.class) {
                rowMapper = new MapEntryColumnRowMapper(modifier, rowType);
            } else {
                rowMapper = new SingleColumnRowMapper(rowType);
            }
        }
        // 返回多列的,用Bean对象、集合、映射、数组来表示每一行的
        else {
            if (rowType == Map.class) {
View Full Code Here

TOP

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

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.