File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\jdbc\JdbcBatchUpdateException.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.jdbc;
8
9 import java.io.PrintStream;
10 import java.io.PrintWriter;
11 import java.sql.BatchUpdateException;
12 import java.sql.SQLException;
13
14 /**
15 * Represents a batch update database exception.
16 */
17 public class JdbcBatchUpdateException extends BatchUpdateException {
18
19 private static final long serialVersionUID = 1L;
20
21 /**
22 * INTERNAL
23 */
24 JdbcBatchUpdateException(SQLException next, int[] updateCounts) {
25 super(next.getMessage(), next.getSQLState(), next.getErrorCode(), updateCounts);
26 setNextException(next);
27 }
28
29 /**
30 * INTERNAL
31 */
32 public void printStackTrace() {
33 // The default implementation already does that,
34 // but we do it again to avoid problems.
35 // If it is not implemented, somebody might implement it
36 // later on which would be a problem if done in the wrong way.
37 printStackTrace(System.err);
38 }
39
40 /**
41 * INTERNAL
42 */
43 public void printStackTrace(PrintWriter s) {
44 if (s != null) {
45 super.printStackTrace(s);
46 if (getNextException() != null) {
47 getNextException().printStackTrace(s);
48 }
49 }
50 }
51
52 /**
53 * INTERNAL
54 */
55 public void printStackTrace(PrintStream s) {
56 if (s != null) {
57 super.printStackTrace(s);
58 if (getNextException() != null) {
59 getNextException().printStackTrace(s);
60 }
61 }
62 }
63
64 }
65