Class BaseDatabaseType

    • Constructor Detail

      • BaseDatabaseType

        public BaseDatabaseType()
    • Method Detail

      • getName

        public abstract String getName()
        Specified by:
        getName in interface DatabaseType
        Returns:
        The human-readable name for this database.
      • getNullType

        public abstract int getNullType()
        Specified by:
        getNullType in interface DatabaseType
        Returns:
        The JDBC type used to represent null in prepared statements.
      • getPriority

        public int getPriority()
        When identifying database types, the priority with which this type will be used. High numbers indicate that this type will be used in preference to others.
        Specified by:
        getPriority in interface DatabaseType
      • createDatabase

        public Database createDatabase​(Configuration configuration,
                                       boolean printInfo,
                                       JdbcConnectionFactory jdbcConnectionFactory)
        Description copied from interface: DatabaseType
        Initializes the Database class, and optionally prints some information.
        Specified by:
        createDatabase in interface DatabaseType
        Parameters:
        configuration - The MigrateDB configuration.
        printInfo - Where the DB info should be printed in the logs.
        jdbcConnectionFactory - The current connection factory.
        Returns:
        The appropriate Database class.
      • createDatabase

        public abstract Database createDatabase​(Configuration configuration,
                                                JdbcConnectionFactory jdbcConnectionFactory)
        Description copied from interface: DatabaseType
        Initializes the Database used by this Database Type.
        Specified by:
        createDatabase in interface DatabaseType
        Parameters:
        configuration - The MigrateDB configuration.
        jdbcConnectionFactory - The current connection factory.
        Returns:
        The Database.
      • getSelectVersionOutput

        public static String getSelectVersionOutput​(Connection connection)
        Retrieves the version string for a connection as described by SELECT VERSION(), which may differ from the connection metadata.
      • alterConnectionAsNeeded

        public void alterConnectionAsNeeded​(Connection connection,
                                            Configuration configuration)
        Description copied from interface: DatabaseType
        Carries out any manipulation on the Connection that is required by MigrateDB's config
        Specified by:
        alterConnectionAsNeeded in interface DatabaseType
        Parameters:
        connection - The JDBC connection.
        configuration - The MigrateDB configuration.