JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
1. At the OSS prompt, invoke the SQL/MX utility MXCI. Type:
MXCI
2. Type the following command to enable creating tables that have LOB columns:
CONTROL QUERY DEFAULT JDBC_PROCESS 'TRUE'
3. Type the CREATE TABLE statement; for example, you might use the following simple form of
the statement:
CREATE TABLE table1 (c1 INTEGER NOT NULL, c2 CLOB, c3 BLOB, PRIMARY KEY(c1))
where;
table1
The name of the base table.
c1
Column 1, defined as the INTEGER data type with the NOT NULL constraint.
c2
Column 2, defined as the CLOB data type.
c3
Column 3, defined as the BLOB data type.
PRIMARY KEY
Specifies c1 as the primary key.
Use this example as the archetype for creating base tables. For information about valid names for
tables (table1) and columns (c1, c2, and c3) and for information about the CREATE TABLE
statement, see the SQL/MX Reference Manual.
Using JDBC Programs To Create Base Tables that Have LOB Columns
When using a JDBC Program to create base tables that have LOB columns, simply put the CREATE
TABLE statements in the program as you would any other SQL statement. For an example of the
CREATE TABLE statement, see the preceding discussion “Using MXCI To Create Base Tables that
Have LOB Columns” (page 54).
Managing LOB Data by Using the JDBC/MX Lob Admin Utility
The JDBC/MX driver provides the JDBC/MX Lob Admin Utility that you can use for these tasks:
• Creating the LOB table (a table that holds LOB data).
• Creating the SQL/MX triggers for the LOB columns in the base tables to ensure that orphan
LOB data does not occur in a LOB table.
Information about using the JDBC/MX Lob Admin Utility is provided in these topics.
• “Running the JDBC/MX Lob Admin Utility” (page 55)
• “Help Listing from the JDBC/MX Lob Admin Utility” (page 56)
• “Using SQL/MX Triggers to Delete LOB Data” (page 57)
Running the JDBC/MX Lob Admin Utility
Using the following format in the OSS environment, run the JDBC/MX Lob Admin utility:
java [<java_options>] JdbcMxLobAdmin [<program_options>] [<table_name>]
Managing LOB Data by Using the JDBC/MX Lob Admin Utility 55










