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;
25 public void setColumnNames(Vector columns) {
26 this.columns = columns;
28 public String getColumnName(int column) {
29 if (columns.size() < column) return ""; //$NON-NLS-1$
30 return columns.elementAt(column - 1).toString();
33 public void setColumnTypes(Vector columnsTypes) {
34 this.columnTypes = columnsTypes;
36 public String getColumnType(int column) {
37 if (columnTypes.size() < column) return ""; //$NON-NLS-1$
38 return columnTypes.elementAt(column - 1).toString();
40 public void setColumnSizes(int[] columnSizes) {
41 this.columnSizes = columnSizes;
43 public int getColumnSize(int column) {
44 if (columnSizes.length < column) return 0;
45 return columnSizes[column - 1];
47 public void addRow(Vector row) {
50 public Object getElement(int column, int row) {
51 return ((Vector) rows.get(row - 1)).elementAt(column - 1);
53 public int getColumnCount() {
54 if (columns.size() > 0) {
55 return columns.size();
59 public int getRowCount() {
66 public String getQuery() {
72 * @param query The query to set
74 public void setQuery(String query) {
79 * Returns the resultSet.
82 public boolean isResultSet() {
88 * @param resultSet The resultSet to set
90 public void setResultSet(boolean resultSet) {
91 this.resultSet = resultSet;
94 public int getUpdateCount() {
98 public void setUpdateCount(int updateCount) {
99 this.updateCount = updateCount;
102 public String getTable() {
106 public void setTable(String table) {
110 public boolean hasMore() {
114 public void setHasMore(boolean hasMore) {
115 this.hasMore = hasMore;
118 public int getMaxSize() {
122 public void setMaxSize(int maxSize) {
123 this.maxSize = maxSize;
126 public boolean isError() {
130 public void setIsError(boolean isError) {
131 this.isError = isError;
136 public Object[] getRows() {
137 return rows.toArray();
140 public long getTime() {
143 public void setTime(long time) {