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 103 public class ClientDataSource40 extends ClientDataSource { 104 105 public ClientDataSource40() { 106 super(); 107 } 108 109 120 public boolean isWrapperFor(Class <?> interfaces) throws SQLException { 121 return interfaces.isInstance(this); 122 } 123 124 132 public <T> T unwrap(java.lang.Class <T> interfaces) 133 throws SQLException { 134 try { 135 return interfaces.cast(this); 136 } catch (ClassCastException cce) { 137 throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP), 138 interfaces).getSQLException(); 139 } 140 } 141 142 } 143 | Popular Tags |