Diff for "UsingJavaDatabaseConnectivityAndLibreOffice"


Differences between revisions 3 and 4
Revision 3 as of 2008-10-17 22:49:24
Size: 2455
Editor: cpe-69-207-215-155
Comment: Added to CategoryOffice.
Revision 4 as of 2011-05-21 13:24:04
Size: 2618
Editor: 78-105-201-166
Comment: Changed references to OpenOffice to Libre/OpenOffice or specifically to Base
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
||<tablestyle="float:right; font-size: 0.9em; width:30%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;"><<TableOfContents>>||
Line 3: Line 5:
This document explains how to use OpenOffice.org to edit MySQL Database files using JDBC Connectivity This document explains how to use Base (the !LibreOffice / !OpenOffice Database program) to edit MySQL Database files using JDBC Connectivity.
Line 7: Line 9:
See [[JDBCAndMySQL|Installing JDBC for MySQL 5.0]] for instructions on how to set up MySQL and JDBC on Ubuntu. See [[JDBCAndMySQL|Installing JDBC for MySQL 5.0]] for instructions on how to set-up MySQL and JDBC on Ubuntu.
Line 9: Line 11:
= Connecting via OpenOffice = = Connecting via Base =
Line 11: Line 13:
Start up Openoffice.org Database, and click on "Connect to an existing Database" on the Database Wizard. The connection type should already be selected as "JDBC" Start up Base and click on "Connect to an existing Database" on the Database Wizard. The connection type should already be selected as "JDBC"
Line 17: Line 19:
The DataSource URL states where the Database is The !DataSource URL states where the Database is
Line 26: Line 28:
 1. mysql: specifies that we are going to connect to a mysql database  1. mysql: specifies that we are going to connect to a !MySql database
Line 28: Line 30:
 1. emotherearth is the name of the MySQL Database we are going to connect to.  1. emotherearth is the name of the !MySql Database we are going to connect to.
Line 30: Line 32:
The JDBC Driver Class is the Java packaged file that helps us connect to MySQL this should be The JDBC Driver Class is the Java packaged file that helps us connect to !MySql this should be
Line 42: Line 44:
When you set up your MySQL server, you set up a user name and password. This is not the same as your ubuntu name and password - it belongs to MySQL. You can make the same but it isn't required. When you set up your !MySql server, you set up a user name and password. This is not the same as your ubuntu name and password - it belongs to !MySql. You can make the same but it isn't required.
Line 44: Line 46:
Enter the MySQL password and check the Password required box Enter the !MySql password and check the "Password required" box
Line 52: Line 54:
I leave "Register the Database for me" as this allows  the 'connection' to be saved. If you click "Next" again you will be shown a Save dialog to save the connection details, then the main OpenOffice.Org Database page will appear. Leave "Register the Database for me" as this allows the 'connection' to be saved.  If you click "Next" again you will be shown a Save dialog to save the connection details, then the main Base page will appear.
Line 54: Line 56:
The first time you do something it will ask you to type the password, but other than that it will remember it until you leave Openoffice. The first time you do something it will ask you to type the password, but other than that it will remember it until you leave !LibreOffice or !OpenOffice.
Line 58: Line 60:
The next time you want to use the file (e.g. after closing OpenOffice) you simply open the file you saved in "Registering the Database". You will need to type the password in, but nothing else. The next time you want to use the file (e.g. after closing Base) you simply open the file you saved in "Registering the Database". You will need to type the password in, but nothing else.

Introduction

This document explains how to use Base (the LibreOffice / OpenOffice Database program) to edit MySQL Database files using JDBC Connectivity.

Setting up JDBC

See Installing JDBC for MySQL 5.0 for instructions on how to set-up MySQL and JDBC on Ubuntu.

Connecting via Base

Start up Base and click on "Connect to an existing Database" on the Database Wizard. The connection type should already be selected as "JDBC"

Click "Next"

Setting up the Connection

The DataSource URL states where the Database is

jdbc:mysql://127.0.0.1/emotherearth

This is four parts

  1. jdbc: specifies that we are going to access the database using Java Database Connectivity. You don't need to type this as it is already there.
  2. mysql: specifies that we are going to connect to a MySql database

  3. 127.0.0.1 specifies the machine the server is on - this is our own machine "localhost"
  4. emotherearth is the name of the MySql Database we are going to connect to.

The JDBC Driver Class is the Java packaged file that helps us connect to MySql this should be

com.mysql.jdbc.Driver

Click on "Test Class" and you should get a message that the driver has successfully loaded. If not, check the JDBC installation, especially CLASSPATH.

Click "Next"

User information

When you set up your MySql server, you set up a user name and password. This is not the same as your ubuntu name and password - it belongs to MySql. You can make the same but it isn't required.

Enter the MySql password and check the "Password required" box

Click on the "Test Connection" button, and enter the password. It should now successfully connect to the database. If not, check your username, password and the Datasource URL.

Click "Next"

Registering the Database

Leave "Register the Database for me" as this allows the 'connection' to be saved. If you click "Next" again you will be shown a Save dialog to save the connection details, then the main Base page will appear.

The first time you do something it will ask you to type the password, but other than that it will remember it until you leave LibreOffice or OpenOffice.

The next time

The next time you want to use the file (e.g. after closing Base) you simply open the file you saved in "Registering the Database". You will need to type the password in, but nothing else.


CategoryOffice

UsingJavaDatabaseConnectivityAndLibreOffice (last edited 2021-08-09 06:17:14 by fitojb)