1 21 package org.apache.derby.jdbc; 22 23 import java.sql.SQLException ; 24 import javax.sql.ConnectionPoolDataSource ; 25 import javax.sql.DataSource ; 26 import javax.sql.PooledConnection ; 27 28 import org.apache.derby.impl.jdbc.Util; 29 import org.apache.derby.iapi.reference.SQLState; 30 31 54 public class EmbeddedConnectionPoolDataSource40 55 extends EmbeddedConnectionPoolDataSource 56 implements ConnectionPoolDataSource { 57 58 69 public boolean isWrapperFor(Class <?> interfaces) throws SQLException { 70 return interfaces.isInstance(this); 71 } 72 73 81 public <T> T unwrap(java.lang.Class <T> interfaces) 82 throws SQLException { 83 try { 88 return interfaces.cast(this); 89 } catch (ClassCastException cce) { 90 throw Util.generateCsSQLException(SQLState.UNABLE_TO_UNWRAP, 91 interfaces); 92 } 93 } 94 95 98 protected PooledConnection createPooledConnection (String user, 99 String password, boolean requestPassword) throws SQLException { 100 return new EmbedPooledConnection40(this, user, password, 101 requestPassword); 102 } 103 104 } 105 | Popular Tags |