01: package org.smartlib.pool.test;
02:
03: import java.sql.*;
04: import org.smartlib.pool.core.*;
05: import javax.naming.*;
06: import javax.sql.*;
07:
08: /**
09: * Never got a chance to compile this program
10: */
11:
12: public class SampleConnectionProviderImpl implements ConnectionProvider {
13:
14: private DataSource dataSource = null;
15:
16: public SampleConnectionProviderImpl() throws Exception {
17:
18: InitialContext ic = new InitialContext();
19: dataSource = (DataSource) ic.lookup("MyPool");
20:
21: }
22:
23: public Connection getConnection() throws Exception {
24:
25: return dataSource.getConnection();
26:
27: }
28:
29: public void returnConnection(Connection conn) throws Exception {
30:
31: conn.close();
32:
33: }
34:
35: }
|