KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > backend > result > ExecuteResult


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2005 Continuent, Inc.
4  * Contact: sequoia@continuent.org
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
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  */

21
22 package org.continuent.sequoia.controller.backend.result;
23
24 import java.io.Serializable JavaDoc;
25 import java.util.LinkedList JavaDoc;
26 import java.util.List JavaDoc;
27
28 /**
29  * This class stores the result of a call to Statement.execute() and chains the
30  * updateCount and ResultSets in a list. Note that all results must be added in
31  * the order they were retrieved.
32  *
33  * @author <a HREF="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
34  * @version 1.0
35  */

36 public class ExecuteResult extends AbstractResult implements Serializable JavaDoc
37 {
38   private static final long serialVersionUID = 3303766819336440504L;
39
40   private LinkedList JavaDoc results;
41
42   /**
43    * Creates a new <code>ExecuteResult</code> object
44    */

45   public ExecuteResult()
46   {
47     results = new LinkedList JavaDoc();
48   }
49
50   /**
51    * Add a controller ResultSet to the list of results.
52    *
53    * @param crs the ControllerResultSet to add
54    */

55   public void addResult(ControllerResultSet crs)
56   {
57     results.addLast(crs);
58   }
59
60   /**
61    * Add an Integer object corresponding to the given update count to the list
62    * of results.
63    *
64    * @param updateCount the update count to add
65    */

66   public void addResult(int updateCount)
67   {
68     results.addLast(new Integer JavaDoc(updateCount));
69   }
70
71   /**
72    * Returns the results value.
73    *
74    * @return Returns the results.
75    */

76   public final List JavaDoc getResults()
77   {
78     return results;
79   }
80
81 }
82
Popular Tags