//***************************************************************************
// (c) Copyright IBM Corp. 2007 All rights reserved.
//
// The following sample of source code ("Sample") is owned by International
// Business Machines Corporation or one of its subsidiaries ("IBM") and is
// copyrighted and licensed, not sold. You may use, copy, modify, and
// distribute the Sample in any form without payment to IBM, for the purpose of
// assisting you in the development of your applications.
//
// The Sample code is provided to you on an "AS IS" basis, without warranty of
// any kind. IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR
// IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Some jurisdictions do
// not allow for the exclusion or limitation of implied warranties, so the above
// limitations or exclusions may not apply to you. IBM shall not be liable for
// any damages you suffer as a result of using, copying, modifying or
// distributing the Sample, even if IBM has been advised of the possibility of
// such damages.
//***************************************************************************
//
// SOURCE FILE NAME: TbUMQT.sqlj
//
// SAMPLE: How to use user materialized query tables (summary tables).
//
// This sample:
// 1. Query Table (UMQT) for the 'employee' table.
// 2. Shows the usage and update mechanisms for non-partitioned UMQTs.
// 3. Creates a new partitioned Maintained Materialized
// Query Table (MQT).
// 4. Shows the availability of partitioned MQTs during SET INTEGRITY
// after add/detach of a partition via ALTER ADD PARTITION and
// ALTER DETACH PARTITION.
//
// SQL Statements USED:
// ALTER TABLE
// CREATE TABLE
// EXECUTE IMMEDIATE
// DROP
// INSERT
// SELECT
// SET CURRENT
// SET INTEGRITY
// REFRESH TABLE
//
// JAVA 2 CLASSES USED:
// Statement
// ResultSet
//
// Classes used from Util.java are:
// Db
// Data
// sqljException
//
//
// Output will vary depending on the JDBC driver connectivity used.
//***************************************************************************
//
// For more information on the sample programs, see the README file.
//
// For information on developing Java applications see the Developing Java Applications book.
//
// For information on using SQL statements, see the SQL Reference.
//
// For the latest information on programming, compiling, and running DB2
// applications, visit the DB2 Information Center at
// http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp
//**************************************************************************
import java.lang.*;
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
// declare an iterator for result of the select command
#sql iterator TbUMQT_Cursor1(int);
#sql iterator TbUMQT_Cursor2(int, int);
class TbUMQT
{
public static void main(String argv[])
{
DefaultContext ctx = null;
try
{
Db db = new Db(argv);
System.out.println(
"\nTHIS SAMPLE SHOWS THE USAGE OF USER MAINTAINED MATERIALIZED.\n" +
" QUERY TABLES(MQTs).\n");
// connect to the 'sample' database
ctx = db.getDefaultContext();
// create summary tables
createMQT();
// bring the summary tables out of check-pending state
setIntegrity();
// populate the base table and update contents of the summary tables
updateUserMQT();
// set registers to optimize query processing by routing queries to
// UMQT
setRegisters();
// issue a select statement that is routed to the summary tables
showTableContents( ctx.getConnection() );
// drop summary tables
dropTables();
// creates regular DMS tablespaces
dmsTspaceaceCreate();
// creates a partitioned table
partitionedTbCreate();
// create MQT on a paartitioned table
createMQT_on_Partitionedtb();
// create partitione MQT on a partitioned table
createPartitioned_MQT();
// drop tablespaces
tablespacesDrop();
// disconnect from the 'sample' database
db.disconnect();
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // main
// Create summary tables.
static void createMQT()
{
Statement stmt;
System.out.println(
"\n----------------------------------------------------------\n" +
"Creating UMQT on EMPLOYEE table...\n");
try
{
System.out.println(
"USE THE SQL STATEMENT:\n" +
" CREATE SUMMARY TABLE \n" +
"To create a UMQT with deferred refresh\n\n" +
"Execute the statement:\n" +
"CREATE SUMMARY TABLE umqt_employee AS \n" +
" (SELECT workdept, count(*) AS no_of_employees \n" +
" FROM employee GROUP BY workdept)\n" +
" DATA INITIALLY DEFERRED REFRESH DEFERRED\n" +
" MAINTAINED BY USER\n");
#sql {CREATE SUMMARY TABLE umqt_employee AS
(SELECT workdept, count(*) AS no_of_employees
FROM employee GROUP BY workdept)
DATA INITIALLY DEFERRED REFRESH DEFERRED
MAINTAINED BY USER};
// commit the transaction
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
// creating a UMQT with immediate refresh option is not supported
try
{
System.out.println(
"\nCREATE SUMMARY TABLE to create a UMQT with immediate\n" +
"refresh option is not supported\n\n" +
"Execute the statement:\n" +
"CREATE SUMMARY TABLE aimdusr AS \n" +
" (SELECT workdept, count(*) AS no_of_employees \n" +
" FROM employee GROUP BY workdept)\n" +
" DATA INITIALLY DEFERRED REFRESH IMMEDIATE\n" +
" MAINTAINED BY USER\n");
#sql {CREATE SUMMARY TABLE aimdusr AS
(SELECT workdept, count(*) AS no_of_employees
FROM employee GROUP BY workdept)
DATA INITIALLY DEFERRED REFRESH IMMEDIATE
MAINTAINED BY USER};
// commit the transaction
System.out.println("\n COMMIT");
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handleExpectedErr();
}
} // createMQT
// Bring the summary tables out of check-pending state.
static void setIntegrity()
{
System.out.println(
"\n-----------------------------------------------------------");
System.out.println(
"USE THE SQL STATEMENT:\n" +
" SET INTEGRITY \n" +
"To bring the MQTs out of check pending state\n");
try
{
System.out.println(
"Execute the statement:\n" +
"SET INTEGRITY FOR umqt_employee ALL IMMEDIATE UNCHECKED");
#sql {SET INTEGRITY FOR umqt_employee ALL IMMEDIATE UNCHECKED};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // setIntegrity
// Populate the base table and update the contents of the summary tables.
static void updateUserMQT()
{
System.out.println(
"\n-----------------------------------------------------------\n" +
"\nUMQT_EMPLOYEE must be updated manually by the user\n\n" +
"USE THE SQL STATEMENT:\n" +
" INSERT\n" +
"To update the UMQT\n ");
try
{
System.out.println(
"Execute the statement:" +
"\nINSERT INTO umqt_employee \n" +
" (SELECT workdept, count(*) AS no_of_employees\n" +
" FROM employee GROUP BY workdept)");
#sql {
INSERT INTO umqt_employee
(SELECT workdept, count(*) AS no_of_employees
FROM employee GROUP BY workdept)};
// commit the transaction
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // updateUserMQT
// Set registers to optimize query processing by routing queries to UMQT.
static void setRegisters()
{
// the CURRENT REFRESH AGE special register must be set to a value other
// than zero for the specified table types to be considered when
// optimizing the processing of dynamic SQL queries.
System.out.println(
"\n-----------------------------------------------------------\n" +
"The following registers must be set to route queries to UMQT");
try
{
System.out.println(
"\n SET CURRENT REFRESH AGE ANY\n" +
"\nIndicates that any table types specified by CURRENT MAINTAINED" +
"\nTABLE TYPES FOR OPTIMIZATION, and MQTs defined with REFRESH \n" +
"IMMEDIATE option, can be used to optimize the \n" +
"processing of a query. \n\n");
#sql {SET CURRENT REFRESH AGE ANY};
System.out.println(
" SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION USER \n\n" +
"Specifies that user-maintained refresh-deferred materialized \n" +
"query tables can be considered to optimize the processing of \n" +
"dynamic SQL queries. ");
#sql {SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION USER};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // setRegisters
// Issue a select statement that is routed to the summary tables.
static void showTableContents(Connection con)
{
String workDept = null;
int countWorkDept = 0;
System.out.println(
"\n-----------------------------------------------------------\n" +
"USE THE SQL STATEMENT:\n" +
" SELECT\n" +
"On EMPLOYEE table. This is routed to the UMQT umqt_employee\n");
try
{
Statement stmt = con.createStatement();
ResultSet rs;
System.out.println(
"Execute the statement:\n" +
"SELECT workdept, count(*) AS no_of_employees \n" +
" FROM employee GROUP BY workdept\n");
System.out.println(
" DEPT CODE NO. OF EMPLOYEES \n" +
" ---------- ----------------");
// perform a SELECT against the "employee" table in the sample database
rs = stmt.executeQuery(
"SELECT workdept, count(*) AS no_of_employees " +
"FROM employee GROUP BY workdept");
// retrieve and display the result from the SELECT statement
while (rs.next())
{
workDept = rs.getString("workdept");
countWorkDept = rs.getInt("no_of_employees");
System.out.println(
" " +
Data.format(workDept, 7) + " " +
Data.format(countWorkDept, 10));
}
rs.close();
System.out.println(
"\nA SELECT query on umqt_employee yields similar results\n\n" +
" SELECT * FROM umqt_employee \n");
System.out.println(
" DEPT CODE NO. OF EMPLOYEES \n" +
" ---------- ----------------\n");
// perform a SELECT against umqt_employee query table
rs = stmt.executeQuery(" SELECT * FROM umqt_employee");
// retrieve and display the result from the SELECT statement
while (rs.next())
{
workDept = rs.getString("workdept");
countWorkDept = rs.getInt("no_of_employees");
System.out.println(
" " +
Data.format(workDept, 7) + " " +
Data.format(countWorkDept, 10));
}
rs.close();
stmt.close();
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // showTableContents
// drop tables.
static void dropTables()
{
System.out.println(
"\nDropping tables...\n\n" +
"USE THE SQL STATEMENT:\n" +
" DROP\n" +
"To drop the UMQT umqt_employee\n");
try
{
System.out.println(
"Execute the statement:\n" +
" DROP TABLE umqt_employee");
#sql {DROP TABLE umqt_employee};
// commit the transaction
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // dropTables
// creates regular DMS tablespaces.
static void dmsTspaceaceCreate() throws SQLException
{
try
{
System.out.println(
"\n-----------------------------------------------------------" +
"\nUSE THE SQL STATEMENT:\n" +
" CREATE REGULAR TABLESPACE \n" +
"TO CREATE A REGULAR DMS TABLESPACES \n" +
"\nExecute the statement:\n" +
" CREATE REGULAR TABLESPACE tspace\n" +
" MANAGED BY DATABASE \n" +
" USING (FILE 'tspace_cont.dat' 1000)");
// create regular DMS table space tspace
#sql {CREATE REGULAR TABLESPACE tspace
MANAGED BY DATABASE USING (FILE 'tspace_cont.dat' 10000)};
System.out.println(
"\nExecute the statement:\n" +
" CREATE REGULAR TABLESPACE tspace1\n" +
" MANAGED BY DATABASE \n" +
" USING (FILE 'tspace1_cont1.dat' 1000)");
// create regular DMS table space tspace1
#sql {CREATE REGULAR TABLESPACE tspace1
MANAGED BY DATABASE USING (FILE 'tspace1_cont1.dat' 10000)};
System.out.println(
"\nExecute the statement:\n" +
" CREATE REGULAR TABLESPACE tspace2\n" +
" MANAGED BY DATABASE \n" +
" USING (FILE 'tspace2_cont2.dat' 1000)");
// create regular DMS table space tspace2
#sql {CREATE REGULAR TABLESPACE tspace2
MANAGED BY DATABASE USING (FILE 'tspace2_cont2.dat' 10000)};
System.out.println(
"\nExecute the statement:\n" +
" CREATE REGULAR TABLESPACE tspace3\n" +
" MANAGED BY DATABASE \n" +
" USING (FILE 'tspace3_cont3.dat' 1000)");
// create regular DMS table space tspace3
#sql {CREATE REGULAR TABLESPACE tspace3
MANAGED BY DATABASE USING (FILE 'tspace3_cont3.dat' 10000)};
System.out.println(
"\n-----------------------------------------------------------");
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // dmsTspaceaceCreate
// create a partitioned table in regular DMS tablespaces i.e; 'part1' is
// placed in 'tspace1', 'part2' is placed in 'tspace2' and
// 'part3' in 'tspace3' and inserts data into it.
static void partitionedTbCreate() throws SQLException
{
try
{
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" CREATE TABLE \n" +
"TO CREATE A TABLE \n" +
"\nExecute the statement:\n" +
" CREATE TABLE fact_table (max SMALLINT NOT NULL,\n" +
" CONSTRAINT CC CHECK (max>0))\n" +
" PARTITION BY RANGE (max)\n "+
" (PART part1 STARTING FROM (1) ENDING (3) IN tspace1,\n" +
" PART part2 STARTING FROM (4) ENDING (6) IN tspace2,\n" +
" PART part3 STARTING FROM (7) ENDING (9) IN tspace3)");
#sql {CREATE TABLE fact_table
(max SMALLINT NOT NULL, CONSTRAINT CC CHECK (max>0))
PARTITION BY RANGE (max)
(PART part1 STARTING FROM (1) ENDING (3) IN tspace1,
PART part2 STARTING FROM (4) ENDING (6) IN tspace2,
PART part3 STARTING FROM (7) ENDING (9) IN tspace3)};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
try
{
System.out.println(
"\n-----------------------------------------------------------" +
"\nUSE THE SQL STATEMENT:\n" +
" INSERT INTO \n" +
"TO INSERT DATA IN A TABLE \n" +
"\nExecute the statement:\n" +
" INSERT INTO fact_table VALUES (1), (2), (3),\n" +
" (4), (5), (6),\n" +
" (7), (8), (9)");
// insert data into the table
#sql {INSERT INTO fact_table VALUES (1), (2), (3), (4),
(5), (6), (7), (8), (9)};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // partitionedTbCreate
// creates MQT on a partitioned table. Performs SET INTEGRITY on MQT to
// bring MQT out of check pending state and to get changes reflected.
static void createMQT_on_Partitionedtb() throws SQLException
{
try
{
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" CREATE TABLE \n" +
"TO CREATE A TABLE \n" +
"\nExecute the statement:\n" +
" CREATE TABLE mqt_fact_table AS\n" +
" (SELECT max, COUNT (*) AS no_of_rows FROM fact_table)\n" +
" GROUP BY max) DATA INITIALLY DEFERRED REFRESH IMMEDIATE");
#sql {CREATE TABLE mqt_fact_table AS
(SELECT max, COUNT (*) AS no_of_rows FROM fact_table GROUP BY max)
DATA INITIALLY DEFERRED REFRESH IMMEDIATE};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
try
{
System.out.println(
"\nUSE THE SQL STATEMENT:" +
"\n SET INTEGRITY " +
"\nTO PERFORM SET INTEGRITY ON A TABLE\n" +
"\nExecute the statement:" +
"\n SET INTEGRITY FOR mqt_fact_table IMMEDIATE CHECKED");
#sql {SET INTEGRITY FOR mqt_fact_table IMMEDIATE CHECKED};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
// display the contents of a table.
displaytbData();
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" DROP\n" +
"TO DROP A TABLE.\n" +
"\nExecute the statements:" +
"\n DROP TABLE mqt_fact_table" +
"\n DROP TABLE fact_table");
#sql {DROP TABLE mqt_fact_table};
#sql {COMMIT};
#sql {DROP TABLE fact_table};
#sql {COMMIT};
} // createMQT_on_Partitionedtb
// creates a partitioned MQT on a partitioned table whose range is less
// then that of the base table. Partition is added to MQT and
// REFRESH TABLE is performed on MQT to bring MQT out of check pending
// state and to get changes reflected to MQT.
static void createPartitioned_MQT() throws SQLException
{
// creates a partitioned table
partitionedTbCreate();
try
{
System.out.println(
"\n-----------------------------------------------------------" +
"\nUSE THE SQL STATEMENT:\n" +
" CREATE\n" +
"TO CREATE A PARTITIONED MQT ON A PARTITIONED TABLE .\n" +
"\nExecute the statement:" +
"\n CREATE TABLE mqt_fact_table AS" +
"\n (SELECT max, COUNT (*) AS no_of_rows FROM fact_table GROUP BY max)" +
"\n DATA INITIALLY DEFERRED REFRESH IMMEDIATE\n" +
" PARTITION BY RANGE (max)\n" +
" (STARTING 0 ENDING 6 EVERY 3)\n");
#sql {CREATE TABLE mqt_fact_table AS
(SELECT max, COUNT (*) AS no_of_rows FROM fact_table GROUP BY max)
DATA INITIALLY DEFERRED REFRESH IMMEDIATE
PARTITION BY RANGE (max)
(STARTING 0 ENDING 6 EVERY 3)};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
try
{
System.out.println(
"\n-----------------------------------------------------------" +
"\nUSE THE SQL STATEMENT:\n" +
" ALTER TABLE \n" +
"TO ADD PARTITION TO MQT\n" +
"\nExecute the statement:" +
"\n ALTER TABLE mqt_fact_table ADD PARTITION part4 STARTING (7) ENDING (9)");
#sql {ALTER TABLE mqt_fact_table ADD PARTITION part4
STARTING (7) ENDING (9)};
#sql {COMMIT};
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" REFRESH\n" +
"TO REFRESH TABLE\n" +
"\nExecute the statement:" +
"\n REFRESH TABLE mqt_fact_table");
#sql {REFRESH TABLE mqt_fact_table};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
// display the contents of a table.
displaytbData();
// detach partition from a table.
detach_Partitiontb();
} // createPartitioned_MQT
// detach a partition from 'fact_table'.
// SET INTEGRITY is performed on MQT to bring it out of
// check pending state. Later, a partition is detached form
// 'mqt_fact_table'. REFRESH TABLE is performed on MQT to bring it out of
// check pending state and to get changes reflected into MQT.
static void detach_Partitiontb() throws SQLException
{
try
{
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" ALTER TABLE \n" +
"TO DETACH A PARTITION FROM A TABLE\n" +
"\nExecute the statement\n" +
" ALTER TABLE fact_table DETACH PARTITION part2 INTO TABLE detach_part1");
#sql {ALTER TABLE fact_table DETACH PARTITION part2 INTO TABLE detach_part1};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
System.out.println(
"\nUSE THE SQL STATEMENT:" +
"\n SET INTEGRITY \n" +
"TO BRING THE MQTs OUT OF CHECK PENDING STATE\n" +
"\nExecute the statement:" +
"\n SET INTEGRITY FOR mqt_fact_table IMMEDIATE CHECKED");
#sql {SET INTEGRITY FOR mqt_fact_table IMMEDIATE CHECKED};
#sql {COMMIT};
System.out.println(
"\nExecute the statement:\n" +
" ALTER TABLE mqt_fact_table DETACH PARTITION part2 INTO TABLE detach_part2");
#sql {ALTER TABLE mqt_fact_table DETACH PARTITION part2 INTO TABLE detach_part2};
#sql {COMMIT};
System.out.println(
"\nUSE THE SQL STATEMENT:" +
"\n REFRESH\n" +
"TO GET CHANGES REFLECTED\n" +
"\nExecute the statement:" +
"\n REFRESH TABLE mqt_fact_table");
#sql {REFRESH TABLE mqt_fact_table};
#sql {COMMIT};
// display the contents of a table.
displaytbData();
} // detach_Partitiontb
// display the contents of a table.
static void displaytbData() throws SQLException
{
System.out.println(
"\n-----------------------------------------------------------");
try
{
int max = 0;
TbUMQT_Cursor1 cur1;
System.out.println();
System.out.println("SELECT * FROM fact_table");
System.out.println(
" MAX\n" +
" ------");
#sql cur1 = {SELECT * FROM fact_table};
while (true)
{
#sql {FETCH :cur1 INTO :max};
if (cur1.endFetch())
{
break;
}
System.out.print(" " + Data.format(max, 3));
System.out.println();
}
// close the cursor
cur1.close();
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
try
{
int max = 0;
int no_of_rows = 0;
TbUMQT_Cursor2 cur2;
System.out.println();
System.out.println("SELECT * FROM mqt_fact_table");
System.out.println(
" MAX NO_OF_ROWS \n" +
" ------ -----------");
#sql cur2 = {SELECT * FROM mqt_fact_table};
while (true)
{
#sql {FETCH :cur2 INTO :max, :no_of_rows};
if (cur2.endFetch())
{
break;
}
System.out.print(" " + Data.format(max, 3)+
" " + Data.format(no_of_rows, 5));
System.out.println();
}
// close the cursor
cur2.close();
System.out.println(
"\n-----------------------------------------------------------");
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // displaytbData
// drop tables.
static void cleanup() throws SQLException
{
try
{
System.out.println(
"\nUSE THE SQL STATEMENT:\n" +
" DROP \n" +
"TO DROP THE TABLES \n" +
"\nExecute the statements:\n" +
" DROP TABLE fact_table\n" +
" DROP TABLE mqt_fact_table\n" +
" DROP TABLE detach_part1\n" +
" DROP TABLE detach_part2");
// drop the tables
#sql {DROP TABLE mqt_fact_table};
#sql {DROP TABLE fact_table};
#sql {DROP TABLE detach_part1};
#sql {DROP TABLE detach_part2};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // cleanup
// drop tablespaces.
static void tablespacesDrop() throws SQLException
{
// drop tables.
cleanup();
try
{
System.out.println(
"\n-----------------------------------------------------------" +
"\nUSE THE SQL STATEMENT:\n" +
" DROP \n" +
"TO DROP THE TABLESPACES \n" +
"\nExecute the statements:\n" +
" DROP TABLESPACE tspace\n" +
" DROP TABLESPACE tspace1\n" +
" DROP TABLESPACE tspace2\n" +
" DROP TABLESPACE tspace3");
// drop the tablespaces
#sql {DROP TABLESPACE tspace};
#sql {DROP TABLESPACE tspace1};
#sql {DROP TABLESPACE tspace2};
#sql {DROP TABLESPACE tspace3};
#sql {COMMIT};
}
catch (Exception e)
{
SqljException sqljExc = new SqljException(e);
sqljExc.handle();
}
} // tablespacesDrop
} // TbUMQT