All posts for the month March, 2015

Recently I found a need to have a desktop database application for a simple database. I have MySQL running on my SynologyNAS and have written PHP/JavaScript/HTTP interfaces for MySQL databases in the past. That said, it’s a lot of work! I wanted something simple and quick for this, but still need good table relationship support. Basically I was looking for something like Microsoft Access. This doesn’t exist on the Mac except in the Office 365 package of which I have no interest and only the one application need.

There are several alternative applications out there. There was a good one called Bento, but it was pulled from the market in 2013. Of the remaining ones (I won’t name them so none get wrongly percieved), some are slow, some don’t allow enough input form customization, some are too expensive, some don’t have enough table relationship support, and others are so new they are not yet feature rich (enough for me).

I looked at several builder applications both web based and application, again not naming them. I really spent far too much time looking at them. None of them do what I need.

Then I started looking at the open source office applications such as OpenOffice and LibreOffice. I also found Kexi, but it requires mild hacking to get it installed via Fink or Homebrew. More trouble than it is worth (for me), though I did work with it in a Linux VM and liked what I saw. Needs official Mac distribution!

I chose to go with LibreOffice. I downloaded and installed it. Launched it and proceeded to the “Base” application which is the database application and nearly a clone of Microsoft Access.

Through all the trials of software I already setup a MySQL database for the data. So I pointed Base at the MySQL database and was promptly greeted with an error:

MySQL JDBC Driver Install

Extract the archive to get access to the jar file. The jar file needs to be in the CLASSPATH for the JVM. Since this is not defined in the user shell find a location to store the jar file where LibreOffice can access it, while at the same time keeping it out the Documents folder. I chose my users Library/Application Support/Java directory. Just copy the jar file to the location you choose.

If you choose the Library location you have to unhide the Library from Finder because the Java pick dialog in LibreOffice can’t see it, even with the Option key trick. Open Terminal and issue the following command to permanently unhide your user Library from Finder. Enter your password when prompted:

sudo /usr/bin/chflags nohidden /Users/<your_username>/Library

Now start LibreOffice and select the Preferences menu item.

Next click the Advanced item in the LibreOffice section.

If you have more than one JRE installed, select the one you want LibreOffice to use.

Next click the “Class Path” button on the far right.

In the “Class Path” popup, click the “Add Archive” button.

In the file picker dialog, navigate to the location you put the MySQL JDBC driver jar file in, select the jar file and click OK. It should now be populated in the “Class Path” popup:

Click OK to close the “Class Path” popup.

Click OK again to close the LibreOffice preferences.

Exit LibreOffice completely.

Restart LibreOffice.

LibreOffice should now be working with a newer version of Java than the legacy 6 SE, and have access to remote MySQL databases using JDBC.

Try It Out

After restarting LibreOffice, start Base and choose “Connect to an existing database” (to connect to MySQL).

In step 1 set the database type to MySQL:

In step 2 set the connection type to “JDBC”.

In step 3 set the MySQL connection parameters as required by the MySQL database. Then click the “Test Class” button to ensure LibreOffice can load the MySQL JDBC driver. If it fails, go back and re-trace your steps.

Like this:

I’ve run into the following error several times since upgrading past OS X 10.8 (both Mavericks 10.9 and Yosemite 10.10). I have the latest JRE installed at version 8.

The error occurs because the version of Java that Oracle ships doesn’t include the proper JVM capabilities definition. Specifically it ships with only CommandLine capability defined, though it supports the others (JNI, BundledApp, WebStart, and Applets).

Resolving it is rather simple once you know how.

First open Terminal.

Now change directory to the JRE or JDK you have installed (your path may be slightly different):

cd /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents

Copy the “Info.plist” file to your desktop:

cp Info.plist ~/Desktop/Info.plist

Edit the desktop copy of the file with TextEdit or your favorite text editor.