1 19 package com.mysql.jdbc.jdbc2.optional; 20 21 import java.sql.Connection ; 22 import java.sql.SQLException ; 23 24 import javax.sql.ConnectionPoolDataSource ; 25 import javax.sql.PooledConnection ; 26 27 28 39 public class MysqlConnectionPoolDataSource 40 extends MysqlDataSource 41 implements ConnectionPoolDataSource { 42 43 45 51 public synchronized PooledConnection getPooledConnection() 52 throws SQLException { 53 54 Connection connection = getConnection(); 55 MysqlPooledConnection mysqlPooledConnection = new MysqlPooledConnection( 56 connection); 57 58 return mysqlPooledConnection; 59 } 60 61 70 public synchronized PooledConnection getPooledConnection(String s, 71 String s1) 72 throws SQLException { 73 74 Connection connection = getConnection(s, s1); 75 MysqlPooledConnection mysqlPooledConnection = new MysqlPooledConnection( 76 connection); 77 78 return mysqlPooledConnection; 79 } 80 } | Popular Tags |