KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > db > pool > ConnectionPool


1 package jodd.db.pool;
2
3 import java.sql.Connection;
4 import java.sql.SQLException;
5
6 /**
7  * A database connection pool interface.
8  */

9 public interface ConnectionPool {
10
11     /**
12      * Initialize pool with current object state.
13      *
14      * @exception SQLException
15      */

16     public void init() throws SQLException;
17     
18
19     /**
20      * Get one free connection from the connection pool.
21      *
22      * @return Connection object representing free database connection
23      * @exception SQLException
24      */

25     public Connection getConnection() throws SQLException;
26
27     /**
28      * Returns connection to connection pool.
29      *
30      * @param conn database connection
31      */

32     public void freeConnection(Connection conn);
33
34
35     /**
36      * Close pool when it is not needed anymore.
37      */

38     public void close();
39
40 }
41
42
Popular Tags