Tables and Columns

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 13:56, 21 December 2020 by DiGro (Talk | contribs)

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

A encapsulates tables in a Apache OpenOffice API data source. The service changes the appearance of a table and its columns in the GUI, and it contains read-only information about the table definition, such as the table name and type, the schema and catalog name, and access privileges.

It is also possible to alter the table definition at the service. This is discussed in the section Database Design below.

The table related services in the database context are unable to access the data in a database table. Use the service, or to establish a connection to a database and use its interface to manipulate table data. For details, see the sections The RowSet Service and PreparedStatement From DataSource Queries.

The following illustration shows the relationship between the and the Table objects it provides, and the services included in

Connection and Tables

The interface of a Connection supplies a of services through its method getTables(). The container administers Table services by name, index or as enumeration.

Just like queries, tables include the display properties specified in

Properties of
Filter string - An additional filter for the data object, WHERE clause syntax.
ApplyFilter boolean - Indicates if the filter should be applied. The default is FALSE.
Order string - Is an additional sort order definition.
FontDescriptor struct Specifies the font attributes for displayed data.
RowHeight long - Specifies the height of a data row.
TextColor long - Specifies the text color for displayed text in 0xAARRGGBB notation

Basic table information is included in the properties included with

Properties of
Name [readonly] string - Table name.
CatalogName [readonly] string - Catalog name.
SchemaName [readonly] string - Schema name.
Description [readonly] string - Table Description, if supported by the driver.
Type [readonly] string - Table type, possible values are TABLE, VIEW, SYSTEM TABLE or an empty string if the driver does not support different table types.

The service is an extension of the service It introduces an additional property called Privileges. The Privileges property indicates the actions the current user may carry out on the table.

Properties of
Privileges [readonly] long, constants group The property contains a bitwise AND combination of the following privileges:
  • SELECT user can read the data.
  • INSERT user can insert new data.
  • UPDATE user can update data.
  • DELETE user can delete data.
  • READ user can read the structure of a definition object.
  • CREATE user can create a definition object.
  • ALTER user can alter an existing object.
  • REFERENCE user can set foreign keys for a table.
  • DROP user can drop a definition object.

The appearance of single columns in a table can be changed. The following illustration depicts the service and its relationship with the service.

Table and Table Column

For this purpose, supports the interface Its method getColumns() returns a with the additional column-related interface that is useful to get the column number for a certain column in a table:

  long findColumn( [in] string columnName)

The service combines and the to form a column service with the opportunity to alter the visual appearance of a column.

Properties of
FormatKey long - Contains the index of the number format that is used for the column. The proper value can be determined using the interface. If the value is void, a default number format is used according to the data type of the column.
Align long - Specifies the alignment of column text. Possible values are:

0: left
1: center
2: right

If the value is void, a default alignment is used according to the data type of the column.

Width long - Specifies the width of the column displayed in a grid. The unit is 10th mm. If the value is void, a default width should be used according to the label of the column.
Position long - The ordinal position of the column within a grid. If the value is void, the default position should be used according to their order of appearance in
Hidden boolean - Determines if the column should be displayed.
ControlModel May contain a control model that defines the settings for layout. The default is NULL.
HelpText string - Describes an optional help text that can be used by UI components when representing this column.
ControlDefault string - Contains the default value that should be displayed by a control when moving to a new row.

The Properties of are readonly and can be used for information purposes:

Properties of
Name [readonly] string - The name of the column.
Type [readonly] long - The of the column.
TypeName [readonly] string - The type name used by the database. If the column type is a user-defined type, then a fully-qualified type name is returned. May be empty.
Precision [readonly] long - The number of decimal digits or chars.
Scale [readonly] long - Number of digits after the decimal point.
IsNullable [readonly] long, constants group Indicates if values may be NULL in the designated column. Possible values are:

NULLABLE: column allows NULL values.
NO_NULLS: column does not allow NULL values.
NULLABLE_UNKNOWN : it is unknown whether or not NULL is allowed

IsAutoIncrement [readonly] boolean - Indicates if the column is automatically numbered.
IsCurrency [readonly] boolean - Indicates if the column is a cash value.
IsRowVersion [readonly] boolean - Indicates whether the column contains a type of time or date stamp used to track updates.
Description [readonly] string - Keeps a description of the object.
DefaultValue [readonly] string - Keeps a default value for a column, and is provided as a string.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages