summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-20 15:00:48 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-20 15:02:27 +0100
commit27c11f1f08716e54f83571a84698c62692260b30 (patch)
tree8eb954ab61e5214b896dd8c0b6c88dc7f8e34306 /connectivity
parenta516ac452e33d3f0df2572089041e2555808a5ee (diff)
Implement creation/loading of external firebird .fdbs.
Change-Id: I61186189d791e54fb096505abd2fa7ac248035e8
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx8
-rw-r--r--connectivity/source/drivers/firebird/Connection.hxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index c00d621216f1..67e7a9d91fff 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -81,6 +81,7 @@ Connection::Connection(FirebirdDriver* _pDriver)
, m_sFirebirdURL()
, m_bIsEmbedded(sal_False)
, m_xEmbeddedStorage(0)
+ , m_bIsFile(sal_False)
, m_sUser()
, m_bIsAutoCommit(sal_False)
, m_bIsReadOnly(sal_False)
@@ -184,13 +185,16 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV
else if (url.startsWith("sdbc:firebird:"))
{
m_sFirebirdURL = url.copy(OUString("sdbc:firebird:").getLength());
- if (m_sFirebirdURL.startsWith("file://")) // TODO: are file urls really like this?
+ if (m_sFirebirdURL.startsWith("file://"))
{
+ m_bIsFile = true;
uno::Reference< ucb::XSimpleFileAccess > xFileAccess(
ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext()),
uno::UNO_QUERY);
if (!xFileAccess->exists(m_sFirebirdURL))
bIsNewDatabase = true;
+
+ m_sFirebirdURL = m_sFirebirdURL.copy(OUString("file://").getLength());
}
}
@@ -209,7 +213,7 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV
*dpb++ = FIREBIRD_SQL_DIALECT;
// Do any more dpbBuffer additions here
- if (m_bIsEmbedded) // TODO: || m_bIsLocalFile
+ if (m_bIsEmbedded || m_bIsFile)
{
*dpb++ = isc_dpb_trusted_auth;
*dpb++ = 1; // Length of data
diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx
index c20e6f63525c..a2f7dfe80b4f 100644
--- a/connectivity/source/drivers/firebird/Connection.hxx
+++ b/connectivity/source/drivers/firebird/Connection.hxx
@@ -109,6 +109,9 @@ namespace connectivity
::boost::scoped_ptr< ::utl::TempFile > m_pExtractedFDBFile;
+ /** We are using an external (local) file */
+ bool m_bIsFile;
+
/* REMOTE CONNECTION DATA */
::rtl::OUString m_sUser;