com.ibm.tivoli.maximo.dbmanage

Class DatabaseType

  • java.lang.Object
    • com.ibm.tivoli.maximo.dbmanage.DatabaseType


  • public class DatabaseType
    extends java.lang.Object
    This utility class shares the database type information for Maximo types.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DatabaseType() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String getDatabaseType(java.lang.String maxtype, java.lang.Integer length, java.lang.Integer scale, MaximoDatabaseInfo mdi)
      Give the native database definition for the given maxtype & parameters.
      static java.lang.String getDatabaseType(java.lang.String maxtype, java.lang.Integer length, java.lang.Integer scale, MaximoDatabaseInfo mdi, boolean typeOnly)
      Give the native database definition for the given maxtype & parameters.
      static java.lang.String getDatabaseTypeOnly(java.lang.String maxType, java.lang.Integer length, MaximoDatabaseInfo mdi)
      Returns just the native database type, without length or scale parameter.
      static java.lang.String getDatabaseTypeOnly(java.lang.String maxType, java.lang.String lengthStr, MaximoDatabaseInfo mdi)
      Return the native database type.
      static AttributeStorage getMaxDef(DatabaseInformation di, java.lang.String dbType, java.lang.Integer dbLength, java.lang.Integer dbScale)
      Given a database definition, create a Maximo definition
      static int getVarCharColumnLength(int length, MaximoDatabaseInfo mdi)
      Returns the length to create a field with, considering the VarCharMultiple.
      static boolean needLength(java.lang.String maxtype)
      Does the MaxType require a length value?
      static boolean needScale(java.lang.String maxtype)
      Does the MaxType require a scale value?
      static boolean varCharMultipleAffected(java.lang.String maxType)
      Is this database type one of the kinds that is affected by the MaxVar VARCHARMULTIPLE setting?
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STRINGTYPES

        public static final java.util.Set STRINGTYPES
      • DATETIMETYPES

        public static final java.util.Set DATETIMETYPES
      • INTEGERTYPES

        public static final java.util.Set INTEGERTYPES
      • DECIMALTYPES

        public static final java.util.Set DECIMALTYPES
      • FLOATTYPES

        public static final java.util.Set FLOATTYPES
      • CRYPTOTYPES

        public static final java.util.Set CRYPTOTYPES
      • TAKESLENGTH

        public static final java.util.Set TAKESLENGTH
    • Constructor Detail

      • DatabaseType

        public DatabaseType()
    • Method Detail

      • getDatabaseTypeOnly

        public static java.lang.String getDatabaseTypeOnly(java.lang.String maxType,
                                                           java.lang.String lengthStr,
                                                           MaximoDatabaseInfo mdi)
                                                    throws java.lang.Exception
        Return the native database type.
        Parameters:
        maxType - ALN, YORN, etc..
        length - Needed in some case.
        server - Type of Database Server
        Returns:
        Throws:
        MXException
        java.lang.Exception
      • getDatabaseTypeOnly

        public static java.lang.String getDatabaseTypeOnly(java.lang.String maxType,
                                                           java.lang.Integer length,
                                                           MaximoDatabaseInfo mdi)
                                                    throws java.lang.Exception
        Returns just the native database type, without length or scale parameter.
        Parameters:
        maxtype - ALN, UPPER, YORN, etc...
        length - Length of the field, ignored for types that don't take a length, i.e. YORNs.
        mdi - Object that gives information about the database.
        Returns:
        Just the native database type, without length or scale parameter.
        Throws:
        MXException
        java.lang.Exception
      • getDatabaseType

        public static java.lang.String getDatabaseType(java.lang.String maxtype,
                                                       java.lang.Integer length,
                                                       java.lang.Integer scale,
                                                       MaximoDatabaseInfo mdi)
                                                throws java.sql.SQLException
        Give the native database definition for the given maxtype & parameters.
        Parameters:
        maxtype - ALN, UPPER, YORN, etc...
        length - Length of the field, ignored for types that don't take a length, i.e. YORNs.
        scale - Scale for types that take a scale.
        mdi - Object that gives information about the database.
        Returns:
        The string of the native database type.
        Throws:
        MXException
        java.sql.SQLException
      • getDatabaseType

        public static java.lang.String getDatabaseType(java.lang.String maxtype,
                                                       java.lang.Integer length,
                                                       java.lang.Integer scale,
                                                       MaximoDatabaseInfo mdi,
                                                       boolean typeOnly)
                                                throws java.sql.SQLException
        Give the native database definition for the given maxtype & parameters.
        Parameters:
        maxtype - ALN, UPPER, YORN, etc...
        length - Length of the field, ignored for types that don't take a length, i.e. YORNs.
        scale - Scale for types that take a scale.
        mdi - Object that gives information about the database.
        typeOnly - If true, the length & scale will be left off the returned string, only giving the native database type.
        Returns:
        The string of the native database type.
        Throws:
        MXException
        java.sql.SQLException
      • getVarCharColumnLength

        public static int getVarCharColumnLength(int length,
                                                 MaximoDatabaseInfo mdi)
                                          throws java.sql.SQLException
        Returns the length to create a field with, considering the VarCharMultiple.
        Throws:
        java.sql.SQLException
      • needScale

        public static boolean needScale(java.lang.String maxtype)
        Does the MaxType require a scale value?
        Parameters:
        maxtype -
        Returns:
        true if the type takes a scale value.
      • needLength

        public static boolean needLength(java.lang.String maxtype)
        Does the MaxType require a length value?
        Parameters:
        maxtype -
        Returns:
        true if the type takes a length value.
      • varCharMultipleAffected

        public static boolean varCharMultipleAffected(java.lang.String maxType)
        Is this database type one of the kinds that is affected by the MaxVar VARCHARMULTIPLE setting?
        Parameters:
        dbType - The database type.
        Returns:
        true if the database type can be affected by Maximo's VARCHARMULTIPLE setting
      • getMaxDef

        public static AttributeStorage getMaxDef(DatabaseInformation di,
                                                 java.lang.String dbType,
                                                 java.lang.Integer dbLength,
                                                 java.lang.Integer dbScale)
                                          throws java.sql.SQLException
        Given a database definition, create a Maximo definition
        Parameters:
        dbType -
        dbLength -
        dbScale -
        Returns:
        An AttributeStorage with maxtype, length, & scale values set to match the database definition.
        Throws:
        java.sql.SQLException