Difference between revisions of "Database/Drivers/MySQL Native/SDBC(X) Interface"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: Database drivers in OpenOffice.org need to adhere to the [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/module-ix.html SDBC] API, alternatively to (selected parts of) the [ht...)
 
Line 3: Line 3:
 
Those APIs were originally modeled after JDBC (quite some times ago), but didn't evolve with JDBC. Also, not all the API defined in SDBC(X) is actually used in OpenOffice.org.
 
Those APIs were originally modeled after JDBC (quite some times ago), but didn't evolve with JDBC. Also, not all the API defined in SDBC(X) is actually used in OpenOffice.org.
  
 +
== SDBC ==
 
The concepts in SDBC are pretty similar to what you expect from other database APIs - connections, (prepared) statements, result sets, ... nothing really surprising.
 
The concepts in SDBC are pretty similar to what you expect from other database APIs - connections, (prepared) statements, result sets, ... nothing really surprising.
  
 +
Implementing SDBC (well, parts thereof) is necessary and sufficient for a driver to function in OpenOffice.org. Admittedly, there simply is no comprehensive specification of what OOo expects a driver to support. A significant part of a driver development is to debug OOo and find out what it expects from the driver :-\
 +
 +
=== Services ===
 
Looking over the interfaces, a minimal driver implementation for OOo probably needs to support
 
Looking over the interfaces, a minimal driver implementation for OOo probably needs to support
 
* [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/Driver.html a driver]
 
* [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/Driver.html a driver]
Line 12: Line 16:
 
* [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/ResultSet.html result sets]
 
* [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/ResultSet.html result sets]
  
 +
=== Interfaces ===
 
Talking about interfaces, this means
 
Talking about interfaces, this means
 
* XDriver
 
* XDriver
Line 23: Line 28:
 
* XRowUpdate
 
* XRowUpdate
  
Talking about methods .... well, that's hard to determine. Admittedly, there simply is no comprehensive specification of what OOo expects a driver to support. A significant part of a driver development is to debug OOo and find out what it expects from the driver :-\
+
=== Methods ===
 +
Talking about methods .... well, there certainly is functionality which is not needed by OOo (e.g. everything related to batch processing), however, it's difficult to ''exactly'' draw the line. If in doubt, you should ask your debugger, or look into the existing drivers.
 +
 
 +
== SDBCX ==
 +
SDBCX provides additional functionality on top of SDBC. Basically, an SDBCX driver can provide instances for basic database objects (tables, for instance), offering more functionality on them than the SDBC layer can provide. In some sense, SDBCX is an additional level of abstraction for functionality which in other APIs would usually need to be implemented back-end specific.
 +
 
 +
For instance, for altering the definition of a table, the XAlterTable interface, together with the ColumnDescriptor services, is defined. This allows Base's UI to just work on those objects, and letting the driver care for the details required by the concrete back-end.
 +
 
 +
=== Interfaces ===
 +
[http://api.openoffice.org/docs/common/ref/com/sun/star/sdbcx/XAlterTable.html XAlterTable], needed for altering table definitions. Consequently, the driver needs to implement the [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbcx/Table.html Table] service, which is where <code>XAlterTable</code> is available.

Revision as of 11:35, 6 May 2008

Database drivers in OpenOffice.org need to adhere to the SDBC API, alternatively to (selected parts of) the SDBCX API.

Those APIs were originally modeled after JDBC (quite some times ago), but didn't evolve with JDBC. Also, not all the API defined in SDBC(X) is actually used in OpenOffice.org.

SDBC

The concepts in SDBC are pretty similar to what you expect from other database APIs - connections, (prepared) statements, result sets, ... nothing really surprising.

Implementing SDBC (well, parts thereof) is necessary and sufficient for a driver to function in OpenOffice.org. Admittedly, there simply is no comprehensive specification of what OOo expects a driver to support. A significant part of a driver development is to debug OOo and find out what it expects from the driver :-\

Services

Looking over the interfaces, a minimal driver implementation for OOo probably needs to support

Interfaces

Talking about interfaces, this means

  • XDriver
  • XConnection
  • XDatabaseMetaData
  • XStatement
  • XPreparedStatement
  • XParameters
  • XResultSet*
  • XRow
  • XRowUpdate

Methods

Talking about methods .... well, there certainly is functionality which is not needed by OOo (e.g. everything related to batch processing), however, it's difficult to exactly draw the line. If in doubt, you should ask your debugger, or look into the existing drivers.

SDBCX

SDBCX provides additional functionality on top of SDBC. Basically, an SDBCX driver can provide instances for basic database objects (tables, for instance), offering more functionality on them than the SDBC layer can provide. In some sense, SDBCX is an additional level of abstraction for functionality which in other APIs would usually need to be implemented back-end specific.

For instance, for altering the definition of a table, the XAlterTable interface, together with the ColumnDescriptor services, is defined. This allows Base's UI to just work on those objects, and letting the driver care for the details required by the concrete back-end.

Interfaces

XAlterTable, needed for altering table definitions. Consequently, the driver needs to implement the Table service, which is where XAlterTable is available.

Personal tools