Database Access

From Apache OpenOffice Wiki
Jump to: navigation, search



PDF Icon.gif Download as a PDF or ODT


Platform Independence

The goal of the Apache OpenOffice API database integration is to provide platform independent database connectivity for Apache OpenOffice API. While it is necessary to access database abstraction layers, such as JDBC and ODBC, it is also desirable to have direct access to arbitrary data sources, if required.

The Apache OpenOffice API database integration reaches this goal through an abstraction above the abstractions with the Star Database Connectivity (SDBC). SDBC accesses data through SDBC drivers. Each SDBC driver knows how to get data from a particular source. Some drivers handle files themselves, others use a standard driver model, or existing drivers to retrieve data. The concept makes it possible to integrate database connectivity for MAPI address books, LDAP directories and Apache OpenOffice Calc into the current version of Apache OpenOffice API.

Since SDBC drivers are UNO components, it is possible to write drivers for data sources and thus extend the database connectivity of Apache OpenOffice API.

Functioning of the Apache OpenOffice API Database Integration

The Apache OpenOffice API database integration is based on SQL. This section discusses how the Apache OpenOffice API handles various SQL dialects and how it integrates with data sources that do not understand SQL.

Apache OpenOffice API has a built-in parser that tests and adjusts the syntax to be standard SQL. With the parser, differences between SQL dialects, such as case sensitivity, can be handled if the query composer is used. Data sources that do not understand SQL can be treated by an SDBC driver that is a database engine of its own, which translates from standard SQL to the mechanisms needed to read and write data using a non-SQL data source.

Integration with Apache OpenOffice API

Apache OpenOffice API employs SDBC data sources in Writer, Calc and Database Forms. In Writer, use form letter fields to access database tables, create email form letters, and drag tables and queries into a document to create tables or lists.

If a table is dragged into a Calc spreadsheet, the database range that can be updated from the database, and data pilots can be created from database connections. Conversely, drag a spreadsheet range onto a database to import the spreadsheet data into a database.

Another area of database connectivity are database forms. Form controls can be inserted into Writer or Calc documents, or just created in the database file with Base, to connect them to database tables to get data aware forms.

While there is no API coverage for direct database integration in Writer, the database connectivity in Calc and Database Forms can be controlled through the API. Refer to the corresponding chapters Database operations and Forms for more information. In Writer, database connectivity can be implemented by application programmers, for example, by accessing text field context. No API exists for merging complete selections into text.

Using the Apache OpenOffice API database integration enhances or automates the out-of-box database integration, creates customized office documents from databases, or provides simple, platform-independent database clients in the Apache OpenOffice API environment.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages