Virtual OS/2 International Consumer Education
VOICE Home Page:
May 2004

Newsletter Index
< Previous Page | Next Page >
Feature Index

Access to MySQL databases from StarOffice via JDBC

By Wolfgang Draxler © May 2004

The question is often asked in newsgroups how to use MySQL with StarOffice. I briefly describe how to do this using the database mentioned in the article "Close Collaboration between MySQL and OS/2."

At present there is only one way to make the connection, namely via JDBC. Java 1.1.8 must be installed (later versions do not work). Theoretically, an ODBC component should also work but unfortunately there is no OS/2 driver available. Perhaps some programmer will write one.

Now back to the JDBC driver. Download the ZIP file by following the link to the ZIP archive. Place the archive in its own directory.

Unzipping this archive produces a lot of files and directories. Look for the file mysql-connector-java-2.0.14-bin.jar and copy it into its own directory; I chose f:\java\jar. Rename the file to mysql.jar. (I did this only because the new name is shorter and easier to type. And it makes it easy to change to other versions.)

Now go to the installation directory of StarOffice which in my case is f:\textmanagement\staroffice51. Find the file soffice.ini and make a backup copy. Open the file with a text editor, e.g. e.exe.

Find the section headed [JAVA], change the entries as follows:


(In my case, eComStation is installed on drive D:. Java 1.1.8 is also stored on D:.)

Now save the file and start StarOffice 5.1a. When it is running, click on the Tools menu and then on Options. There will be a menu tree on the left. Choose Browser and then Other. In the text-entry field on the right, next to ClassPath, enter the text f:\java\jar\mysql.jar. Then click OK.

Fig.1: StarOffice Options

Now click the menu entries File->New->Database. A dialog appears where the database connection can be configured.

db connect
Fig.2: Database properties

On the General tab you supply the name of the database connection. This 'name' is needed by StarOffice and has nothing to do with MySQL. I entered "Adressen."

Next click on Type and for Database type enter the value JDBC.

db type
Fig.3: Setting the database connection type

Now click on the JDBC tab and enter the following:

JDBC-driver-class: com.mysql.jdbc.Driver
URL: jdbc:mysql://
Username: root
Password: <your root password>

When all this has been entered correctly, under the Tables tab you can view a list of all the tables stored in the given database in MySQL; e.g. in our case the table "land."

db tables
Fig.4: List of the configured tables

. . . and finally click on the OK button. You are done!

We heartily thank Timo Maier for permission to copy part of the website


JDBC-Treiber: /connector/j/2.0.html
Tips-Seite zu JDBC/MySQL/StarOffice:

Wolfgang Draxler lebt mit seiner Ehefrau Yvonne in Wien. Er ist für eine Softwareentwicklungs- und Beratungsfirma im Bereich der Organisations- und Datenbankprogrammierung tätig. Privat arbeitet er unter anderem an der Weiterentwicklung von Sibyl für OS/2, einer Delphi-ähnlichen Programmiersprache.

Feature Index
< Previous Page | Newsletter Index | Next Page >
VOICE Home Page: