1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package javax.servlet.jsp.jstl.sql;
18
19 import java.util.SortedMap;
20
21 /***
22 * <p>This interface represents the result of a <sql:query>
23 * action. It provides access to the following information in the
24 * query result:</p>
25 *
26 * <ul>
27 * <li> result rows
28 * <li> result rows using an index
29 * <li> number of rows in the result
30 * <li> result meta data
31 * <li> indication whether result returned is a complete set or
32 * a subset limited by a maximum row setting
33 * </ul>
34 *
35 * @author Justyna Horwat
36 *
37 */
38 public interface Result {
39
40 /***
41 * Returns an array of SortedMap objects. Column name is used as the key
42 * for the column value. SortedMap must use the CASE_INSENSITIVE_ORDER
43 * Comparator so that the key is the case insensitive representation
44 * of the column name.
45 *
46 * @return the result rows as an array of <code>SortedMap</code> objects
47 */
48 public SortedMap[] getRows();
49
50 /***
51 * Returns an array of Objects[]. The first index
52 * designates the Row, the second the Column. The array
53 * stores the value at the specified row and column.
54 *
55 * @return the result rows as an array of <code>Object[]</code> objects
56 */
57 public Object[][] getRowsByIndex();
58
59 /***
60 * Returns an array of column names.
61 *
62 * @return the column names as an array of <code>String</code> objects
63 */
64 public String[] getColumnNames();
65
66 /***
67 * Returns the number of rows in the cached ResultSet
68 *
69 * @return the number of rows in the result
70 */
71 public int getRowCount();
72
73 /***
74 * Returns true of the query was limited by a maximum row setting
75 *
76 * @return <tt>true</tt> if the query was limited by a maximum
77 * row setting
78 */
79 public boolean isLimitedByMaxRows();
80 }