KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Derby - Class org.apache.derby.client.am.BatchUpdateException
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 import org.apache.derby.iapi.services.info.JVMInfo;
25 import org.apache.derby.shared.common.i18n.MessageUtil;
26 import org.apache.derby.shared.common.error.ExceptionUtil;
27
28 public class BatchUpdateException extends java.sql.BatchUpdateException JavaDoc {
29
30     /**
31      * The message utility instance we use to find messages
32      * It's primed with the name of the client message bundle so that
33      * it knows to look there if the message isn't found in the
34      * shared message bundle.
35      */

36     private static MessageUtil msgutil_ =
37         SqlException.getMessageUtil();
38
39     public BatchUpdateException(LogWriter logWriter, ClientMessageId msgid,
40         Object JavaDoc[] args, int[] updateCounts)
41     {
42         super(
43             msgutil_.getCompleteMessage(
44                 msgid.msgid,
45                 args),
46             ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid),
47             ExceptionUtil.getSeverityFromIdentifier(msgid.msgid),
48             updateCounts);
49
50         if (logWriter != null) {
51             logWriter.traceDiagnosable(this);
52         }
53     }
54     
55     // Syntactic sugar constructors to make it easier to create
56
// a BatchUpdateException with substitution parameters
57
public BatchUpdateException(LogWriter logWriter, ClientMessageId msgid,
58         int[] updateCounts)
59     {
60         this(logWriter, msgid, (Object JavaDoc [])null, updateCounts);
61     }
62     
63     public BatchUpdateException(LogWriter logWriter, ClientMessageId msgid,
64         Object JavaDoc arg1, int[] updateCounts)
65     {
66         this(logWriter, msgid, new Object JavaDoc[] {arg1}, updateCounts);
67     }
68     
69     //-----------------old constructors - to be removed when i18n is complete
70
//-----------------------------------------------
71

72     // Temporary constructor until all error keys are defined.
73
public BatchUpdateException(LogWriter logWriter) {
74         this(logWriter, null, null, SqlException.DEFAULT_ERRCODE, null);
75     }
76
77     // Temporary constructor until all error keys are defined.
78
public BatchUpdateException(LogWriter logWriter, int[] updateCounts) {
79         this(logWriter, null, null, SqlException.DEFAULT_ERRCODE, updateCounts);
80     }
81
82     // Temporary constructor until all error keys are defined.
83
public BatchUpdateException(LogWriter logWriter, String JavaDoc reason, int[] updateCounts) {
84         this(logWriter, reason, null, SqlException.DEFAULT_ERRCODE, updateCounts);
85     }
86
87     // Temporary constructor until all error keys are defined.
88
public BatchUpdateException(LogWriter logWriter, String JavaDoc reason, String JavaDoc sqlState, int[] updateCounts) {
89         this(logWriter, reason, sqlState, SqlException.DEFAULT_ERRCODE, updateCounts);
90     }
91
92     // Temporary constructor until all error keys are defined.
93
public BatchUpdateException(LogWriter logWriter, String JavaDoc reason, String JavaDoc sqlState, int errorCode, int[] updateCounts) {
94         super(reason, sqlState, errorCode, updateCounts);
95         if (logWriter != null) {
96             logWriter.traceDiagnosable(this);
97         }
98     }
99 }
100
101
Popular Tags