KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2006 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): Gilles Rayrat.
19  * Contributor(s): ______________________.
20  */

21
22 package org.continuent.sequoia.controller.backend.result;
23
24 import java.io.Serializable JavaDoc;
25 import java.sql.SQLWarning JavaDoc;
26
27 /**
28  * Super-class for all results of [Prepared|Callable]Statement.XXXExecuteXXX()
29  * commands that holds the sql warning chain generated by the execution of this
30  * command.<br>
31  * In order to introduce the sql warnings support, every command issued on a
32  * backend must call getWarnings() right after its execution. This is the only
33  * way to keep the context and to make sure that no other command is issued
34  * between the execute and the getWarnings.<br>
35  * Warnings are *not* retrieved by default, so there will be no performance
36  * issue for those who don't need warnings. To enable them, use
37  * "?retrieveSQLWarnings=true" URL option at connection time (this is a
38  * by-connection property)
39  *
40  * @author <a HREF="mailto:gilles.rayrat@continuent.com">Gilles Rayrat</a>
41  * @version 1.0
42  */

43 public abstract class AbstractResult implements Serializable JavaDoc
44 {
45   private SQLWarning JavaDoc statementWarnings = null;
46
47   /**
48    * Get the warning chain associated to the current result
49    *
50    * @return the warning chain or null if there were no warning, or if warnings
51    * retrieval was not enabled for this connection
52    */

53   public SQLWarning JavaDoc getStatementWarnings()
54   {
55     return statementWarnings;
56   }
57
58   /**
59    * Associate a warning chain for the current result
60    *
61    * @param warnings the SQL warnings that comes with the result
62    */

63   public void setStatementWarnings(SQLWarning JavaDoc warnings)
64   {
65     this.statementWarnings = warnings;
66   }
67 }
68
Popular Tags