1 21 22 package org.apache.derby.jdbc; 23 24 import java.sql.SQLException ; 25 import javax.sql.DataSource ; 26 import javax.sql.XAConnection ; 27 import javax.sql.XADataSource ; 28 29 import org.apache.derby.client.ClientXAConnection; 30 import org.apache.derby.client.net.NetLogWriter; 31 import org.apache.derby.client.am.SqlException; 32 33 34 53 public class ClientXADataSource extends ClientDataSource implements XADataSource { 54 public static final String className__ = "org.apache.derby.jdbc.ClientXADataSource"; 55 56 private static final long serialVersionUID = 7057075094707674880L; 59 60 public ClientXADataSource() { 61 } 62 63 public XAConnection getXAConnection() throws SQLException { 64 return getXAConnection(getUser(), getPassword()); 65 } 66 67 public XAConnection getXAConnection(String user, String password) throws SQLException { 68 try 69 { 70 NetLogWriter dncLogWriter = (NetLogWriter) super.computeDncLogWriterForNewConnection("_xads"); 71 return new ClientXAConnection(this, dncLogWriter, user, password); 72 } 73 catch ( SqlException se ) 74 { 75 throw se.getSQLException(); 76 } 77 } 78 } 79 | Popular Tags |