File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\result\ResultInterface.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.result;
8
9 import org.h2.value.Value;
10
11 /**
12 * The result interface is used by the LocalResult and ResultRemote class.
13 * A result may contain rows, or just an update count.
14 */
15 public interface ResultInterface {
16
17 /**
18 * Go to the beginning of the result, that means
19 * before the first row.
20 */
21 void reset();
22
23 /**
24 * Get the current row.
25 *
26 * @return the row
27 */
28 Value[] currentRow();
29
30 /**
31 * Go to the next row.
32 *
33 * @return true if a row exists
34 */
35 boolean next();
36
37 /**
38 * Get the current row id, starting with 0.
39 * -1 is returned when next() was not called yet.
40 *
41 * @return the row id
42 */
43 int getRowId();
44
45 /**
46 * Get the number of visible columns.
47 * More columns may exist internally for sorting or grouping.
48 *
49 * @return the number of columns
50 */
51 int getVisibleColumnCount();
52
53 /**
54 * Get the number of rows in this object.
55 *
56 * @return the number of rows
57 */
58 int getRowCount();
59
60 /**
61 * Check if this result set should be closed, for example because it is
62 * buffered using a temporary file.
63 *
64 * @return true if close should be called.
65 */
66 boolean needToClose();
67
68 /**
69 * Close the result and delete any temporary files
70 */
71 void close();
72
73 /**
74 * Get the column alias name for the column.
75 *
76 * @param i the column number (starting with 0)
77 * @return the alias name
78 */
79 String getAlias(int i);
80
81 /**
82 * Get the schema name for the column, if one exists.
83 *
84 * @param i the column number (starting with 0)
85 * @return the schema name or null
86 */
87 String getSchemaName(int i);
88
89 /**
90 * Get the table name for the column, if one exists.
91 *
92 * @param i the column number (starting with 0)
93 * @return the table name or null
94 */
95 String getTableName(int i);
96
97 /**
98 * Get the column name.
99 *
100 * @param i the column number (starting with 0)
101 * @return the column name
102 */
103 String getColumnName(int i);
104
105 /**
106 * Get the column data type.
107 *
108 * @param i the column number (starting with 0)
109 * @return the column data type
110 */
111 int getColumnType(int i);
112
113 /**
114 * Get the precision for this column.
115 *
116 * @param i the column number (starting with 0)
117 * @return the precision
118 */
119 long getColumnPrecision(int i);
120
121 /**
122 * Get the scale for this column.
123 *
124 * @param i the column number (starting with 0)
125 * @return the scale
126 */
127 int getColumnScale(int i);
128
129 /**
130 * Get the display size for this column.
131 *
132 * @param i the column number (starting with 0)
133 * @return the display size
134 */
135 int getDisplaySize(int i);
136
137 /**
138 * Check if this is an auto-increment column.
139 *
140 * @param i the column number (starting with 0)
141 * @return true for auto-increment columns
142 */
143 boolean isAutoIncrement(int i);
144
145 /**
146 * Check if this column is nullable.
147 *
148 * @param i the column number (starting with 0)
149 * @return Column.NULLABLE_*
150 */
151 int getNullable(int i);
152
153 /**
154 * Set the fetch size for this result set.
155 *
156 * @param fetchSize the new fetch size
157 */
158 void setFetchSize(int fetchSize);
159
160 /**
161 * Get the current fetch size for this result set.
162 *
163 * @return the fetch size
164 */
165 int getFetchSize();
166
167 }
168