Extending Database Drivers

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 10:02, 9 February 2010 by Oj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



In the following section, extending existing SDBC drivers by extensions is described. These section is valid from since: OOo 3.3

Most drivers miss to support special features like to alter view definitions or to add or drop key of a table. Therefor these interfaces

can be implemented by an extension.

To enable the needed feature the extension has to extend the properties entry of the configuration of the driver. The configuration entry below the properties entry will be checked and if the service name can be instantiated it will be used to do the job. Below you'll see a table of mapping from configuration entry to service name.

Configuration name Interface name which has to to be implemented
ViewSupportServiceName com.sun.star.sdb.tools.XViewSupport
TableAlterationServiceName com.sun.star.sdb.tools.XTableAlteration
TableRenameServiceName com.sun.star.sdb.tools.XTableRename
IndexAlterationServiceName com.sun.star.sdb.tools.XIndexAlteration
KeyAlterationServiceName com.sun.star.sdb.tools.XKeyAlteration

In favor to allow to get the definition of queries, forms and reports from other locations as the default file format specification, an extension may implement a service which implement the following named interfaces. The configuration entries are named

  • CommandDefinitionSupplier
  • FormSupplier
  • ReportSupplier

which all have to implement the interfaces

The configuration fragment below shows how to define which service should be created to extend the view support and to extend the table alteration support.

<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <node oor:name="Installed">
    <node oor:name="jdbc:" oor:op="replace">
      <prop oor:name="ParentURLPattern">
        <value>jdbc:*</value>
      </prop>
      <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
        <value xml:lang="en-US">SQL 2008 JDBC</value>
      </prop>
      <node oor:name="Properties">
        <node oor:name="ViewSupportServiceName" oor:op="replace">
          <prop oor:name="Value" oor:type="xs:string">
            <value>com.sun.star.sdb.comp.SQL2008.ViewSupport</value>
          </prop>
        </node>
        <node oor:name="TableAlterationServiceName" oor:op="replace">
          <prop oor:name="Value" oor:type="xs:string">
            <value>com.sun.star.sdb.comp.SQL2008.TableAlterService</value>
          </prop>
        </node>
      </node>
    </node>
  </node>
</oor:component-data>
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages