org.springframework.boot.jdbc

Enum EmbeddedDatabaseConnection

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      DERBY
      Derby Database Connection.
      H2
      H2 Database Connection.
      HSQLDB
      HSQL Database Connection.
      NONE
      No Connection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static EmbeddedDatabaseConnection get(java.lang.ClassLoader classLoader)
      Returns the most suitable EmbeddedDatabaseConnection for the given class loader.
      java.lang.String getDriverClassName()
      Returns the driver class name.
      org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType getType()
      Returns the EmbeddedDatabaseType for the connection.
      java.lang.String getUrl(java.lang.String databaseName)
      Returns the URL for the connection using the specified databaseName.
      static boolean isEmbedded(javax.sql.DataSource dataSource)
      Convenience method to determine if a given data source represents an embedded database type.
      static boolean isEmbedded(java.lang.String driverClass, java.lang.String url)
      Convenience method to determine if a given driver class name and url represent an embedded database type.
      static EmbeddedDatabaseConnection valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EmbeddedDatabaseConnection[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getDriverClassName

        public java.lang.String getDriverClassName()
        Returns the driver class name.
        Returns:
        the driver class name
      • getType

        public org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType getType()
        Returns the EmbeddedDatabaseType for the connection.
        Returns:
        the database type
      • getUrl

        public java.lang.String getUrl(java.lang.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(java.lang.String driverClass,
                                         java.lang.String url)
        Convenience method to determine if a given driver class name and url represent an embedded database type.
        Parameters:
        driverClass - the driver class
        url - the jdbc url (can be null)
        Returns:
        true if the driver class and url refer to an embedded database
        Since:
        2.4.0
      • isEmbedded

        public static boolean isEmbedded(javax.sql.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