01: /*
02: * This file is part of the QuickServer library
03: * Copyright (C) 2003-2005 QuickServer.org
04: *
05: * Use, modification, copying and distribution of this software is subject to
06: * the terms and conditions of the GNU Lesser General Public License.
07: * You should have received a copy of the GNU LGP License along with this
08: * library; if not, you can download a copy from <http://www.quickserver.org/>.
09: *
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;
19: import java.util.*;
20:
21: /**
22: * This interface is used by {@link org.quickserver.net.server.QuickServer}
23: * load all db drivers.
24: * It is also used to get {@link java.sql.Connection} object by
25: * the QuickServer when it encounters <db-object-pool>...</db-object-pool>
26: * in its configuration file.
27: * @author Akshathkumar Shetty
28: * @since 1.3
29: */
30: public interface DBPoolUtil {
31: /**
32: * QuickServer passes the an <code>iterator</code> containing
33: * {@link org.quickserver.util.xmlreader.DatabaseConnectionConfig}
34: * objects if any from the xml configuration it reads.
35: */
36: public void setDatabaseConnections(Iterator iterator)
37: throws Exception;
38:
39: /**
40: * This method will initilise and load all the db connection pools
41: * that was set using {@link #setDatabaseConnections}
42: */
43: public boolean initPool();
44:
45: /**
46: * This method will close all db connection pools
47: * that was set using {@link #setDatabaseConnections}
48: */
49: public boolean clean();
50:
51: /**
52: * Returns the {@link java.sql.Connection} object for the
53: * DatabaseConnection that is identified by id passed. If id passed
54: * does not match with any connection loaded by this class it will
55: * return <code>null</code>.
56: */
57: public Connection getConnection(String id) throws Exception;
58: }
|