One advantage of OpenOffice.org is that multiple databases can be used. With the corresponding driver, OpenOffice.org can be linked to any database system! However, you still need to worry about choosing the connector (driver) between OpenOffice.org and MySQL. The following is an example:
First, you need to select a Driver (sometimes also called a connector ). MySQL provides two types of connectors: ODBC driver for MySQL (connector/ODBC) and JDBC driver for MySQL (connector/J), which are easier to use, linux, windows, and Mac OS X are available, but connector/J requires a Java environment and ensures that Java extensions of OpenOffice.org are correctly installed.(My opinion: the Java environment is too huge !)In addition, connector/J has restrictions on functions when used in combination with OpenOffice.org. In short, it is inconvenient.
In contrast, connector/ODBC has no restrictions, but the installation and configuration are a little more troublesome. In Linux, the optimal performance of ctor/ODBC is to link to the local data library, because the driver always wants to find MySQL. if a file such as sock is not found, the link may fail, but you can also make some modifications on your own so that connector/ODBC can be linked to the remote database, but it seems that it is not worth doing so!
In general, in Linux and Mac OS X environments, you are advised to use connector/J (with a third-party tool to edit databases ), if your database is installed on a local Linux or windows, we recommend that you use ctor/ODBC.
How to Use connector/J?
Download it from the MySQL official website, decompress it, move the file: mysql-connector-java-x.x.x-bin.jar to the appropriate location (such as home), run OpenOffice.org, tools-> options-> JAVA, make sure that the Java Runtime Environment is selected, then click the class path button, then click the Add archive button, find and select the mysql-connector-java-x.x.x-bin.jar, OK, and then exit restart OpenOffice.org.
Now you can link to the database. In OpenOffice.org, choose new> database ), in the Database Wizard, select connect to an existing database (connect to an existing database), and then select MySql-> next (next)-> Connect using JDBC (Connect using JDBC) -> next (next step), fill in the Database Name, password, and so on. At this time, you can test whether the database can be connected.
On Ubuntu, how does one use ctor/ODBC?
First install the dependency package: unixodbc, libmyodbc, and unixodbc-bin (this is a GUI tool that saves you the trouble of editing the. conf file !). After installation, run: sudo odbcconfig. After running, select System DNS-> Add (ADD) and click Add (ADD) to create an ODBC driver. A window is displayed, as shown in the following figure, enter/usr/lib/ODBC/libmyodbc In the diver. so, enter/usr/lib/ODBC/libodbcmys in setup. so, save and exit. Then click OK to open the data source Properties window, which prompts you to complete the configuration.
The OpenOffice.org connection method is the same as creating a database just now. In the Database Wizard, select link to an existing database. Use ODBC to complete the database information and test whether the connection is successful.
On Windows, how does one use ctor/ODBC?
If you have installed OOO on Windows, download the Connection Tool ODBC driver for MySQL and go to the control panel> Management Tools> data sources (ODBC ). Select User DSN tab-> Add MySQL ODBC driver-> OK. The connector/ODBC settings window (for example) appears, and fill in the database information. The setting method of OpenOffice.org is almost the same as that above, and it is a process of selecting the connection method.