01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.jdbc;
07:
08: import java.io.PrintStream;
09: import java.io.PrintWriter;
10: import java.sql.BatchUpdateException;
11: import java.sql.SQLException;
12:
13: /**
14: * Represents a batch update database exception.
15: */
16: public class JdbcBatchUpdateException extends BatchUpdateException {
17:
18: private static final long serialVersionUID = 9006432914018679675L;
19:
20: /**
21: * INTERNAL
22: */
23: public JdbcBatchUpdateException(SQLException next,
24: int[] updateCounts) {
25: super (next.getMessage(), next.getSQLState(), next
26: .getErrorCode(), updateCounts);
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: }
|