IBM DB2 Manual page 88

Table of Contents

Advertisement

}
Example: Removal of an XML schema: The following example demonstrates the use of
deregisterDB2XmlObject to remove an XML schema from DB2. The SQL schema
name for the registered schema is SYSXSR.
Figure 23. Example of removal of an XML schema from DB2
public static void deregisterSchema(
}
Example: Update of an XML schema: The following example demonstrates the use of
updateDB2XmlSchema to update the contents of an XML schema with the contents
of another XML schema. The schema that is copied is kept in the repository. The
SQL schema name for both registered schemas is SYSXSR.
Figure 24. Example of updating an XML schema
public static void updateSchema(
72
Application Programming Guide and Reference for Java
try {
xmlSchemaDocumentsLengths[0] = (int) fi.getChannel().size();
System.out.println(xmlSchemaDocumentsLengths[0]);
} catch (IOException e1) {
e1.printStackTrace();
}
xmlSchemaDocumentsProperties[0] = null;
xmlSchemaDocumentsPropertiesLengths[0] = 0;
xmlSchemaProperties = null;
xmlSchemaPropertiesLength = 0;
DB2Connection ds = (DB2Connection) con;
// Invoke registerDB2XmlSchema
ds.registerDB2XmlSchema(
xmlSchemaNameQualifiers,
xmlSchemaNames,
xmlSchemaLocations,
xmlSchemaDocuments,
xmlSchemaDocumentsLengths,
xmlSchemaDocumentsProperties,
xmlSchemaDocumentsPropertiesLengths,
xmlSchemaProperties,
xmlSchemaPropertiesLength,
false);
Connection con,
String schemaName)
throws SQLException {
// Define and assign values to the deregisterDB2XmlObject parameters
String xmlSchemaNameQualifier = "SYSXSR";
String xmlSchemaName = schemaName;
DB2Connection ds = (DB2Connection) con;
// Invoke deregisterDB2XmlObject
ds.deregisterDB2XmlObject(
xmlSchemaNameQualifier,
xmlSchemaName);
Connection con,
String schemaNameTarget,
String schemaNameSource)
throws SQLException {
// Define and assign values to the updateDB2XmlSchema parameters
String xmlSchemaNameQualifierTarget = "SYSXSR";
String xmlSchemaNameQualifierSource = "SYSXSR";
String xmlSchemaNameTarget = schemaNameTarget;
String xmlSchemaNameSource = schemaNameSource;
boolean dropSourceSchema = false;

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents