|
Lines 624-638
Link Here
|
| 624 |
Properties props = keysElementsToProperties((Element) extNode); |
624 |
Properties props = keysElementsToProperties((Element) extNode); |
| 625 |
String driverName = props.getProperty(DRIVERNAMEATTR); |
625 |
String driverName = props.getProperty(DRIVERNAMEATTR); |
| 626 |
String driverTypeID = props.getProperty(DRIVERTYPEIDATTR); |
626 |
String driverTypeID = props.getProperty(DRIVERTYPEIDATTR); |
|
|
627 |
String driverID = ""; |
| 627 |
|
628 |
|
| 628 |
if (DriverManager.getInstance().getDriverInstanceByName(driverName) != null) { |
629 |
// Bug 240433 - brianf |
|
|
630 |
// Issue with importing 2 profiles with same driver ID but from different exports |
| 631 |
boolean existingDriverHasName = false; |
| 632 |
DriverInstance testDI = DriverManager.getInstance().getDriverInstanceByName(driverName); |
| 633 |
if (testDI != null) { |
| 629 |
// we found the driver, so we're ok to continue |
634 |
// we found the driver, so we're ok to continue |
|
|
635 |
if (testDI.getTemplate().getId().equalsIgnoreCase(driverTypeID)) { |
| 636 |
// the driver with the same name happens to have the same template ID, so we should be ok |
| 637 |
existingDriverHasName = true; |
| 638 |
} |
| 630 |
} |
639 |
} |
| 631 |
else { |
640 |
if (testDI == null || existingDriverHasName) { |
|
|
641 |
// if (testDI != null) { |
| 642 |
// we found the driver, so we're ok to continue |
| 643 |
// } |
| 644 |
// else { |
| 632 |
DriverInstance di = DriverManager.getInstance().createNewDriverInstance(driverTypeID, driverName, new String()); |
645 |
DriverInstance di = DriverManager.getInstance().createNewDriverInstance(driverTypeID, driverName, new String()); |
| 633 |
if (di != null) { |
646 |
if (di != null) { |
| 634 |
String driverID = di.getId(); |
647 |
driverID = di.getId(); |
| 635 |
cp.getBaseProperties().setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverID); |
648 |
|
|
|
649 |
Properties baseProps = cp.getBaseProperties(); |
| 650 |
baseProps.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverID); |
| 651 |
cp.setBaseProperties(baseProps); |
| 636 |
|
652 |
|
| 637 |
// This section is to fix BZ 213258 -- brianf |
653 |
// This section is to fix BZ 213258 -- brianf |
| 638 |
String jarList = |
654 |
String jarList = |