}
public void init(int branchId) throws XAException {
try {
// Initialize the Datasource
SQLServerDataSource sqlServerDataSource = new SQLServerDataSource();
// "jdbc:microsoft:sqlserver://bleujin:1433;DatabaseName=pubs;"
String jdbcUrl = ( (MSSQLDBManager) dbm).getJdbcURL().trim() + ";";
String serverInfo = StringUtils.substring(jdbcUrl, "jdbc:microsoft:sqlserver://".length());
String serverName = StringUtils.substringBefore(serverInfo, ":");
int portNum = Integer.parseInt(StringUtils.substringBetween(serverInfo, ":", ";"));
String dbName = StringUtils.substringBetween(serverInfo, ";DatabaseName=", ";");
sqlServerDataSource.setServerName(serverName);
sqlServerDataSource.setDatabaseName(dbName);
sqlServerDataSource.setPortNumber(portNum);
sqlServerDataSource.setUser( ( (MSSQLDBManager) dbm).getUserId());
sqlServerDataSource.setPassword( ( (MSSQLDBManager) dbm).getUserPwd());
sqlServerDataSource.setSelectMethod("cursor");
xaDataSource = sqlServerDataSource;
xaConnection = xaDataSource.getXAConnection();
xaResource = xaConnection.getXAResource();