SO & MySQL on pure Linux system...

I've got a MySQL Database on our office servier (Fedora 2) and SO7 on my workstation (also Fedora 2). Both work fine independantly. What I want to do is a simple mail merge on the MySQL database.

I've been hunting through the docs, but can't find anything that discusses how to connect SO7 to MySQL. Can anyone please point me to a doc or (even better) a HowTo?

Thanks in advance: John

[429 byte] By [jalmberg] at [2007-11-25 22:32:40]
# 1

Still no luck on this, although I would think this would be a fairly standard thing to do with StarOffice...

I figured out that I should be using the Connector/J3 driver. I downloaded the package from the MySQL site and unpacked it. Then, according the the MySQL docs, I changed my CLASSPATH with the following line in .bashrc:

CLASSPATH=" /nfs/home/jalmberg/programs/mysql-connector-java-3.0.15-ga/m ysql-connector-java-3.0.15-ga-bin.jar: "$CLASSPATH

This *is* the correct path.

However, when I try to set up the Data Source from within StarOffice, I get an error message saying that "No connection could be established...".

Clicking the 'More' button give further details:

No connection could be established for the URL sdbc:mysql:jdbc:<italy>:<3306>/<marketing>.

The specified driver could not be loaded!

com/mysql/jdbc/Driver

The hostname, port, and database name are all correct. I can connect to mysql via a terminal no problem.

I'll keep plugging at this, but any help much appreciated.

-- John

jalmberg at 2007-7-5 2:47:33 > top of Java-index,StarOffice,StarSuite...
# 2

HOW TO CONNECT STAROFFICE 7 TO MYSQL DATABASE

I did this in a pure Linux environment, but it's probably similar in the M$ environment...

PREREQUISITES

1. First, you need a working MySQL server, with a user who has rights to access the db from where ever it is you are working from. That is standard MySQL admin stuff, so I won't get into it here. For the record, I had a MySQL server running on a Fedora 2 server. I added a test database and gave myself access rights from the workstation that I installed StarOffice on. I tested the connection from my workstation using a terminal connection before trying to connect with StarOffice.

2. Next, you need a workstation with StarOffice installed and working. Again, this is documented elsewhere. My workstation was a Fedora 2 system with Gnome desktop running.

3. Finally, you need the MySQL Connector/J driver package from the MySQL website. You can download it here:

<a href="http://www.mysql.com/products/connector/j/" target="_blank">http://www.mysql.com/products/connector/j/</a>

It's simple to install using the instructions here:

<a href="http://dev.mysql.com/doc/connector/j/en/index.html" target="_blank">http://dev.mysql.com/doc/connector/j/en/index.html</a>

Just be sure that it is in a directory that is accessible to StarOffice and double check the rights on a *nix system. As long as the directory has the same rights as the StarOffice program directory, you should be okay. I installed the driver software right next to the staroffice7 directory and gave it the same access rights.

MAKING THE CONNECTIONS

4. SET THE CLASSPATH IN STAROFFICE: Open StarOffice and access the Security Options at Tools --> Options --> Security. In the CLASSPATH box, click the 'Browse' button, then the 'Add' button. Browse for the driver .jar file that you installed in step 3. When I was all done, my CLASSPATH looked like this: /install/mysql-connector-java-3.0.15-ga/mysql-connector-java -3.0.15-ga-bin.jar

Your path will be different, of course. When you are done, close StarOffice and reopen it to save the CLASSPATH.

5. SETUP THE DATASOURCE:

- Open the DataSource dialog at Tools --> DataSources.

- Click the 'New Data Source' button

- Enter a datasource name, like 'Test MySQL'

- Choose Database Type = JDBC

- Enter the datasource URL. It will look like:

<a href="jdbc:mysql://hostname/database" target="_blank">jdbc:mysql://hostname/database</a>

Of course, you must supply the correct hostname and database name. The hostname is the name of the machine your MySQL server is running on (or perhaps 'localhost', if it is the same machine), and the database is the test database you installed. If you tested your mysql access rights before starting, this will be obvious, because they are the same hostname/database name you used to connect using your terminal.

6. CLICK ON THE JDBC TAB

The JDBC driver class name is: 'com.mysql.jdbc.Driver' (this took me an hour to find!)

The URL should be filled in already, but it's the same as the datasource URL you filled out in 5.

The User Name is your MySQL User name. Click 'password required' if you need a password to log into MySQL.

7. CLICK ON THE TABLES TAB.

Enter your password (if required) and hit 'Ok'. If everything is correct, you will be rewared by a view of your MySQL database. This took me about 7 hours of work to achieve, so if you did it in the time it took to read this How To, congratulations!

Whew... I knew it would be simple, once I figured it out... Time for a Fullers!

-- John

jalmberg at 2007-7-5 2:47:33 > top of Java-index,StarOffice,StarSuite...
# 3
I'm still having no luck connecting Mysql to Staroffice7 using Fedora core 1.I keep getting error messages after clicking the table tab.Either the path is messed up or the driver is wrong.Any suggestions?Jay Scherrer
gimpit at 2007-7-5 2:47:33 > top of Java-index,StarOffice,StarSuite...
# 4
thanks, this is what finally worked for me too on Win98 and an Apache Friends LAMP box.
bowenmark at 2007-7-5 2:47:33 > top of Java-index,StarOffice,StarSuite...