OSDN Git Service

Start of AWT merge with Classpath:
[pf3gnuchains/gcc-fork.git] / libjava / java / sql / SQLWarning.java
1 /* SQLWarning.java -- Database access warnings.
2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.sql;
29
30 /**
31   * This exception is thrown when a database warning occurs.
32   *
33   * @author Aaron M. Renn (arenn@urbanophile.com)
34   */
35 public class SQLWarning extends SQLException
36 {
37
38 /*************************************************************************/
39
40 /**
41   * Static Variables
42   */
43
44 /**
45   * This is the serialization UID for this class
46   */
47 private static final long serialVersionUID = 3917336774604784856L;
48
49 /*************************************************************************/
50
51 /*
52  * Constructors
53  */
54
55 /**
56   * This method initializes a new instance of <code>SQLWarning</code>
57   * that does not have a descriptive messages and SQL state, and which
58   * has a vendor error code of 0.
59   */
60 public 
61 SQLWarning()
62 {
63   this(null, null, 0);
64 }
65
66 /*************************************************************************/
67
68 /**
69   * This method initializes a new instance of <code>SQLWarning</code>
70   * with the specified descriptive error message.  The SQL state of this
71   * instance will be <code>null</code> and the vendor error code will be 0.
72   *
73   * @param message A string describing the nature of the error.
74   */
75 public 
76 SQLWarning(String message)
77 {
78   this(message, null, 0);
79 }
80
81 /*************************************************************************/
82
83 /**
84   * This method initializes a new instance of <code>SQLWarning</code>
85   * with the specified descriptive error message and SQL state string.
86   * The vendor error code of this instance will be 0.
87   *
88   * @param message A string describing the nature of the error.
89   * @param SQLState A string containing the SQL state of the error.
90   */
91 public
92 SQLWarning(String message, String SQLState)
93 {
94   this(message, SQLState, 0);
95 }
96
97 /*************************************************************************/
98
99 /**
100   * This method initializes a nwe instance of <code>SQLWarning</code>
101   * with the specified descriptive error message, SQL state string, and
102   * vendor code.
103   *
104   * @param message A string describing the nature of the error.
105   * @param SQLState A string containing the SQL state of the error.
106   * @param vendorCode The vendor error code associated with this error.
107   */
108 public
109 SQLWarning(String message, String SQLState, int vendorCode)
110 {
111   super(message, SQLState, vendorCode);
112 }
113
114 /*************************************************************************/
115
116 /*
117  * Instance Methods
118  */
119
120 /**
121   * This method returns the exception that is chained to this object.
122   *
123   * @return The exception chained to this object, which may be 
124   * <code>null</code>.
125   */
126 public SQLWarning
127 getNextWarning()
128 {
129   return((SQLWarning)super.getNextException());
130 }
131
132 /*************************************************************************/
133
134 /**
135   * This method adds a new exception to the end of the chain of exceptions
136   * that are chained to this object.
137   *
138   * @param e The exception to add to the end of the chain.
139   */
140 public void
141 setNextWarning(SQLWarning e)
142 {
143   super.setNextException(e);
144 }
145
146 } // class SQLWarning
147