org.springframework.boot.jdbc.init

Class PlatformPlaceholderDatabaseDriverResolver

  • java.lang.Object
    • org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver


  • public class PlatformPlaceholderDatabaseDriverResolver
    extends java.lang.Object
    Utility class that can resolve placeholder text with the actual DatabaseDriver platform.

    By default, the name of the platform is the ID of the driver. This mapping can be customized by withDriverPlatform(DatabaseDriver, String) registering custom DatabaseDriver to platform mappings.

    Since:
    2.6.0
    • Constructor Detail

      • PlatformPlaceholderDatabaseDriverResolver

        public PlatformPlaceholderDatabaseDriverResolver()
        Creates a new resolver that will use the default "@@platform@@" placeholder.
      • PlatformPlaceholderDatabaseDriverResolver

        public PlatformPlaceholderDatabaseDriverResolver(java.lang.String placeholder)
        Creates a new resolver that will use the given placeholder.
        Parameters:
        placeholder - the placeholder to use
    • Method Detail

      • resolveAll

        public java.util.List<java.lang.String> resolveAll(javax.sql.DataSource dataSource,
                                                           java.lang.String... values)
        Resolves the placeholders in the given values, replacing them with the platform derived from the DatabaseDriver of the given dataSource.
        Parameters:
        dataSource - the DataSource from which the DatabaseDriver is derived
        values - the values in which placeholders are resolved
        Returns:
        the values with their placeholders resolved
      • resolveAll

        public java.util.List<java.lang.String> resolveAll(java.lang.String platform,
                                                           java.lang.String... values)
        Resolves the placeholders in the given values, replacing them with the given platform.
        Parameters:
        platform - the platform to use
        values - the values in which placeholders are resolved
        Returns:
        the values with their placeholders resolved
        Since:
        2.6.2