com.ibm.tivoli.maximo.integrity

Class DatabaseInformation



  • public class DatabaseInformation
    extends MaximoDatabaseInfo
    Store data about the database being checked.
    • Constructor Detail

      • DatabaseInformation

        public DatabaseInformation(java.sql.Connection con)
                            throws java.sql.SQLException
        Constructor
        Parameters:
        con - Connection to the database to store information about.
        Throws:
        java.sql.SQLException
    • Method Detail

      • getConnection

        public java.sql.Connection getConnection()
      • setSelectedTenants

        public void setSelectedTenants(java.util.Set tenants)
        Select tenants for testing.
        Parameters:
        tenants -
      • getSelectedTenants

        public java.util.Set getSelectedTenants()
                                         throws java.sql.SQLException
        Get the set of tenants selected.
        Returns:
        The set of tenants selected, or all tenants if none were selected. Null will be returned if MT is not enabled.
        Throws:
        java.sql.SQLException
      • isPreMerlin

        public boolean isPreMerlin()
                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getMTConnection

        public MTConnection getMTConnection()
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getConnection

        public java.sql.Connection getConnection(MTContext c)
                                          throws java.sql.SQLException
        Get the connection for the context.
        Parameters:
        c - Context to get.
        Returns:
        The connection for this context.
        Throws:
        java.sql.SQLException
      • getSelectedUsers

        public java.util.Set getSelectedUsers()
                                       throws java.sql.SQLException
        Returns the selected tenants, but returns all tenants, including the master, when no tenant is targeted.
        Returns:
        The user set.
        Throws:
        java.sql.SQLException
        See Also:
        This does not include the master context.
      • getSchema

        public java.lang.String getSchema()
      • setSchema

        public void setSchema(java.lang.String schema)
      • setSelectedTenant

        public void setSelectedTenant(java.lang.String targetTenant)
                               throws java.sql.SQLException
        Select a single tenant.
        Parameters:
        targetTenant -
        Throws:
        java.sql.SQLException
      • getSQLTransform

        public SQLSpecificTransform getSQLTransform()
                                             throws java.sql.SQLException
        Get the transform to use to convert for the database platform.
        Returns:
        The transform.
        Throws:
        java.sql.SQLException
      • getMaxUpgVersion

        public java.lang.String getMaxUpgVersion()
                                          throws java.sql.SQLException
        Gets the version number from the MaxUpg MaxVar.
        Returns:
        The version number, i.e. 7500
        Throws:
        java.sql.SQLException
      • setPendingChanges

        public void setPendingChanges(boolean hasPending)
        Set the "has pending changes" flag. Refers to the configuration changes made in the *CFG framework tables.
        Parameters:
        hasPending -
      • hasPendingChanges

        public boolean hasPendingChanges()
      • getIntegerLength

        public int getIntegerLength()
                             throws java.lang.NumberFormatException,
                                    java.sql.SQLException
        Returns the standard length of INTEGER attributes, for the MaxAttribute table.
        Throws:
        java.sql.SQLException
        java.lang.NumberFormatException
      • getSmallIntLength

        public int getSmallIntLength()
                              throws java.lang.NumberFormatException,
                                     java.sql.SQLException
        Returns the standard length of SMALLINT attributes, for the MaxAttribute table.
        Throws:
        java.sql.SQLException
        java.lang.NumberFormatException
      • getAmountLength

        public int getAmountLength()
                            throws java.lang.NumberFormatException,
                                   java.sql.SQLException
        Return the length for amount attributes.
        Throws:
        java.sql.SQLException
        java.lang.NumberFormatException
      • getAmountScale

        public int getAmountScale()
                           throws java.lang.NumberFormatException,
                                  java.sql.SQLException
        Return the scale for amount attributes.
        Throws:
        java.sql.SQLException
        java.lang.NumberFormatException
      • getVarCharMultiple

        public int getVarCharMultiple()
                               throws java.sql.SQLException
        Description copied from class: MaximoDatabaseInfo
        Returns the value of the VARCHARMULTIPLE MaxVar, or 1 if the MaxVar isn't found.
        Specified by:
        getVarCharMultiple in class MaximoDatabaseInfo
        Throws:
        java.sql.SQLException
      • getMTStorageType

        public MTStorageType getMTStorageType(java.lang.String tablename)
                                       throws java.sql.SQLException
        Return the storage type for a table.
        Parameters:
        tablename -
        Returns:
        The storagetype for the table, or null if the table wasn't found or MT is not enabled.
        Throws:
        java.sql.SQLException
      • isImportedTable

        public boolean isImportedTable(java.lang.String tableName)
                                throws java.sql.SQLException
        Returns whether a table is marked as being imported to Maximo.
        Parameters:
        tableName -
        Returns:
        true if the table was marked as imported
        Throws:
        java.sql.SQLException
      • getSynonymMaxValue

        public java.lang.String getSynonymMaxValue(java.lang.String synonym,
                                                   java.lang.String domainid)
                                            throws java.sql.SQLException
        Returns the MaxValue for the synonym value given.
        Parameters:
        synonym -
        domainid -
        Returns:
        The MaxValue for the synonym, or null if the synonym wasn't found.
        Throws:
        java.sql.SQLException
      • getDefaultSynonym

        public java.lang.String getDefaultSynonym(java.lang.String domainid,
                                                  java.lang.String maxvalue)
                                           throws java.sql.SQLException
        Returns the default external synonym value for an internal value.
        Parameters:
        domainid -
        maxvalue -
        Returns:
        The default external synonym, or null if not found.
        Throws:
        java.sql.SQLException
      • getBaseLangCode

        public java.lang.String getBaseLangCode()
                                         throws java.sql.SQLException
        Returns the code for base language of the Maximo database.
        Throws:
        java.sql.SQLException
      • hasExtension

        public boolean hasExtension(java.lang.String baseTable)
                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • resetHasExtension

        public void resetHasExtension()
      • getNavtiveViewList

        public java.util.List getNavtiveViewList()
                                          throws java.sql.SQLException
        Gets the list of views in the database. Uses the list from the DatabaseInformation object, if available. Otherwise this method will get this information and set it in the DI.
        Throws:
        java.sql.SQLException
        See Also:
        DatabaseInformation
      • getMaximoViewList

        public java.util.List getMaximoViewList()
                                         throws java.sql.SQLException
        Return a list of views in Maximo.
        Parameters:
        dc -
        Returns:
        Throws:
        java.sql.SQLException
      • getNickName

        public java.lang.String getNickName()
      • hasTable

        public boolean hasTable(java.lang.String tbname)
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • hasTableColumn

        public boolean hasTableColumn(java.lang.String objName,
                                      java.lang.String attrName)
                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getUtil

        public Util getUtil()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • maxVarSetup

        public void maxVarSetup(java.util.TreeMap maxVarMap)
      • getSequenceIncrement

        public int getSequenceIncrement()
                                 throws MXException,
                                        java.sql.SQLException
        Description copied from class: MaximoDatabaseInfo
        Returns the increment interval for sequences. Usually this value is 1. The MaxVar SEQUENCEINCREMENT can be set to change this.
        Specified by:
        getSequenceIncrement in class MaximoDatabaseInfo
        Returns:
        the interval value
        Throws:
        MXException
        java.sql.SQLException