summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host/config_firebird.h.in2
-rw-r--r--configure.ac1
-rw-r--r--dbaccess/CppunitTest_dbaccess_RowSetClones.mk1
-rw-r--r--dbaccess/CppunitTest_dbaccess_hsqldb_test.mk1
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx21
5 files changed, 17 insertions, 9 deletions
diff --git a/config_host/config_firebird.h.in b/config_host/config_firebird.h.in
index c6aa43ac54f3..b56056cf6ae9 100644
--- a/config_host/config_firebird.h.in
+++ b/config_host/config_firebird.h.in
@@ -5,6 +5,8 @@ Settings for Firebird
#ifndef CONFIG_FIREBIRD_H
#define CONFIG_FIREBIRD_H
+#define ENABLE_FIREBIRD_SDBC 0
+
#define HAVE_FIREBIRD_30 0
#endif
diff --git a/configure.ac b/configure.ac
index cef6c2940019..f92435da0dfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8769,6 +8769,7 @@ int fb_api_is_30(void) { return 0; }
BUILD_TYPE="$BUILD_TYPE FIREBIRD"
ENABLE_FIREBIRD_SDBC="TRUE"
+ AC_DEFINE(ENABLE_FIREBIRD_SDBC)
fi
fi
AC_SUBST(ENABLE_FIREBIRD_SDBC)
diff --git a/dbaccess/CppunitTest_dbaccess_RowSetClones.mk b/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
index 98b23d539a95..27e47b40ce06 100644
--- a/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
+++ b/dbaccess/CppunitTest_dbaccess_RowSetClones.mk
@@ -68,6 +68,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_RowSetClones,\
comphelper/util/comphelp \
configmgr/source/configmgr \
connectivity/source/drivers/hsqldb/hsqldb \
+ $(if $(ENABLE_FIREBIRD_SDBC),connectivity/source/drivers/firebird/firebird_sdbc) \
connectivity/source/drivers/jdbc/jdbc \
connectivity/source/manager/sdbc2 \
dbaccess/util/dba \
diff --git a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
index 66f89c1b54c0..27a4b43500e9 100644
--- a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
+++ b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_hsqldb_test,\
configmgr/source/configmgr \
connectivity/source/cpool/dbpool2 \
connectivity/source/drivers/hsqldb/hsqldb \
+ $(if $(ENABLE_FIREBIRD_SDBC),connectivity/source/drivers/firebird/firebird_sdbc) \
connectivity/source/drivers/jdbc/jdbc \
connectivity/source/manager/sdbc2 \
dbaccess/util/dba \
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 19a91e6143c6..ffe45b4521a0 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -74,6 +74,8 @@
#include <iterator>
#include <set>
+#include <config_firebird.h>
+
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
@@ -581,25 +583,24 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
Reference< XDriverManager > xManager;
- OUString sMigrEnvVal;
- osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData,
- &sMigrEnvVal.pData);
+#if ENABLE_FIREBIRD_SDBC
bool bNeedMigration = false;
if(m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb")
{
- OUString sSalUseVclplugin;
- osl_getEnvironment(OUString("SAL_USE_VCLPLUGIN").pData,
- &sSalUseVclplugin.pData);
- if(!sMigrEnvVal.isEmpty() || sSalUseVclplugin == "svp")
+ OUString sMigrEnvVal;
+ osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData,
+ &sMigrEnvVal.pData);
+ if(!sMigrEnvVal.isEmpty())
bNeedMigration = true;
else
{
MigrationWarnDialog aWarnDlg{nullptr};
bNeedMigration = aWarnDlg.run() == RET_OK;
}
+ if (bNeedMigration)
+ m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
}
- if(bNeedMigration)
- m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
+#endif
try {
xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW );
@@ -712,6 +713,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) );
}
+#if ENABLE_FIREBIRD_SDBC
if( bNeedMigration )
{
Reference< css::document::XDocumentSubStorageSupplier> xDocSup(
@@ -720,6 +722,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE) );
importer.importHsqlDatabase();
}
+#endif
return xReturn;
}