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.driver;
21:
22: import java.sql.SQLWarning;
23:
24: /**
25: * This class stores the result of a call to Statement.executeUpdate(sql,
26: * Statement.RETURN_GENERATED_KEYS);
27: *
28: * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
29: * @version 1.0
30: */
31: public class DriverGeneratedKeysResult {
32: private int updateCount = 0;
33: private DriverResultSet drs;
34: private SQLWarning statementWarnings;
35:
36: /**
37: * Creates a new <code>DriverGeneratedKeysResult</code> object
38: *
39: * @param drs the ControllerResultSet containing the autogenerated keys
40: * @param updateCount the update count returned by the executeUpdate exection
41: * @param sqlw SQL Warnings
42: */
43: public DriverGeneratedKeysResult(DriverResultSet drs,
44: int updateCount, SQLWarning sqlw) {
45: this .drs = drs;
46: this .updateCount = updateCount;
47: this .statementWarnings = sqlw;
48: }
49:
50: /**
51: * Returns the DriverResultSet value.
52: *
53: * @return Returns the drs.
54: */
55: public final DriverResultSet getDriverResultSet() {
56: return drs;
57: }
58:
59: /**
60: * Returns the updateCount value.
61: *
62: * @return Returns the updateCount.
63: */
64: public final int getUpdateCount() {
65: return updateCount;
66: }
67:
68: /**
69: * Returns the warnings value.
70: *
71: * @return the updateCount warning chain.
72: */
73: public SQLWarning getWarnings() {
74: return statementWarnings;
75: }
76:
77: }
|