Class AbstractDBInfo

    • Field Detail

      • cartEnvironment

        protected final java.lang.String cartEnvironment
    • Constructor Detail

      • AbstractDBInfo

        public AbstractDBInfo​(DBType dbType,
                              java.lang.String dbIdentifierQuoteString,
                              java.lang.String cartOwner,
                              java.lang.String cartEnv)
      • AbstractDBInfo

        public AbstractDBInfo​(DBType dbType,
                              java.lang.String dbIdentifierQuoteString)
    • Method Detail

      • registerJdbcType

        protected static void registerJdbcType​(int jdbcType,
                                               java.lang.String sqlType)
      • getDBIdentifierQuoteString

        public java.lang.String getDBIdentifierQuoteString()
        Description copied from interface: DBDatabaseInfo
        Get the identifier needed to quote identifiers (e..g column names) for this DB.
        Specified by:
        getDBIdentifierQuoteString in interface DBDatabaseInfo
      • supportsOperation

        public boolean supportsOperation​(DBDatabaseInfo.DatabaseOperation op)
        Is this operation supported by the database. To mark an operation as not supported subclasses should add it to the unsupportedDatabaseOperations Set;
        Specified by:
        supportsOperation in interface DBDatabaseInfo
        Returns:
        True.
      • getMaxTableNameLength

        public int getMaxTableNameLength()
        Description copied from interface: DBDatabaseInfo
        Retrieves the maximum number of characters this database allows in a table name.
        Specified by:
        getMaxTableNameLength in interface DBDatabaseInfo
      • getMaxColumnNameLength

        public int getMaxColumnNameLength()
        Description copied from interface: DBDatabaseInfo
        Retrieves the maximum number of characters this database allows for a column name.
        Specified by:
        getMaxColumnNameLength in interface DBDatabaseInfo
      • getMaxIndexNameLength

        public int getMaxIndexNameLength()
        Description copied from interface: DBDatabaseInfo
        Retrieves the maximum number of characters this database allows for a index name.
        Specified by:
        getMaxIndexNameLength in interface DBDatabaseInfo
      • getCartridgeOwner

        public java.lang.String getCartridgeOwner()
        Description copied from interface: DBDatabaseInfo
        Get the user who owns the cartridge functions, or null if the DB does not support the JChem cartridge or the cartridge is not installed.
        Specified by:
        getCartridgeOwner in interface DBDatabaseInfo
        Returns:
        The owner
      • getJChemCartServerJChemVersion

        public java.lang.String getJChemCartServerJChemVersion()
        Get the JChem version number used by the cartridge. e.g. 5.1.1. If the cart is not present then null will be returned.
        Specified by:
        getJChemCartServerJChemVersion in interface DBDatabaseInfo
        Returns:
        The JChem version
      • getJChemCartServerJChemTableVersion

        public java.lang.String getJChemCartServerJChemTableVersion()
        Get the index version number used by the cartridge. This is the same as the JChem table version. e.g. 50102 This is only available since JChem 5.1.2. If prior to this, or the cart is not present then null is returned. Note that this is related to the JChem version but the table version is not increased with every JChem version, so it may lag a version or two behind.
        Specified by:
        getJChemCartServerJChemTableVersion in interface DBDatabaseInfo
        Returns:
        The cartridge JChem table version
      • isCartridgeJChemVersionCurrent

        public java.lang.Integer isCartridgeJChemVersionCurrent()
        Compare the JChem version to the JChem cartridge to the one used by the JChem version that is being used here.
        Specified by:
        isCartridgeJChemVersionCurrent in interface DBDatabaseInfo
        Returns:
        0 if the JChem version is the same, a negative number if the cartridge version is older than the one in use, a positive number if it is newer, and null if the cart is not enabled
      • isCartridgeJChemTableVersionCurrent

        public java.lang.Integer isCartridgeJChemTableVersionCurrent()
        Compare the table version used by the cartridge to the one used by JChem. If the table version is not available (older JChem versions), or cannot be recognised then the JChem versions are compared.
        Specified by:
        isCartridgeJChemTableVersionCurrent in interface DBDatabaseInfo
        Returns:
        0 if the table versions are the same, a negative number if the cartridge version is older than the one in use in the local jchem.jar, a positive number if the cartridge version is newer, and null if the cart is not enabled.
      • nativeType

        public DBDatabaseInfo.NativeType nativeType​(java.lang.String nativeColumnType)
        Create the NativeType for the specified column type.
        Specified by:
        nativeType in interface DBDatabaseInfo
        Parameters:
        nativeColumnType - The actual column definition in the database e.g. VARCHAR2, FLOAT... The JDBC type, length and scale will be set to zero as they are unspecified.
      • nativeType

        public DBDatabaseInfo.NativeType nativeType​(int jdbcType,
                                                    java.lang.String suppliedType,
                                                    int size,
                                                    int scale)
        Create the native type for these settings. If the suppliedType is not specified then a "best guess" will be used.
        Specified by:
        nativeType in interface DBDatabaseInfo
        Parameters:
        jdbcType - (@link java.sql.Types}
        suppliedType - The name of native type name DBDatabaseInfo.ColumnSQLType
        size - The size of the type
        scale - The scale of the type
      • availableNativeTypesForColumnType

        public DBDatabaseInfo.NativeType[] availableNativeTypesForColumnType​(java.lang.String columnType)
        Get the native types that this platform supports for this particular column type.
        Specified by:
        availableNativeTypesForColumnType in interface DBDatabaseInfo
        Parameters:
        columnType - The generic type of the column (TEXT, INTEGER) defined by the constants in DBDatabaseInfo.ColumnBoundTypes
        Returns:
        An array of compatible column native types
      • requiresNotNullDefault

        public boolean requiresNotNullDefault()
        Description copied from interface: DBDatabaseInfo
        Determines if it is legal to declare a column NOT NULL while giving no default value. Database platform dependent.
        Specified by:
        requiresNotNullDefault in interface DBDatabaseInfo
        Returns:
        True, if the default value is required, false otherwise
      • requiresNotNullDefault

        public boolean requiresNotNullDefault​(DBDatabaseInfo.ColumnSQLType type)
        Determines if it is legal to declare a column NOT NULL while giving no default value. It is not database platform dependent. It is an application logic.
        Specified by:
        requiresNotNullDefault in interface DBDatabaseInfo
        Parameters:
        type -
      • requiresNotNullFK

        public boolean requiresNotNullFK()
        Determines, if the columns participating in FK must be NOT NULL.
        Specified by:
        requiresNotNullFK in interface DBDatabaseInfo
        Returns:
        True, if the column must be NOT NULL before FK to it can be made
      • requiresNotNullUnique

        public boolean requiresNotNullUnique()
        Determines, if the DB requires a NOT NULL constraint before an UQ can be created for the field.
        Specified by:
        requiresNotNullUnique in interface DBDatabaseInfo
        Returns:
        True, if a field participating in UNIQUE constraint must be NOT NULL
      • getUpdateRuleAction

        public java.lang.String getUpdateRuleAction​(int actionCode)
        Returns a string representation of the action code for update rule in a FK.
        Specified by:
        getUpdateRuleAction in interface DBDatabaseInfo
        Parameters:
        actionCode - The action code
        Returns:
        The string representation of the action code
      • getDeleteRuleAction

        public java.lang.String getDeleteRuleAction​(int actionCode)
        Returns a string representation of the action code for delete rule in a FK.
        Specified by:
        getDeleteRuleAction in interface DBDatabaseInfo
        Parameters:
        actionCode - The action code
        Returns:
        The string representation of the action code
      • fixNativeType

        public java.lang.String fixNativeType​(java.lang.String nativeType)
        Convert the native type to its correct form (adjust for Oracle quirks!).
        Specified by:
        fixNativeType in interface DBDatabaseInfo
        Parameters:
        nativeType -
        Returns:
        The corrected native type
      • lookupArrayValues

        public static java.lang.String[] lookupArrayValues​(java.util.Properties props,
                                                           java.lang.String key)
      • getLobHandler

        public org.springframework.jdbc.support.lob.LobHandler getLobHandler()
        Specified by:
        getLobHandler in interface DBDatabaseInfo
      • createLobHandler

        protected org.springframework.jdbc.support.lob.LobHandler createLobHandler()
      • convertNamesToUpperCase

        public boolean convertNamesToUpperCase()
        Description copied from interface: DBDatabaseInfo
        Informs whether used DB platform uses upper case for names.
        Specified by:
        convertNamesToUpperCase in interface DBDatabaseInfo
        Returns:
        true if db platform defines property metadata-convertNamesToUpperCase and that property is set to "true" (ignoring case). Otherwise returns false.
      • convertNamesToLowerCase

        public boolean convertNamesToLowerCase()
        Description copied from interface: DBDatabaseInfo
        Informs whether used DB platform uses lower case for names.
        Specified by:
        convertNamesToLowerCase in interface DBDatabaseInfo
        Returns:
        true if db platform defines property metadata-convertNamesToLowerCase and that property is set to "true" (ignoring case). Otherwise returns false.