tabular formatter: new option 'separateBy' to print horizontal separator on each change of given column
3 * Copyright © 2014 František Kučera (frantovo.cz)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package info.globalcode.sql.dk.formatting;
19 import info.globalcode.sql.dk.SQLType;
20 import java.sql.Array;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
26 * Fake SQL array, for formatting purposes only
28 * @author Ing. František Kučera (frantovo.cz)
30 public class FakeSqlArray implements Array {
32 private static final UnsupportedOperationException exception = new UnsupportedOperationException("This is just a fake SQL array.");
33 private final Object[] data;
34 private final SQLType baseType;
36 public FakeSqlArray(Object[] data, SQLType baseType) {
38 this.baseType = baseType;
42 public String toString() {
43 StringBuilder string = new StringBuilder();
44 for (Object o : data) {
48 return string.toString();
52 public String getBaseTypeName() throws SQLException {
53 return baseType.name();
57 public int getBaseType() throws SQLException {
58 return baseType.getCode();
62 public Object getArray() throws SQLException {
67 public Object getArray(Map<String, Class<?>> map) throws SQLException {
72 public Object getArray(long index, int count) throws SQLException {
77 public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
82 public ResultSet getResultSet() throws SQLException {
87 public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
92 public ResultSet getResultSet(long index, int count) throws SQLException {
97 public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
102 public void free() throws SQLException {