diff -r ff5bbc06ed29 -r be8db46a38c3 java/sql-dk/src/info/globalcode/sql/dk/formatting/ColumnsHeader.java --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/ColumnsHeader.java Mon Dec 23 11:52:49 2013 +0100 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/ColumnsHeader.java Mon Dec 23 12:16:22 2013 +0100 @@ -27,13 +27,13 @@ * @author Ing. František Kučera (frantovo.cz) */ public class ColumnsHeader { - + private ResultSetMetaData metaData; - + public ColumnsHeader(ResultSetMetaData metaData) { this.metaData = metaData; } - + public int getColumnCount() { try { return metaData.getColumnCount(); @@ -41,16 +41,19 @@ throw new IllegalStateException("Error during getting column count.", e); } } - + public List getColumnDescriptors() { try { int count = metaData.getColumnCount(); List list = new ArrayList<>(count); - + for (int i = 1; i <= count; i++) { ColumnDescriptor cd = new ColumnDescriptor(); + cd.setFirstColumn(i == 1); cd.setLastColumn(i == count); + cd.setColumnNumber(i); + cd.setLabel(metaData.getColumnLabel(i)); cd.setName(metaData.getColumnName(i)); cd.setType(metaData.getColumnType(i)); @@ -58,7 +61,7 @@ /** TODO: more properties */ list.add(cd); } - + return list; } catch (SQLException e) { throw new IllegalStateException("Error during building column descriptors.", e);