Class Db2CatalogDAO


  • public class Db2CatalogDAO
    extends Object
    Access to the DB2 catalog tables
    • Method Detail

      • getPartitionList

        public List<PartitionInfo> getPartitionList​(Connection c,
                                                    String schema,
                                                    String tableName)
                                             throws SQLException
        Get the list of partitions. Take special note of the low and high values, because they include string markers e.g. PNAME SEQNO LOWINCLUSIVE LOWVALUE HIGHINCLUSIVE HIGHVALUE ---------------- ----------- ------------ -------------------------------- ------------- -------------------------------- PART0 0 Y '2017-01-01-00.00.00.000000' N '2017-02-01-00.00.00.000000' PART1 1 Y '2017-02-01-00.00.00.000000' N '2017-03-01-00.00.00.000000' PART2 2 Y '2017-03-01-00.00.00.000000' N '2017-04-01-00.00.00.000000'
        Parameters:
        c -
        tableName -
        Returns:
        Throws:
        SQLException
      • unwrap

        public static String unwrap​(String value)
        The high/low values look like this: '2017-01-01-00.00.00.000000'. We want this: 2017-01-01
        Parameters:
        value -
        Returns:
      • detachPartition

        public void detachPartition​(Connection c,
                                    String schema,
                                    String table,
                                    String partitionName)
                             throws SQLException
        Drop the named partition from the table. Obtains a table (exclusive) lock before proceeding
        Parameters:
        c -
        schema -
        table -
        partitionName -
        Throws:
        SQLException
      • getDetachedTableList

        public List<String> getDetachedTableList​(Connection connection,
                                                 String schema,
                                                 String table)
                                          throws SQLException
        Get a list of all the table names which come from the detach partition operation
        Parameters:
        connection -
        schema -
        table -
        Returns:
        Throws:
        SQLException
      • dropTable

        public void dropTable​(Connection connection,
                              String schemaTable)
                       throws SQLException
        Drop the named table
        Parameters:
        connection -
        schemaTable - the schema qualified table name
        Throws:
        SQLException