Bug 144035 - Older odb with JDBC driver postgres connection does not work anymore
Summary: Older odb with JDBC driver postgres connection does not work anymore
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-23 14:07 UTC by herman.viaene
Modified: 2021-08-25 14:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
older odb not connectiong to postgres database. (1.83 KB, application/vnd.oasis.opendocument.database)
2021-08-23 14:07 UTC, herman.viaene
Details

Note You need to log in before you can comment on or make changes to this bug.
Description herman.viaene 2021-08-23 14:07:14 UTC
Created attachment 174492 [details]
older odb not connectiong to postgres database.

I have an odb created in april 2019. It did connect at  that time using the default options to a postgres database (in fact a postgres database initiated and operated by gnucash). The LO version was then one current at that time.
With LO 7.1.5.2 the odb file opens, but as soon as I click on the "Tables" option, I get the error “The class postgres could not be loaded”.
From the forum I learned that this odb uses jdbc. When I create such odb anew sdbc is used.
Annoying to have to delve into such things caused by a new version of LO.
The offending odb is attached.
Comment 1 herman.viaene 2021-08-24 08:18:14 UTC
It turns out that the rpm's from the LO download pages are missing something: in the options the classpath is empty, so the jdbc-postgres thingy is missing.
This is not the first time this happens to me. I had the same issue with LO 6.1.something and that was corrected in a following subrelease.
Comment 2 Alex Thurgood 2021-08-24 10:18:41 UTC
@Herman: this doesn't sound like a LibreOffice specific bug per se.

From what you have written, your ODB file used a JDBC driver connection to connect to your postgres server db. You would have had to install the corresponding jdbc-postgres-driver package specifically at the time onto your system via the system's package manager or else have found an independent JDBC driver that would have worked independently of the OS.

Please bear in mind that Linux distributions provide such database driver packages which are usually specific to the version of LibreOffice that they are distributing, so you can not necessarily expect a jdbc-driver package for LO6 to function with 7.x RPMs that you have downloaded from TDF.

The TDF website does not provide such JDBC driver specific packages, as Java integration is dependent on the various Linux distributions own way of installing and declaring the JVM system-wide.



I would be inclined to mark this as NOTOURBUG.
Comment 3 Alex Thurgood 2021-08-24 10:20:38 UTC
@Herman : could you at least let us know, which Linux OS you are using, and which version ?

If you are installing RPMs, I assume that this is some kind of Fedora-based release ?
Comment 4 herman.viaene 2021-08-25 06:50:30 UTC
It is Linux Mageia 8. It has an older version of LO (7.0.x) in its repos, but that one had an issue with calling reports from standalone forms (using embedded Firebird), which did not occur in the LO 6 - versions and does not anymore in the 7.1 version. That is the reason I went to the TDF-available versions.
Comment 5 Alex Thurgood 2021-08-25 13:52:36 UTC
@Herman : thanks !

I see various packages for the JDBC driver linked here, depending on the processor architecture you need, e.g. for x86_64  :

https://madb.mageia.org/package/show/name/postgresql-jdbc/application/0/arch/x86_64/source/1


After installation of the correct package, you will probably also have to :

(1) point LO to the directory in which the postgresql JDBC JARs can be found - this is done via the Advanced menu entry under Tools > Options > Classpath > Add Jar

for example, in my setup, I have the following (for an older postgres JDBC connector on macOS) :

/Users/alex/JavaDB/postgresql-8.4-702.jdbc3.jar

If the connection still won't work with a single jar, then you will have to point LO to the folder containing the various postgresql JARs. 


(2) fill in the driver name yourself in the connection configuration dialog from within LibreOffice once the ODB file has been loaded.


org.postgresql.Driver

The connection string is something like :

jdbc:postgresql://ipaddressofserver:5432/mydbname

or

jdbc:postgresql://ipaddressofserver port=5432 dbname=mydbname


I seem to recall that the string suggestions in the connection setup dialog provided by LO are incorrect (there is already a bug report for this, but I don't think it has been corrected yet).
Comment 6 Alex Thurgood 2021-08-25 14:02:24 UTC
FWIW, I can get this to work with

Version: 7.1.5.2 / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

and the postgresql-42.2.23 JDBC driver jar from the official postgresql download site

connecting to a PG10 server instance running locally on my mac.