code: public static String[] getColumnNames(DataSource ds, String tableName) {
  		List<String> columnNames = new ArrayList<String>();
  		Connection conn = null;
  		ResultSet rs = null;
  		try {
  			conn = ds.getConnection();
  			final DatabaseMetaData metaData = conn.getMetaData();
  			rs = metaData.getColumns(conn.getCatalog(), null, tableName, null);
  			while (rs.next()) {
  				columnNames.add(rs.getString("COLUMN_NAME"));
  			}
  			return columnNames.toArray(new String[columnNames.size()]);
  		} catch (Exception e) {
  			throw new DbRuntimeException("Get columns error!", e);
  		} finally {
  			DbUtil.close(rs, conn);
  		}
  	}
docs: 获得表的所有列名
  
  @param ds 数据源
  @param tableName 表名
  @return 列数组
  @throws DbRuntimeException SQL执行异常