summaryrefslogtreecommitdiff
path: root/mysqlc/source/mysqlc_driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'mysqlc/source/mysqlc_driver.cxx')
-rw-r--r--mysqlc/source/mysqlc_driver.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx
index abd29776ba03..f6181e70ff74 100644
--- a/mysqlc/source/mysqlc_driver.cxx
+++ b/mysqlc/source/mysqlc_driver.cxx
@@ -143,9 +143,30 @@ void MysqlCDriver::impl_initCppConn_lck_throw()
#ifdef SYSTEM_MYSQL_CPPCONN
cppDriver = get_driver_instance();
#else
+#ifdef BUNDLE_MARIADB
+ if ( !m_bAttemptedLoadCConn )
+ {
+ const OUString sModuleName(BUNDLE_MARIADB);
+ m_hCConnModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 );
+ m_bAttemptedLoadCConn = true;
+ }
+
+ // attempted to load - was it successful?
+ if ( !m_hCConnModule )
+ {
+ OSL_FAIL( "MysqlCDriver::impl_initCppConn_lck_throw: could not load the " BUNDLE_MARIADB " library!");
+ throw SQLException(
+ OUString( "Unable to load the " BUNDLE_MARIADB " library." ),
+ *this,
+ OUString( "08001" ), // "unable to connect"
+ 0,
+ Any()
+ );
+ }
+#endif
if ( !m_bAttemptedLoadCppConn )
{
- const OUString sModuleName(CPPCONN_LIB );
+ const OUString sModuleName(CPPCONN_LIB);
m_hCppConnModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 );
m_bAttemptedLoadCppConn = true;
}