/** * Adds a column to the result set. * All columns must be added before adding rows. * * @param name null is replaced with C1, C2,... * @param sqlType the value returned in getColumnType(..) * @param sqlTypeName the type name return in getColumnTypeName(..) * @param precision the precision * @param scale the scale */ public void addColumn(String name, int sqlType, String sqlTypeName, int precision, int scale) { if (rows != null && !rows.isEmpty()) { throw new IllegalStateException( "Cannot add a column after adding rows"); } if (name == null) { name = "C" + (columns.size() + 1); } Column column = new Column(); column.name = name; column.sqlType = sqlType; column.precision = precision; column.scale = scale; column.sqlTypeName = sqlTypeName; columns.add(column); }
/** * Adds a column to the result set. * All columns must be added before adding rows. * * @param name null is replaced with C1, C2,... * @param sqlType the value returned in getColumnType(..) * @param sqlTypeName the type name return in getColumnTypeName(..) * @param precision the precision * @param scale the scale */ public void addColumn(String name, int sqlType, String sqlTypeName, int precision, int scale) { if (rows != null && rows.size() > 0) { throw new IllegalStateException( "Cannot add a column after adding rows"); } if (name == null) { name = "C" + (columns.size() + 1); } Column column = new Column(); column.name = name; column.sqlType = sqlType; column.precision = precision; column.scale = scale; column.sqlTypeName = sqlTypeName; columns.add(column); }
/** * Adds a column to the result set. * All columns must be added before adding rows. * * @param name null is replaced with C1, C2,... * @param sqlType the value returned in getColumnType(..) * @param sqlTypeName the type name return in getColumnTypeName(..) * @param precision the precision * @param scale the scale */ public void addColumn(String name, int sqlType, String sqlTypeName, int precision, int scale) { if (rows != null && rows.size() > 0) { throw new IllegalStateException( "Cannot add a column after adding rows"); } if (name == null) { name = "C" + (columns.size() + 1); } Column column = new Column(); column.name = name; column.sqlType = sqlType; column.precision = precision; column.scale = scale; column.sqlTypeName = sqlTypeName; columns.add(column); }
/** * Adds a column to the result set. * * @param name null is replaced with C1, C2,... * @param sqlType the value returned in getColumnType(..) (ignored internally) * @param precision the precision * @param scale the scale * @throws SQLException */ public void addColumn(String name, int sqlType, int precision, int scale) throws SQLException { if (rows != null && rows.size() > 0) { throw new SQLException("Cannot add a column after adding rows", "21S02"); } if (name == null) { name = "C" + (columns.size() + 1); } Column column = new Column(); column.name = name; column.sqlType = sqlType; column.precision = precision; column.scale = scale; columns.add(column); }