Package org.springframework.jdbc

Examples of org.springframework.jdbc.IncorrectResultSetColumnCountException


  public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
    // Validate column count.
    ResultSetMetaData rsmd = rs.getMetaData();
    int nrOfColumns = rsmd.getColumnCount();
    if (nrOfColumns != 1) {
      throw new IncorrectResultSetColumnCountException(1, nrOfColumns);
    }

    // Extract column value from JDBC ResultSet.
    Object result = getColumnValue(rs, 1, this.requiredType);
    if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) {
View Full Code Here


  public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
    // Validate column count.
    ResultSetMetaData rsmd = rs.getMetaData();
    int nrOfColumns = rsmd.getColumnCount();
    if (nrOfColumns != 1) {
      throw new IncorrectResultSetColumnCountException(1, nrOfColumns);
    }

    // Extract column value from JDBC ResultSet
    Object result = getColumnValue(rs, 1, this.requiredType);
    if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) {
View Full Code Here

  public T mapRow(ResultSet rs, int rowNum) throws SQLException {
    // Validate column count.
    ResultSetMetaData rsmd = rs.getMetaData();
    int nrOfColumns = rsmd.getColumnCount();
    if (nrOfColumns != 1) {
      throw new IncorrectResultSetColumnCountException(1, nrOfColumns);
    }

    // Extract column value from JDBC ResultSet.
    Object result = getColumnValue(rs, 1, this.requiredType);
    if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) {
View Full Code Here

  public T mapRow(ResultSet rs, int rowNum) throws SQLException {
    // Validate column count.
    ResultSetMetaData rsmd = rs.getMetaData();
    int nrOfColumns = rsmd.getColumnCount();
    if (nrOfColumns != 1) {
      throw new IncorrectResultSetColumnCountException(1, nrOfColumns);
    }

    // Extract column value from JDBC ResultSet.
    Object result = getColumnValue(rs, 1, this.requiredType);
    if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) {
View Full Code Here

    @Override
    public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
      ResultSetMetaData metaData = rs.getMetaData();
      int columns = metaData.getColumnCount();
      if (columns != 1) {
        throw new IncorrectResultSetColumnCountException(1, columns);
      }
      return JdbcUtils.getResultSetValue(rs, 1);
    }
View Full Code Here

        // 验证列的数目
        if (rowNum == 0) {
            ResultSetMetaData rsmd = rs.getMetaData();
            int nrOfColumns = rsmd.getColumnCount();
            if (nrOfColumns != 2) {
                throw new IncorrectResultSetColumnCountException(2, nrOfColumns);
            }

            if (StringUtils.isNotEmpty(keyColumn)) {
                keyColumnIndex = rs.findColumn(keyColumn);
                if (keyColumnIndex == 1) {
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.IncorrectResultSetColumnCountException

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.