1 package net.sourceforge.phpdt.sql.sql;
3 import java.util.ArrayList;
4 import java.util.Vector;
6 import org.apache.xml.utils.IntVector;
8 public class SQLResults {
11 private ArrayList rows = new ArrayList();
12 private Vector columns;
13 private Vector columnTypes;
14 private IntVector columnSizes;
15 private int updateCount = 0;
16 private boolean resultSet = false;
17 private boolean hasMore = false;
18 private boolean isError = false;
19 private int maxSize = -1;
21 public void setColumnNames(Vector columns) {
22 this.columns = columns;
24 public String getColumnName(int column) {
25 if (columns.size() < column) return ""; //$NON-NLS-1$
26 return columns.elementAt(column - 1).toString();
29 public void setColumnTypes(Vector columnsTypes) {
30 this.columnTypes = columnsTypes;
32 public String getColumnType(int column) {
33 if (columnTypes.size() < column) return ""; //$NON-NLS-1$
34 return columnTypes.elementAt(column - 1).toString();
36 public void setColumnSizes(IntVector columnSizes) {
37 this.columnSizes = columnSizes;
39 public int getColumnSize(int column) {
40 if (columnSizes.size() < column) return 0;
41 return columnSizes.elementAt(column - 1);
43 public void addRow(Vector row) {
46 public Object getElement(int column, int row) {
47 return ((Vector) rows.get(row - 1)).elementAt(column - 1);
49 public int getColumnCount() {
50 if (columns.size() > 0) {
51 return columns.size();
55 public int getRowCount() {
62 public String getQuery() {
68 * @param query The query to set
70 public void setQuery(String query) {
75 * Returns the resultSet.
78 public boolean isResultSet() {
84 * @param resultSet The resultSet to set
86 public void setResultSet(boolean resultSet) {
87 this.resultSet = resultSet;
90 public int getUpdateCount() {
94 public void setUpdateCount(int updateCount) {
95 this.updateCount = updateCount;
98 public String getTable() {
102 public void setTable(String table) {
106 public boolean hasMore() {
110 public void setHasMore(boolean hasMore) {
111 this.hasMore = hasMore;
114 public int getMaxSize() {
118 public void setMaxSize(int maxSize) {
119 this.maxSize = maxSize;
122 public boolean isError() {
126 public void setIsError(boolean isError) {
127 this.isError = isError;