1 21 22 package org.apache.derby.jdbc; 23 24 import java.sql.SQLException ; 25 import javax.sql.DataSource ; 26 import org.apache.derby.client.am.ClientMessageId; 27 import org.apache.derby.client.am.SqlException; 28 import org.apache.derby.shared.common.reference.SQLState; 29 30 45 public class ClientConnectionPoolDataSource40 46 extends ClientConnectionPoolDataSource { 47 58 public boolean isWrapperFor(Class <?> interfaces) throws SQLException { 59 return interfaces.isInstance(this); 60 } 61 62 70 public <T> T unwrap(java.lang.Class <T> interfaces) 71 throws SQLException { 72 try { 73 return interfaces.cast(this); 74 } catch (ClassCastException cce) { 75 throw new SqlException(null,new ClientMessageId( 76 SQLState.UNABLE_TO_UNWRAP), interfaces).getSQLException(); 77 } 78 } 79 } 80 | Popular Tags |