Download it now!
Bug 93849 - Allow specifying the JDBC jar in the Database Wizard
Summary: Allow specifying the JDBC jar in the Database Wizard
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity Database-Wizard
  Show dependency treegraph
 
Reported: 2015-09-02 08:37 UTC by Stephan Bergmann
Modified: 2017-10-23 20:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2015-09-02 08:37:55 UTC
In the context of <https://bugzilla.redhat.com/show_bug.cgi?id=1258913> "The driver class 'com.mysql.jdbc.Driver' could not be loaded" I asked Lionel:

"With whatever LO version I try, it appears to always be the case that 'File - New - Database - Connect to an existing database: MySQL - Next >> - Connect using JDBC (Java Database Connectivity) - Next >>', keep default 'MySQL JDBC driver class: com.mysql.jdbc.Driver', then 'Test Class' leads to 'The JDBC driver could not be loaded' [...].  Is that expected, and users expected to manually add a jar to LO's JVM class-path settings, or what am I missing?"

To which he responded:

"The wizard text says 'a JDBC driver class must be installed on your system and registered with LibreOffice'. I can understand 'registered with LibreOffice' as 'added to the JVM class-path setting'. So it seems the system is currently designed like that, yes.

"Can we improve on that?

"One first (and I think already great step forward UI/HI-wise) would be that the wizard, in the same page where it asks for the driver class, asks for the path to the jar file. This is valid not only for MySQL-JDBC, but for any JDBC connection: generic JDBC, Oracle JDBC.

"To go further than that:

"In the context of a GNU/Linux distribution (or *BSD port collection), the packager knows where the system puts the packaged MySQL JDBC driver (e.g. /usr/share/java/mysql.jar and /usr/share/java/mysql-connector-java.jar on Debian), so we could at least look up there automagically. But the user should be able to override that to use another jar. At the upstream (LibreOffice) level, we could make that an option of ./configure (e.g. some better name
than --with-mysql-jdbc-jar-runtime-path). What it would be set to in our TDF builds is a good question... Maybe instead of a single path, a list of paths, corresponding to the main GNU/Linux distributions and also where the tarballs/packages downloaded directly from
https://downloads.mariadb.org/connector-java/
http://dev.mysql.com/downloads/repo/yum/
http://dev.mysql.com/downloads/repo/apt/
http://dev.mysql.com/downloads/repo/suse/
http://dev.mysql.com/downloads/connector/j/
install to.

"On Microsoft Windows, we could look up in the default install path of the MySQL Java connector and of the MariaDB Java Connector (if they differ).

"I suppose a similar thing can happen on MacOS X."
Comment 1 Alex Thurgood 2015-09-10 08:18:39 UTC
Confirming. This would be a useful enhancement IMO, but as Lionel has said, we would also need for the UI to provide the possibility to open the default file explorer and allow the user to point to where the jar file is stored.

We would need to take account of the possibility for confusion / conflict with the add classpath / archive dialog that is currently used for this purpose though.

On Mac OSX, there is no default directory for JDBC connectors in general. Most users just download a zip/tar file, and unzip/untar to the folder of their choice (more often than not the /Desktop or /Downloads folder out of sheer laziness).