001package com.hfg.sql.jdbc.postgresql;
002
003import com.hfg.sql.jdbc.JDBCConnectionPool;
004import com.hfg.sql.jdbc.JDBCConnectionPoolSettings;
005import com.hfg.sql.jdbc.JDBCServer;
006import com.hfg.security.LoginCredentials;
007
008import java.sql.Connection;
009
010//------------------------------------------------------------------------------
011/**
012 A connection pool implementation for PostgreSQL databases.
013 <div>
014 @author J. Alex Taylor, hairyfatguy.com
015 </div>
016 */
017//------------------------------------------------------------------------------
018// com.hfg XML/HTML Coding Library
019//
020// This library is free software; you can redistribute it and/or
021// modify it under the terms of the GNU Lesser General Public
022// License as published by the Free Software Foundation; either
023// version 2.1 of the License, or (at your option) any later version.
024//
025// This library is distributed in the hope that it will be useful,
026// but WITHOUT ANY WARRANTY; without even the implied warranty of
027// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
028// Lesser General Public License for more details.
029//
030// You should have received a copy of the GNU Lesser General Public
031// License along with this library; if not, write to the Free Software
032// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
033//
034// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
035// jataylor@hairyfatguy.com
036//------------------------------------------------------------------------------
037
038public class PostgreSQLConnectionPool extends JDBCConnectionPool<JDBCConnectionPoolSettings>
039{
040
041   //###########################################################################
042   // CONSTRUCTORS
043   //###########################################################################
044
045   //---------------------------------------------------------------------------
046   public PostgreSQLConnectionPool(JDBCServer inServer, String inDatabaseName)
047   {
048      super(inServer, inDatabaseName);
049   }
050
051   //---------------------------------------------------------------------------
052   public PostgreSQLConnectionPool(JDBCServer inServer, String inDatabaseName, LoginCredentials inCredentials)
053   {
054      super(inServer, inDatabaseName, inCredentials);
055   }
056
057
058   //###########################################################################
059   // PUBLIC METHODS
060   //###########################################################################
061
062   //---------------------------------------------------------------------------
063   @Override
064   protected PostgreSQLConnection createConnection()
065   {
066      Connection conn = getServer().getConnection(getDatabaseName(), getCredentials(), getSettings());
067
068      return (conn != null ? new PostgreSQLConnection(conn) : null);
069   }
070}