KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > client > am > SqlCode


1 /*
2
3    Derby - Class org.apache.derby.client.am.SqlCode
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (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(-4200);
48
49     public final static SqlCode invalidSetAutoCommitUnderXA = new SqlCode(-4201);
50
51     public final static SqlCode queuedXAError = new SqlCode(-4203);
52
53     public final static SqlCode disconnectError = new SqlCode(-4499);
54
55     public final static SqlCode undefinedError = new SqlCode(-99999);
56     
57     /** SQL code for SQL state 02000 (end of data). DRDA does not
58      * specify the SQL code for this SQL state, but Derby uses 100. */

59     public final static SqlCode END_OF_DATA = new SqlCode(100);
60 }
61
Popular Tags