snaker-core/src/main/java/org/snaker/engine/access/jdbc/JdbcAccess.java
public Object query(int column, String sql, Object... params) {
    	Object result;
        try {
        	if(log.isDebugEnabled()) {
        		log.debug("查询单列数据=\n" + sql);
        	}
            result = runner.query(getConnection(), sql, new ScalarHandler(column), params);
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
            throw new RuntimeException(e.getMessage(), e);
        }
        return result;
    }
public Object query(int column, String sql, Object... params) {
    	Object result;
        try {
        	if(log.isDebugEnabled()) {
        		log.debug("查询单列数据=\n" + sql);
        	}
            result = runner.query(getConnection(), sql, new ScalarHandler(column), params);
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
            throw new RuntimeException(e.getMessage(), e);
        }
        return result;
    }
public Object query ( int column , String sql , Object ... params ) { Object result ; try { if ( log . isDebugEnabled ( ) ) { log . debug ( "查询单列数据=\n" + sql); } result = runner . query ( getConnection ( ) , sql , new ScalarHandler ( column ) , params ) ; } catch ( SQLException e ) { log . error ( e . getMessage ( ) , e ) ; throw new RuntimeException ( e . getMessage ( ) , e ) ; } return result ; }
查询指定列
@param column 结果集的列索引号
@param sql sql语句
@param params 查询参数
@return 指定列的结果对象
查询指定列