2 * Copyright 2000-2018 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.v7.data.util.sqlcontainer.connection;
18 import java.io.Serializable;
19 import java.sql.Connection;
20 import java.sql.SQLException;
23 * Interface for implementing connection pools to be used with SQLContainer.
24 * @deprecated As of 8.0, no replacement available.
27 public interface JDBCConnectionPool extends Serializable {
29 * Retrieves a connection.
31 * @return a usable connection to the database
32 * @throws SQLException
34 public Connection reserveConnection() throws SQLException;
37 * Releases a connection that was retrieved earlier.
39 * Note that depending on implementation, the transaction possibly open in
40 * the connection may or may not be rolled back.
43 * Connection to be released
45 public void releaseConnection(Connection conn);
48 * Destroys the connection pool: close() is called an all the connections in
49 * the pool, whether available or reserved.
51 * This method was added to fix PostgreSQL -related issues with connections
52 * that were left hanging 'idle'.
54 public void destroy();