diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-08 11:02:32 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-08 11:02:32 +0100 |
commit | d3a4501c36c893751070c20e5a6462261269668b (patch) | |
tree | 89f0d8e3da89a4b5bcc8687c1dfa1f0664b37c85 /dbaccess/source/ui/dlg/DbAdminImpl.cxx | |
parent | 58519fbb7255ca48701d3850f4038ca549e29b27 (diff) |
dba33e: #i108128# check if default driver is available
Diffstat (limited to 'dbaccess/source/ui/dlg/DbAdminImpl.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index dd7e736240ec..fd62eba4ff5f 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -356,6 +356,11 @@ void ODbDataSourceAdministrationHelper::clearPassword() // ----------------------------------------------------------------------------- Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver() { + return getDriver(getConnectionURL()); +} +// ----------------------------------------------------------------------------- +Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::OUString& _sURL) +{ // get the global DriverManager Reference< XDriverAccess > xDriverManager; String sCurrentActionError = String(ModuleRes(STR_COULDNOTCREATE_DRIVERMANAGER)); @@ -376,11 +381,11 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver() throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); - Reference< XDriver > xDriver = xDriverManager->getDriverByURL(getConnectionURL()); + Reference< XDriver > xDriver = xDriverManager->getDriverByURL(_sURL); if (!xDriver.is()) { sCurrentActionError = String(ModuleRes(STR_NOREGISTEREDDRIVER)); - sCurrentActionError.SearchAndReplaceAscii("#connurl#", getConnectionURL()); + sCurrentActionError.SearchAndReplaceAscii("#connurl#", _sURL); // will be caught and translated into an SQLContext exception throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); } |