1 package com.quantum.sql;
3 import java.util.ArrayList;
4 import java.util.Vector;
11 public class SQLResults {
14 private ArrayList rows = new ArrayList();
15 private Vector columns;
16 private Vector columnTypes;
17 private int[] columnSizes;
18 private int updateCount = 0;
19 private boolean resultSet = false;
20 private boolean hasMore = false;
21 private boolean isError = false;
22 private int maxSize = -1;
24 public void setColumnNames(Vector columns) {
25 this.columns = columns;
27 public String getColumnName(int column) {
28 if (columns.size() < column) return ""; //$NON-NLS-1$
29 return columns.elementAt(column - 1).toString();
32 public void setColumnTypes(Vector columnsTypes) {
33 this.columnTypes = columnsTypes;
35 public String getColumnType(int column) {
36 if (columnTypes.size() < column) return ""; //$NON-NLS-1$
37 return columnTypes.elementAt(column - 1).toString();
39 public void setColumnSizes(int[] columnSizes) {
40 this.columnSizes = columnSizes;
42 public int getColumnSize(int column) {
43 if (columnSizes.length < column) return 0;
44 return columnSizes[column - 1];
46 public void addRow(Vector row) {
49 public Object getElement(int column, int row) {
50 return ((Vector) rows.get(row - 1)).elementAt(column - 1);
52 public int getColumnCount() {
53 if (columns.size() > 0) {
54 return columns.size();
58 public int getRowCount() {
65 public String getQuery() {
71 * @param query The query to set
73 public void setQuery(String query) {
78 * Returns the resultSet.
81 public boolean isResultSet() {
87 * @param resultSet The resultSet to set
89 public void setResultSet(boolean resultSet) {
90 this.resultSet = resultSet;
93 public int getUpdateCount() {
97 public void setUpdateCount(int updateCount) {
98 this.updateCount = updateCount;
101 public String getTable() {
105 public void setTable(String table) {
109 public boolean hasMore() {
113 public void setHasMore(boolean hasMore) {
114 this.hasMore = hasMore;
117 public int getMaxSize() {
121 public void setMaxSize(int maxSize) {
122 this.maxSize = maxSize;
125 public boolean isError() {
129 public void setIsError(boolean isError) {
130 this.isError = isError;
135 public Object[] getRows() {
136 return rows.toArray();