01: /*
02:
03: Derby - Class org.apache.derby.client.am.SqlCode
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.client.am;
23:
24: // This class is for strong-typing.
25: //
26: // Dnc architected codes in the range +/- 4200 to 4299, plus one additional code for -4499.
27: //
28: // SQL codes are architected by the product that issues them.
29: //
30:
31: public class SqlCode {
32: private int code_;
33:
34: public SqlCode(int code) {
35: code_ = code;
36: }
37:
38: /**
39: * Return the SQL code represented by this instance.
40: *
41: * @return an SQL code
42: */
43: public final int getCode() {
44: return code_;
45: }
46:
47: public final static SqlCode invalidCommitOrRollbackUnderXA = new SqlCode(
48: -4200);
49:
50: public final static SqlCode invalidSetAutoCommitUnderXA = new SqlCode(
51: -4201);
52:
53: public final static SqlCode queuedXAError = new SqlCode(-4203);
54:
55: public final static SqlCode disconnectError = new SqlCode(-4499);
56:
57: public final static SqlCode undefinedError = new SqlCode(-99999);
58:
59: /** SQL code for SQL state 02000 (end of data). DRDA does not
60: * specify the SQL code for this SQL state, but Derby uses 100. */
61: public final static SqlCode END_OF_DATA = new SqlCode(100);
62: }
|