The following description shows how you can connect OpenOffice as a database application using JDBC to MaxDB database instance HOTELDB. The example was tested on Fedora Core 2 using OpenOffice version 1.1.2.
· You have installed OpenOffice Version 1.1.2 (http://www.openoffice.org).
· You have installed JDK 1.2 or above.
· You have installed the MaxDB software including the JDBC driver (see Installation Manual, Installation Profile) and configured it (see JDBC, Installing the JDBC Driver).
· You have created database instance HOTELDB and the database user MONA and filled the tables with data (see SQL Tutorial, Example Database HOTELDB).
· The HOTELDB database instance is in operational state ONLINE.
· The X Server is started.
...
1. Start OpenOffice Calc.
2. Choose Tools ® Options and then Security.
3. In the Class Path field, enter the JDBC driver including the full path: <independent_program_path>/runtime/jar/sapdbc.jar
/opt/sdb/programs/runtime/jar/sapdbc.jar
4. Close OpenOffice and reopen it.
5. Choose View ® Data Sources
The data sources that were already defined are displayed.
6. To make the HOTELDB database instance available as a data source in OpenOffice, choose Tool ® Data Sources and then New Data Source. Make the following entries:
OpenOffice configuration of data sources
Tab |
Property |
Value |
General |
Name |
Specify a name for the data source, such as Hotel database |
|
Database Type |
JDBC |
JDBC |
JDBC Driver Class |
com.sap.dbtech.jdbc.DriverSapDB |
|
URL |
jdbc:sapdb://localhost:HOTELDB |
|
User Name |
MONA |
|
Password Required |
Select this option. |
7. On the same dialog, choose the Tables tab. The system asks you to enter the password for database user MONA. Enter the password RED.
Always specify the user name and password in uppercase.
All tables belonging to database user MONA are displayed.
If problems occur when you log on to the database instance, or if the tables are not displayed correctly, then you can switch on the ODBC trace for troubleshooting; see Traces.
You can now use database instance HOTELDB as an OpenOffice data source. OpenOffice provides the following options, among others:
· Saving SQL queries
· Graphically designing SQL queries
· Creating input forms for inserting and changing values in the database instance. To start the form autopilot, choose File ® AutoPilot ® Form
Input form for table RESERVATION
See also: