KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > sql > DBPoolUtil


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.sql;
16
17 import org.quickserver.util.xmlreader.*;
18 import java.sql.Connection JavaDoc;
19 import java.util.*;
20 /**
21  * This interface is used by {@link org.quickserver.net.server.QuickServer}
22  * load all db drivers.
23  * It is also used to get {@link java.sql.Connection} object by
24  * the QuickServer when it encounters &lt;db-object-pool&gt;...&lt;/db-object-pool&gt;
25  * in its configuration file.
26  * @author Akshathkumar Shetty
27  * @since 1.3
28  */

29 public interface DBPoolUtil {
30     /**
31      * QuickServer passes the an <code>iterator</code> containing
32      * {@link org.quickserver.util.xmlreader.DatabaseConnectionConfig}
33      * objects if any from the xml configuration it reads.
34      */

35     public void setDatabaseConnections(Iterator iterator) throws Exception JavaDoc;
36
37     /**
38      * This method will initilise and load all the db connection pools
39      * that was set using {@link #setDatabaseConnections}
40      */

41     public boolean initPool();
42
43     /**
44      * This method will close all db connection pools
45      * that was set using {@link #setDatabaseConnections}
46      */

47     public boolean clean();
48
49     /**
50      * Returns the {@link java.sql.Connection} object for the
51      * DatabaseConnection that is identified by id passed. If id passed
52      * does not match with any connection loaded by this class it will
53      * return <code>null</code>.
54      */

55     public Connection JavaDoc getConnection(String JavaDoc id) throws Exception JavaDoc;
56 }
57
Popular Tags