24 */
25
26 package java.sql;
27
28 /**
29 * <P>An exception that provides information on database access
30 * warnings. Warnings are silently chained to the object whose method
31 * caused it to be reported.
32 * <P>
33 * Warnings may be retrieved from <code>Connection</code>, <code>Statement</code>,
34 * and <code>ResultSet</code> objects. Trying to retrieve a warning on a
35 * connection after it has been closed will cause an exception to be thrown.
36 * Similarly, trying to retrieve a warning on a statement after it has been
37 * closed or on a result set after it has been closed will cause
38 * an exception to be thrown. Note that closing a statement also
39 * closes a result set that it might have produced.
40 *
41 * @see Connection#getWarnings
42 * @see Statement#getWarnings
43 * @see ResultSet#getWarnings
44 */
45 public class SQLWarning extends SQLException {
46
47 /**
48 * Constructs a <code>SQLWarning</code> object
49 * with a given <code>reason</code>, <code>SQLState</code> and
50 * <code>vendorCode</code>.
51 *
52 * The <code>cause</code> is not initialized, and may subsequently be
53 * initialized by a call to the
54 * {@link Throwable#initCause(java.lang.Throwable)} method.
55 *
56 * @param reason a description of the warning
57 * @param SQLState an XOPEN or SQL:2003 code identifying the warning
58 * @param vendorCode a database vendor-specific warning code
59 */
60 public SQLWarning(String reason, String SQLState, int vendorCode) {
61 super(reason, SQLState, vendorCode);
62 DriverManager.println("SQLWarning: reason(" + reason +
63 ") SQLState(" + SQLState +
|
24 */
25
26 package java.sql;
27
28 /**
29 * <P>An exception that provides information on database access
30 * warnings. Warnings are silently chained to the object whose method
31 * caused it to be reported.
32 * <P>
33 * Warnings may be retrieved from <code>Connection</code>, <code>Statement</code>,
34 * and <code>ResultSet</code> objects. Trying to retrieve a warning on a
35 * connection after it has been closed will cause an exception to be thrown.
36 * Similarly, trying to retrieve a warning on a statement after it has been
37 * closed or on a result set after it has been closed will cause
38 * an exception to be thrown. Note that closing a statement also
39 * closes a result set that it might have produced.
40 *
41 * @see Connection#getWarnings
42 * @see Statement#getWarnings
43 * @see ResultSet#getWarnings
44 * @since 1.1
45 */
46 public class SQLWarning extends SQLException {
47
48 /**
49 * Constructs a <code>SQLWarning</code> object
50 * with a given <code>reason</code>, <code>SQLState</code> and
51 * <code>vendorCode</code>.
52 *
53 * The <code>cause</code> is not initialized, and may subsequently be
54 * initialized by a call to the
55 * {@link Throwable#initCause(java.lang.Throwable)} method.
56 *
57 * @param reason a description of the warning
58 * @param SQLState an XOPEN or SQL:2003 code identifying the warning
59 * @param vendorCode a database vendor-specific warning code
60 */
61 public SQLWarning(String reason, String SQLState, int vendorCode) {
62 super(reason, SQLState, vendorCode);
63 DriverManager.println("SQLWarning: reason(" + reason +
64 ") SQLState(" + SQLState +
|