1 21 22 package org.apache.derby.jdbc; 23 24 import org.apache.derby.iapi.jdbc.ResourceAdapter; 25 26 import java.sql.SQLException ; 27 import javax.sql.DataSource ; 28 import javax.sql.XAConnection ; 29 import javax.sql.XADataSource ; 30 31 import org.apache.derby.impl.jdbc.Util; 32 import org.apache.derby.iapi.reference.SQLState; 33 34 60 public class EmbeddedXADataSource40 extends EmbeddedXADataSource { 61 62 public EmbeddedXADataSource40() { 63 super(); 64 } 65 66 77 public boolean isWrapperFor(Class <?> interfaces) throws SQLException { 78 return interfaces.isInstance(this); 79 } 80 81 89 public <T> T unwrap(java.lang.Class <T> interfaces) 90 throws SQLException { 91 try { 96 return interfaces.cast(this); 97 } catch (ClassCastException cce) { 98 throw Util.generateCsSQLException(SQLState.UNABLE_TO_UNWRAP, 99 interfaces); 100 } 101 } 102 103 109 protected XAConnection createXAConnection (ResourceAdapter ra, 110 String user, String password, 111 boolean requestPassword) throws SQLException { 112 return new EmbedXAConnection40 (this, ra, user, 113 password, requestPassword); 114 } 115 } 116 | Popular Tags |