Bug 85148 - FILEOPEN: Firebird connect to server via new driver (feature request)
Summary: FILEOPEN: Firebird connect to server via new driver (feature request)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium enhancement
Assignee: Not Assigned
Keywords: easyHack, skillCpp, skillSql
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
Reported: 2014-10-17 15:00 UTC by reinierolislagers
Modified: 2019-05-09 11:45 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description reinierolislagers 2014-10-17 15:00:56 UTC
As bug 85146 indicates, it seems functionality for connecting to a Firebird server via TCP/IP rather than embedded in .odb or a separate Firebird .fdb file is already present.

It would be nice to be able to expose this in the GUI so one can connect to a Firebird server out of the box without needing to install other drivers, mess with ODBC etc.
Comment 1 Alex Thurgood 2015-01-03 17:38:42 UTC Comment hidden (no-value)
Comment 2 Tor Lillqvist 2018-01-03 09:13:32 UTC
I don't think our HSQLDB code has any similar feature, so this can't be a blocker for bug #51780.
Comment 3 Lionel Elie Mamane 2018-01-03 11:01:56 UTC
Basically we just need to ask for user and password in the UI.

In connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu in the
<node oor:name="sdbc:firebird:*" oor:op="replace">
 <node oor:name="MetaData">

add a child like that:

        <node oor:name="Authentication" oor:op="replace">
          <prop oor:name="Value" oor:type="xs:string">

While you are at it, change the "DriverTypeDisplayName" from "Firebird file" to "Firebird external".

Then in connectivity/source/drivers/firebird/Connection.cxx in method Connection::construct, in
       if (url == "sdbc:embedded:firebird")
       // External file AND/OR remote connection
       else if (url.startsWith("sdbc:firebird:"))
              // HERE

Get the username and password from the "info" parameter. See e.g. connectivity/source/drivers/odbc/OConnection.cxx method OConnection::Construct for an example how to do that.

Then pass the username and password to the firebird API. A bit lower you have:

            if (m_bIsEmbedded || m_bIsFile)
                // TODO: parse password from connection string as needed?

At the place of this TODO, strncpy the username and password you have extracted from info into the userName and userPassword buffers.

For bonus points, you can implement a specific UI page just for Firebird in the wizard, like we have for MySQL. bug 43369 contains instructions on how to do that (for PostgreSQL, but can be adapted for Firebird).