01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2005 Continuent, Inc.
04: * Contact: sequoia@continuent.org
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: * Initial developer(s): Emmanuel Cecchet.
19: * Contributor(s): ______________________.
20: */package org.continuent.sequoia.controller.backend.result;
21:
22: import java.io.Serializable;
23: import java.util.LinkedList;
24: import java.util.List;
25:
26: /**
27: * This class stores the result of a call to Statement.execute() and chains the
28: * updateCount and ResultSets in a list. Note that all results must be added in
29: * the order they were retrieved.
30: *
31: * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
32: * @version 1.0
33: */
34: public class ExecuteResult extends AbstractResult implements
35: Serializable {
36: private static final long serialVersionUID = 3303766819336440504L;
37:
38: private LinkedList results;
39:
40: /**
41: * Creates a new <code>ExecuteResult</code> object
42: */
43: public ExecuteResult() {
44: results = new LinkedList();
45: }
46:
47: /**
48: * Add a controller ResultSet to the list of results.
49: *
50: * @param crs the ControllerResultSet to add
51: */
52: public void addResult(ControllerResultSet crs) {
53: results.addLast(crs);
54: }
55:
56: /**
57: * Add an Integer object corresponding to the given update count to the list
58: * of results.
59: *
60: * @param updateCount the update count to add
61: */
62: public void addResult(int updateCount) {
63: results.addLast(new Integer(updateCount));
64: }
65:
66: /**
67: * Returns the results value.
68: *
69: * @return Returns the results.
70: */
71: public final List getResults() {
72: return results;
73: }
74:
75: }
|