KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > server > sql > informix > InformixConnectionAllocator


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: InformixConnectionAllocator.java,v 1.1 2004/09/03 13:42:50 sinisa Exp $
22  */

23 package com.lutris.appserver.server.sql.informix;
24
25 import com.lutris.appserver.server.sql.DBConnection;
26 import com.lutris.appserver.server.sql.standard.StandardConnectionAllocator;
27 import com.lutris.util.Config;
28 import com.lutris.util.ConfigException;
29
30 /**
31  * An Informix database connection pool.
32  *
33  * @author Kyle Clark
34  * @since LBS1.8
35  * @version $Revision: 1.1 $
36  */

37 public class InformixConnectionAllocator extends StandardConnectionAllocator {
38
39     /**
40      * The logical database for this connection pool.
41      */

42     protected InformixLogicalDatabase logicalDatabase;
43
44     /**
45      * Creates an Informix database connetion pool.
46      *
47      * @param logicalDatabase the logical Informix database for which
48      * connections are pooled.
49      * @param connectionConfig configuration parameters for the
50      * database connections. There are no Informix specific configuration
51      * data.
52      * @exception ConfigException if bad configuration information is
53      * given in the config file.
54      */

55     protected InformixConnectionAllocator(InformixLogicalDatabase logicalDatabase,
56             Config connectionConfig)
57         throws ConfigException {
58         super(logicalDatabase, connectionConfig);
59         this.logicalDatabase = logicalDatabase;
60     }
61
62     /**
63      * Creates a new Informix connection to be added to the connection pool.
64      * @exception java.sql.SQLException If a SQL error occures.
65      * @see InformixDBConnection
66      */

67     protected DBConnection createConnection()
68         throws java.sql.SQLException JavaDoc {
69         return new InformixDBConnection(this, url, user, password,
70                 maxPreparedStatements, sqlLogging, generation);
71     }
72 }
73
Popular Tags