org.springframework.boot.jdbc

Enum EmbeddedDatabaseConnection

    • Method Detail

      • values

        public static EmbeddedDatabaseConnection[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EmbeddedDatabaseConnection c : EmbeddedDatabaseConnection.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EmbeddedDatabaseConnection valueOf(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getDriverClassName

        public String getDriverClassName()
        Returns the driver class name.
        Returns:
        the driver class name
      • getUrl

        public String getUrl(String databaseName)
        Returns the URL for the connection using the specified databaseName.
        Parameters:
        databaseName - the name of the database
        Returns:
        the connection URL
      • isEmbedded

        public static boolean isEmbedded(String driverClass)
        Convenience method to determine if a given driver class name represents an embedded database type.
        Parameters:
        driverClass - the driver class
        Returns:
        true if the driver class is one of the embedded types
      • isEmbedded

        public static boolean isEmbedded(DataSource dataSource)
        Convenience method to determine if a given data source represents an embedded database type.
        Parameters:
        dataSource - the data source to interrogate
        Returns:
        true if the data source is one of the embedded types