1 /* |
1 /* |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 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 |
81 * the pool manager is notified because it has registered itself as |
81 * the pool manager is notified because it has registered itself as |
82 * a <code>StatementEventListener</code> object using the |
82 * a <code>StatementEventListener</code> object using the |
83 * <code>ConnectionPool</code> method <code>addStatementEventListener</code>. |
83 * <code>ConnectionPool</code> method <code>addStatementEventListener</code>. |
84 * Thus, when an application closes its <code>PreparedStatement</code>, |
84 * Thus, when an application closes its <code>PreparedStatement</code>, |
85 * the underlying prepared statement is recycled rather than being closed. |
85 * the underlying prepared statement is recycled rather than being closed. |
86 * <P> |
|
87 * |
86 * |
88 * @since 1.4 |
87 * @since 1.4 |
89 */ |
88 */ |
90 |
89 |
91 public interface PooledConnection { |
90 public interface PooledConnection { |
152 /** |
151 /** |
153 * Registers a <code>StatementEventListener</code> with this <code>PooledConnection</code> object. Components that |
152 * Registers a <code>StatementEventListener</code> with this <code>PooledConnection</code> object. Components that |
154 * wish to be notified when <code>PreparedStatement</code>s created by the |
153 * wish to be notified when <code>PreparedStatement</code>s created by the |
155 * connection are closed or are detected to be invalid may use this method |
154 * connection are closed or are detected to be invalid may use this method |
156 * to register a <code>StatementEventListener</code> with this <code>PooledConnection</code> object. |
155 * to register a <code>StatementEventListener</code> with this <code>PooledConnection</code> object. |
157 * <p> |
156 * |
158 * @param listener an component which implements the <code>StatementEventListener</code> |
157 * @param listener an component which implements the <code>StatementEventListener</code> |
159 * interface that is to be registered with this <code>PooledConnection</code> object |
158 * interface that is to be registered with this <code>PooledConnection</code> object |
160 * <p> |
159 * |
161 * @since 1.6 |
160 * @since 1.6 |
162 */ |
161 */ |
163 public void addStatementEventListener(StatementEventListener listener); |
162 public void addStatementEventListener(StatementEventListener listener); |
164 |
163 |
165 /** |
164 /** |
166 * Removes the specified <code>StatementEventListener</code> from the list of |
165 * Removes the specified <code>StatementEventListener</code> from the list of |
167 * components that will be notified when the driver detects that a |
166 * components that will be notified when the driver detects that a |
168 * <code>PreparedStatement</code> has been closed or is invalid. |
167 * <code>PreparedStatement</code> has been closed or is invalid. |
169 * <p> |
168 * |
170 * @param listener the component which implements the |
169 * @param listener the component which implements the |
171 * <code>StatementEventListener</code> interface that was previously |
170 * <code>StatementEventListener</code> interface that was previously |
172 * registered with this <code>PooledConnection</code> object |
171 * registered with this <code>PooledConnection</code> object |
173 * <p> |
172 * |
174 * @since 1.6 |
173 * @since 1.6 |
175 */ |
174 */ |
176 public void removeStatementEventListener(StatementEventListener listener); |
175 public void removeStatementEventListener(StatementEventListener listener); |
177 |
176 |
178 } |
177 } |