1 package net.sourceforge.phpdt.sql.sql;
3 import java.util.ArrayList;
4 import java.util.Vector;
9 * To change this generated comment edit the template variable "typecomment":
10 * Window>Preferences>Java>Templates.
11 * To enable and disable the creation of type comments go to
12 * Window>Preferences>Java>Code Generation.
14 public class SQLResults {
17 private ArrayList rows = new ArrayList();
18 private Vector columns;
19 private Vector columnTypes;
20 private int updateCount = 0;
21 private boolean resultSet = false;
22 private boolean hasMore = false;
23 private boolean isError = false;
24 private int maxSize = -1;
25 public void setColumnNames(Vector columns) {
26 this.columns = columns;
28 public String getColumnName(int column) {
29 return columns.elementAt(column - 1).toString();
31 public String getColumnType(int column) {
32 return columnTypes.elementAt(column - 1).toString();
34 public void addRow(Vector row) {
37 public Object getElement(int column, int row) {
38 return ((Vector) rows.get(row - 1)).elementAt(column - 1);
40 public int getColumnCount() {
41 if (columns.size() > 0) {
42 return columns.size();
46 public int getRowCount() {
53 public String getQuery() {
59 * @param query The query to set
61 public void setQuery(String query) {
66 * Returns the resultSet.
69 public boolean isResultSet() {
75 * @param resultSet The resultSet to set
77 public void setResultSet(boolean resultSet) {
78 this.resultSet = resultSet;
81 public int getUpdateCount() {
85 public void setUpdateCount(int updateCount) {
86 this.updateCount = updateCount;
89 public String getTable() {
93 public void setTable(String table) {
97 public void setColumnsTypes(Vector columnsTypes) {
98 this.columnTypes = columnsTypes;
101 public boolean hasMore() {
105 public void setHasMore(boolean hasMore) {
106 this.hasMore = hasMore;
109 public int getMaxSize() {
113 public void setMaxSize(int maxSize) {
114 this.maxSize = maxSize;
117 public boolean isError() {
121 public void setIsError(boolean isError) {
122 this.isError = isError;