2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * An exception, which is subclass of SQLNonTransientException, is thrown when
22 * various the an integrity constraint (foreign key, primary key or unique key)
25 public class SQLIntegrityConstraintViolationException extends
26 SQLNonTransientException {
28 private static final long serialVersionUID = 8033405298774849169L;
31 * Creates an SQLIntegrityConstraintViolationException object. The Reason
32 * string is set to null, the SQLState string is set to null and the Error
35 public SQLIntegrityConstraintViolationException() {
40 * Creates an SQLIntegrityConstraintViolationException object. The Reason
41 * string is set to the given reason string, the SQLState string is set to
42 * null and the Error Code is set to 0.
45 * the string to use as the Reason string
47 public SQLIntegrityConstraintViolationException(String reason) {
48 super(reason, null, 0);
52 * Creates an SQLIntegrityConstraintViolationException object. The Reason
53 * string is set to the given reason string, the SQLState string is set to
54 * the given SQLState string and the Error Code is set to 0.
57 * the string to use as the Reason string
59 * the string to use as the SQLState string
61 public SQLIntegrityConstraintViolationException(String reason,
63 super(reason, sqlState, 0);
67 * Creates an SQLIntegrityConstraintViolationException object. The Reason
68 * string is set to the given reason string, the SQLState string is set to
69 * the given SQLState string and the Error Code is set to the given error
73 * the string to use as the Reason string
75 * the string to use as the SQLState string
77 * the integer value for the error code
79 public SQLIntegrityConstraintViolationException(String reason,
80 String sqlState, int vendorCode) {
81 super(reason, sqlState, vendorCode);
85 * Creates an SQLIntegrityConstraintViolationException object. The Reason
86 * string is set to the null if cause == null or cause.toString() if
87 * cause!=null,and the cause Throwable object is set to the given cause
91 * the Throwable object for the underlying reason this
94 public SQLIntegrityConstraintViolationException(Throwable cause) {
99 * Creates an SQLIntegrityConstraintViolationException object. The Reason
100 * string is set to the given and the cause Throwable object is set to the
101 * given cause Throwable object.
104 * the string to use as the Reason string
106 * the Throwable object for the underlying reason this
109 public SQLIntegrityConstraintViolationException(String reason,
111 super(reason, cause);
115 * Creates an SQLIntegrityConstraintViolationException object. The Reason
116 * string is set to the given reason string, the SQLState string is set to
117 * the given SQLState string and the cause Throwable object is set to the
118 * given cause Throwable object.
121 * the string to use as the Reason string
123 * the string to use as the SQLState string
125 * the Throwable object for the underlying reason this
128 public SQLIntegrityConstraintViolationException(String reason,
129 String sqlState, Throwable cause) {
130 super(reason, sqlState, cause);
134 * Creates an SQLIntegrityConstraintViolationException object. The Reason
135 * string is set to the given reason string, the SQLState string is set to
136 * the given SQLState string , the Error Code is set to the given error code
137 * value, and the cause Throwable object is set to the given cause Throwable
141 * the string to use as the Reason string
143 * the string to use as the SQLState string
145 * the integer value for the error code
147 * the Throwable object for the underlying reason this
150 public SQLIntegrityConstraintViolationException(String reason,
151 String sqlState, int vendorCode, Throwable cause) {
152 super(reason, sqlState, vendorCode, cause);