jdk/src/share/classes/javax/sql/StatementEvent.java
changeset 24197 a5c2cff81e25
parent 23010 6dadb192ad81
equal deleted inserted replaced
24196:61c9885d76e2 24197:a5c2cff81e25
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    35 /**
    35 /**
    36  * A <code>StatementEvent</code> is sent to all <code>StatementEventListener</code>s which were
    36  * A <code>StatementEvent</code> is sent to all <code>StatementEventListener</code>s which were
    37  * registered with a <code>PooledConnection</code>. This occurs when the driver determines that a
    37  * registered with a <code>PooledConnection</code>. This occurs when the driver determines that a
    38  * <code>PreparedStatement</code> that is associated with the <code>PooledConnection</code> has been closed or the driver determines
    38  * <code>PreparedStatement</code> that is associated with the <code>PooledConnection</code> has been closed or the driver determines
    39  * is invalid.
    39  * is invalid.
    40  * <p>
    40  *
    41  * @since 1.6
    41  * @since 1.6
    42  */
    42  */
    43 public class StatementEvent extends EventObject {
    43 public class StatementEvent extends EventObject {
    44 
    44 
    45         static final long serialVersionUID = -8089573731826608315L;
    45         static final long serialVersionUID = -8089573731826608315L;
    48 
    48 
    49         /**
    49         /**
    50          * Constructs a <code>StatementEvent</code> with the specified <code>PooledConnection</code> and
    50          * Constructs a <code>StatementEvent</code> with the specified <code>PooledConnection</code> and
    51          * <code>PreparedStatement</code>.  The <code>SQLException</code> contained in the event defaults to
    51          * <code>PreparedStatement</code>.  The <code>SQLException</code> contained in the event defaults to
    52          * null.
    52          * null.
    53          * <p>
    53          *
    54          * @param con                   The <code>PooledConnection</code> that the closed or invalid
    54          * @param con                   The <code>PooledConnection</code> that the closed or invalid
    55          * <code>PreparedStatement</code>is associated with.
    55          * <code>PreparedStatement</code>is associated with.
    56          * @param statement             The <code>PreparedStatement</code> that is being closed or is invalid
    56          * @param statement             The <code>PreparedStatement</code> that is being closed or is invalid
    57          * <p>
    57          *
    58          * @throws IllegalArgumentException if <code>con</code> is null.
    58          * @throws IllegalArgumentException if <code>con</code> is null.
    59          *
    59          *
    60          * @since 1.6
    60          * @since 1.6
    61          */
    61          */
    62         public StatementEvent(PooledConnection con,
    62         public StatementEvent(PooledConnection con,
    69         }
    69         }
    70 
    70 
    71         /**
    71         /**
    72          * Constructs a <code>StatementEvent</code> with the specified <code>PooledConnection</code>,
    72          * Constructs a <code>StatementEvent</code> with the specified <code>PooledConnection</code>,
    73          * <code>PreparedStatement</code> and <code>SQLException</code>
    73          * <code>PreparedStatement</code> and <code>SQLException</code>
    74          * <p>
    74          *
    75          * @param con                   The <code>PooledConnection</code> that the closed or invalid <code>PreparedStatement</code>
    75          * @param con                   The <code>PooledConnection</code> that the closed or invalid <code>PreparedStatement</code>
    76          * is associated with.
    76          * is associated with.
    77          * @param statement             The <code>PreparedStatement</code> that is being closed or is invalid
    77          * @param statement             The <code>PreparedStatement</code> that is being closed or is invalid
    78          * @param exception             The <code>SQLException </code>the driver is about to throw to
    78          * @param exception             The <code>SQLException </code>the driver is about to throw to
    79          *                                              the application
    79          *                                              the application
    80          *
    80          *
    81          * @throws IllegalArgumentException if <code>con</code> is null.
    81          * @throws IllegalArgumentException if <code>con</code> is null.
    82          * <p>
    82          *
    83          * @since 1.6
    83          * @since 1.6
    84          */
    84          */
    85         public StatementEvent(PooledConnection con,
    85         public StatementEvent(PooledConnection con,
    86                                                   PreparedStatement statement,
    86                                                   PreparedStatement statement,
    87                                                   SQLException exception) {
    87                                                   SQLException exception) {
    92                 this.exception = exception;
    92                 this.exception = exception;
    93         }
    93         }
    94 
    94 
    95         /**
    95         /**
    96          * Returns the <code>PreparedStatement</code> that is being closed or is invalid
    96          * Returns the <code>PreparedStatement</code> that is being closed or is invalid
    97          * <p>
    97          *
    98          * @return      The <code>PreparedStatement</code> that is being closed or is invalid
    98          * @return      The <code>PreparedStatement</code> that is being closed or is invalid
    99          * <p>
    99          *
   100          * @since 1.6
   100          * @since 1.6
   101          */
   101          */
   102         public PreparedStatement getStatement() {
   102         public PreparedStatement getStatement() {
   103 
   103 
   104                 return this.statement;
   104                 return this.statement;
   105         }
   105         }
   106 
   106 
   107         /**
   107         /**
   108          * Returns the <code>SQLException</code> the driver is about to throw
   108          * Returns the <code>SQLException</code> the driver is about to throw
   109          * <p>
   109          *
   110          * @return      The <code>SQLException</code> the driver is about to throw
   110          * @return      The <code>SQLException</code> the driver is about to throw
   111          * <p>
   111          *
   112          * @since 1.6
   112          * @since 1.6
   113          */
   113          */
   114         public SQLException getSQLException() {
   114         public SQLException getSQLException() {
   115 
   115 
   116                 return this.exception;
   116                 return this.exception;