|
Using MySQL
From NeoWiki
(Difference between revisions)
Revision as of 06:42, 15 August 2005 (edit) ( | contribs) (→Enabling NeoOffice/J or OpenOffice.org/X11 to connect to MySQL databases) ← Previous diff |
Revision as of 00:01, 4 September 2005 (edit) (undo) ( | contribs) m (→Detailed Installation) Next diff → |
||
Line 36: | Line 36: | ||
# Go to the following Menu: Tools | Data Sources... | # Go to the following Menu: Tools | Data Sources... | ||
# Above the panel on the left is a button that says New Data Source. Click it. | # Above the panel on the left is a button that says New Data Source. Click it. | ||
- | # | + | # Select Database Type of MySQL. Click Apply. |
- | # Click the | + | # Click the MySQL tab. |
+ | # Select the 'Use Connector/J3' button. | ||
# Set the JDBC Driver class to: <tt>com.mysql.jdbc.Driver</tt> | # Set the JDBC Driver class to: <tt>com.mysql.jdbc.Driver</tt> | ||
+ | # Change the non grey part of the URL to: <tt>localhost:3306/test</tt> | ||
# Set the user name and check the password box, if required. | # Set the user name and check the password box, if required. | ||
# Click the Tables tab. | # Click the Tables tab. |
Revision as of 00:01, 4 September 2005
Contents |
Enabling NeoOffice/J or OpenOffice.org/X11 to connect to MySQL databases
Using JDBC and Connector/J
Installation
- Download Connector/J 3.0 from the MySQL website.
- The included README gives much information.
- The most important keypoints are:
- the class name of the JDBCdriver: com.mysql.jdbc.Driver
- the URL format: jdbc:mysql://host.domain/database_name
- You will need a version of Connector/J that supports Java 1.3.x, since that is the version of Java used in NeoOffice/J.
- Note: Connector/J 3.1 and, presumably, later versions are not Java 1.3.x compatible.
- The jar file location:
- for OOo/X11: you can put it where you want. To let OOo know, you shoud go to "Tools->Options" menu item. Then in the "security" pane, there is a place to add directories to classpath. Click on browse and find your jar file.
- for Neo/J: I had to put it in the <NeoOffice>/Contents/MacOS/classes folder to get it found. Didn't check with recent release if the previous classpath setting does work.
- FYI. I just tried adding the MySQL jar file using the Security pane in the Tools->Options menu item Neo/J 1.1 Alpha 2. After adding the jar file in that pane and restarting Neo/J, I successfully connected to my MySQL database.
- This works with Neo/J 1.1 final. The former option is probably better for providing it to all users, whereas this is well suited for
- There is also an attachment (.sxw) to OpenOffice.org Issue 13753 which contains screenshots and a different location for placing the Connector/J file.
Detailed Installation
- If you haven't already, install NeoOffice/J (I am using v1.1, downloaded 2005-08-14) and MySQL (I am using 4.1.13-standard).
- Download Connector/J 3.0 from http://www.mysql.com and save it to the Desktop. (I downloaded v3.0.17, the tar.gz version).
- Extract it.
- Copy the .jar file to wherever you like (I chose ~/lib).
- Open Neooffice/J.
- Go to the following Menu: Tools | Options...
- On the left is a tree of items. At the very top is NeoOffice/J. Indented and underneath is a list of other items. Click on Security.
- This changes the panel on the right. At the bottom is a Java section. Click the Browse button.
- Make sure that there are no other Connector/J versions installed (e.g., 3.1) or they will make life messy. To remove them, click the jar file to select, then click Delete. Repeat as necessary. (Note: not all items here are necessarily Connector/J archives, use some caution).
- Click the Add button.
- Browse to the directory the Connector/J 3.0 jar file is in. Select the .jar file and click the Open button.
- Click the OK button.
- Exit NeoOffice/J.
- Restart NeoOffice/J.
- Go to the following Menu: Tools | Data Sources...
- Above the panel on the left is a button that says New Data Source. Click it.
- Select Database Type of MySQL. Click Apply.
- Click the MySQL tab.
- Select the 'Use Connector/J3' button.
- Set the JDBC Driver class to: com.mysql.jdbc.Driver
- Change the non grey part of the URL to: localhost:3306/test
- Set the user name and check the password box, if required.
- Click the Tables tab.
- Fill out your password if necessary.
- Observe that no error message appears and that there is an entry in the white box.
Configuration
With the above basic setup, the connection should work. Then you come to the fine tuning stuff: charset, etc...
There are additional pointers available in this thread on trinity on other MySQL configuration issues.
Using OBDC
mansky posts some steps for getting OBDC to work with MySQL and OpenOffice.org/X11 in this post on trinity; it also contains other OOo/MySQL pointers.
kervalen posts some steps for getting OBDC to work with MySQL and NeoOffice/J in this post on trinity.
Using the Database with your NeoOffice/J Documents
information on how to use the database