diff options
author | Andres Gomez <agomez@igalia.com> | 2013-06-04 13:52:11 +0300 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-12 16:34:22 +0100 |
commit | 94029968e7168326368d7e9fab1298157b04884b (patch) | |
tree | a9aae618d00173d9a4863b1cf51fbfc4ec13783c | |
parent | bc24d89595da654ffae715b143e30dd207eec533 (diff) |
fb-sdbc: added extra checks in FDriver
-rw-r--r-- | connectivity/source/drivers/firebird/FDriver.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/FDriver.cxx b/connectivity/source/drivers/firebird/FDriver.cxx index 6aa28955a642..e55a1bcfda5f 100644 --- a/connectivity/source/drivers/firebird/FDriver.cxx +++ b/connectivity/source/drivers/firebird/FDriver.cxx @@ -35,6 +35,9 @@ #include "FDriver.hxx" #include "FConnection.hxx" +#include "connectivity/dbexception.hxx" +#include "resource/common_res.hrc" +#include "resource/sharedresources.hxx" using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -123,6 +126,13 @@ Reference< XConnection > SAL_CALL FirebirdDriver::connect( const ::rtl::OUString { SAL_INFO("connectivity.firebird", "=> ODriver_BASE::connect(), URL: " << url ); + ::osl::MutexGuard aGuard( m_aMutex ); + if (ODriver_BASE::rBHelper.bDisposed) + throw DisposedException(); + + if ( ! acceptsURL(url) ) + return NULL; + // create a new connection with the given properties and append it to our vector OConnection* pCon = new OConnection(this); Reference< XConnection > xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0) @@ -142,6 +152,13 @@ sal_Bool SAL_CALL FirebirdDriver::acceptsURL( const ::rtl::OUString& url ) // -------------------------------------------------------------------------------- Sequence< DriverPropertyInfo > SAL_CALL FirebirdDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException) { + if ( ! acceptsURL(url) ) + { + ::connectivity::SharedResources aResources; + const OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR); + ::dbtools::throwGenericSQLException(sMessage ,*this); + } // if ( ! acceptsURL(url) ) + // if you have somthing special to say, return it here :-) return Sequence< DriverPropertyInfo >(); } |