public String[] getColumnsBySql(Sql sql) throws SQLException {
		String columns[] = null;
		
		List<Map<String, String>> table = getMetadataBySql(sql);
		if (table != null) {
			columns = new String[table.size()];
			for (int i = 0 ; i < table.size() ; i++) {
				Map<String, String> row = table.get(i);
				if (row.containsKey("NAME") && row.get("NAME") != null) {
					columns[i] = row.get("NAME");
				}
			}
		}
		
		return columns;
	}
public String [ ] getColumnsBySql ( Sql sql ) throws SQLException { String columns [ ] = null ; List < Map < String , String > > table = getMetadataBySql ( sql ) ; if ( table != null ) { columns = new String [ table . size ( ) ] ; for ( int i = 0 ; i < table . size ( ) ; i ++ ) { Map < String , String > row = table . get ( i ) ; if ( row . containsKey ( "NAME" ) && row . get ( "NAME" ) != null ) { columns [ i ] = row . get ( "NAME" ) ; } } } return columns ; }
根据SQL语句获取SQL返回的列名

@param sql SQL语句

@return 列名

@throws SQLException SQL执行异常