1 21 22 package org.apache.derby.jdbc; 23 24 import java.sql.SQLException ; 25 26 27 import javax.sql.ConnectionPoolDataSource ; 28 import javax.sql.PooledConnection ; 29 30 51 public class EmbeddedConnectionPoolDataSource extends EmbeddedDataSource 52 implements javax.sql.ConnectionPoolDataSource 53 { 54 55 private static final long serialVersionUID = 7852784308039674160L; 56 57 60 public EmbeddedConnectionPoolDataSource() { 61 super(); 62 } 63 64 67 68 75 public final PooledConnection getPooledConnection() throws SQLException { 76 return createPooledConnection (getUser(), getPassword(), false); 77 } 78 79 89 public final PooledConnection getPooledConnection(String username, 90 String password) 91 throws SQLException 92 { 93 return createPooledConnection (username, password, true); 94 } 95 96 99 protected PooledConnection createPooledConnection (String user, 100 String password, boolean requestPassword) throws SQLException { 101 return new EmbedPooledConnection(this, user, password, requestPassword); 102 } 103 } 104 105 106 107 108 109 | Popular Tags |