OpenOffice, JDBC and MySQL
Posted by ushimitsudoki on December 4, 2008
Today I wanted to connect OpenOffice.org 3.0 Base to my local MySQL server for some doodling – basically I want to see if Base is ready for normal use. Getting it hooked up is slightly tricky, because I kept getting a “The JDBC driver could not be loaded.” error.
Right. So just trying to connect to the MySQL server via JDBC by default kept giving me this:
This boils down to one of two things:
- You do not have the driver installed, or
- The driver is installed but can not be found
Check the driver installation
The file we are looking for: /usr/share/java/mysql.jar
If it is not there then install it:
sudo apt-get install libmysql-java
(You could just install it if you are too lazy to check it.)
Make it find-able
There are some guides to adjusting your CLASSPATH to put /usr/share/java/mysql.jar in your environment, but this does not seem to work for me and OpenOffice.
Fortunately, there is an easy way in OpenOffice. Launch OpenOffice and GUI your way to:
Tools > Options > Java > Class Path > Add Archive
And, then use the file dialog to add: /usr/share/java/mysql.jar:
You may have to re-start OpenOffice.
Test!
Now, when you test the driver, you should see “The JDBC driver was loaded successfully.”
Now to see how it works out!




giuseppe said
I wish to point out an article about Java and Openoffice base database (hsqldb).
It explain how can read, edit, and write data into openoffice base db with java.
I hope it is welcome.
David said
This worked great. Thanks for the help!
Luca said
Thank you very much. It’s the right solution for my issue. Have a nice life.