diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-09-16 11:28:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-09-16 11:39:24 +0200 |
commit | 429042021590c80afb25ade833269635a24f2778 (patch) | |
tree | 60af1983b10974a9dd1d37fa3a54c91229e732f4 /connectivity | |
parent | a041f518afe083f997660eb8f809df7f20c30fed (diff) |
Make Java-based connectivity drivers work with jvmfwk "direct mode"
...so they work from CppunitTests (which make use of that "direct mode").
Change-Id: I92b72fb708ac1868644111b208f92ac58610ed11
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/hsqldb/HDriver.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JDriver.cxx | 15 |
2 files changed, 29 insertions, 2 deletions
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 5f053f353430..f916658c4a29 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -400,7 +400,21 @@ namespace connectivity sal_Bool SAL_CALL ODriverDelegator::acceptsURL( const OUString& url ) throw (SQLException, RuntimeException) { sal_Bool bEnabled = sal_False; - OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" ); + javaFrameworkError e = jfw_getEnabled(&bEnabled); + switch (e) { + case JFW_E_NONE: + break; + case JFW_E_DIRECT_MODE: + SAL_INFO( + "connectivity.hsqldb", + "jfw_getEnabled: JFW_E_DIRECT_MODE, assuming true"); + bEnabled = true; + break; + default: + SAL_WARN( + "connectivity.hsqldb", "jfw_getEnabled: error code " << +e); + break; + } return bEnabled && url.equals("sdbc:embedded:hsqldb"); } diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx index d0759c10ef68..05424aed51df 100644 --- a/connectivity/source/drivers/jdbc/JDriver.cxx +++ b/connectivity/source/drivers/jdbc/JDriver.cxx @@ -117,7 +117,20 @@ sal_Bool SAL_CALL java_sql_Driver::acceptsURL( const OUString& url ) throw(SQLEx // don't ask the real driver for the url // I feel responsible for all jdbc url's sal_Bool bEnabled = sal_False; - OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" ); + javaFrameworkError e = jfw_getEnabled(&bEnabled); + switch (e) { + case JFW_E_NONE: + break; + case JFW_E_DIRECT_MODE: + SAL_INFO( + "connectivity.jdbc", + "jfw_getEnabled: JFW_E_DIRECT_MODE, assuming true"); + bEnabled = true; + break; + default: + SAL_WARN("connectivity.jdbc", "jfw_getEnabled: error code " << +e); + break; + } return bEnabled && url.startsWith("jdbc:"); } // ------------------------------------------------------------------------- |