Column Service

From Apache OpenOffice Wiki
Jump to: navigation, search

The Column object is the simplest object structure in the SDBCX layer. It is a collection of properties that define the Column object. The columns container exists for table, key, and index objects. The Column object is a different for these objects:


The Column object is defined by the following properties:

Properties of
Name string - The name of the column.
Type, long - The SDBC data type.
TypeName string - The database name for this type.
Precision long - The column's number of decimal digits.
Scale long - The column's number of digits to the left of the decimal point.
IsNullable long - Indicates the nullification of values in the designated column.
IsAutoIncrement boolean - Indicates if the column is automatically numbered.
IsCurrency boolean - Indicates if the column is a cash value.
IsRowVersion boolean - Indicates that the column contains some kind of time or date stamp used to track updates (optional).
Description string - Keeps a description of the object (optional).
DefaultValue string - Keeps a default value for a column (optional).

The Column object also supports the interface that creates a copy of this object.

 // column properties
 public static void printColumnProperties(Object column) throws,SQLException {
     System.out.println("Example printColumnProperties");
     XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,column);
     System.out.println("Name: " + xProp.getPropertyValue("Name"));
     System.out.println("Type: " + xProp.getPropertyValue("Type"));
     System.out.println("TypeName: " + xProp.getPropertyValue("TypeName"));
     System.out.println("Precision: " + xProp.getPropertyValue("Precision"));
     System.out.println("Scale: " + xProp.getPropertyValue("Scale"));
     System.out.println("IsNullable: " + xProp.getPropertyValue("IsNullable"));
     System.out.println("IsAutoIncrement: " + xProp.getPropertyValue("IsAutoIncrement"));
     System.out.println("IsCurrency: " + xProp.getPropertyValue("IsCurrency"));
     // the following property is optional so we first must check if it exists
     System.out.println("IsRowVersion: " + xProp.getPropertyValue("IsRowVersion"));
     System.out.println("Description: " + xProp.getPropertyValue("Description"));
     System.out.println("DefaultValue: " + xProp.getPropertyValue("DefaultValue"));
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages