Class ConnectionException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ConnectionException
    extends java.lang.Exception
    Represents an exception that occurs while attempting to connect to a database
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      @NotNull java.util.Properties properties
      The properties used to connect to the database
      Recommended to use getPropertiesRedacted() for logging/other outputs
      @NotNull java.lang.String url
      The URL of the database connection
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectionException​(@NotNull java.lang.String message, @NotNull java.lang.String url, @NotNull java.util.Properties properties)
      Constructs a new connection exception with the given message, URL, and properties
      ConnectionException​(@NotNull java.lang.Throwable e, @NotNull java.lang.String url, @NotNull java.util.Properties properties)
      Constructs a new connection exception with the given URL and properties
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.util.Properties getPropertiesRedacted()
      Get the properties used to connect to the database, with the password redacted
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • url

        @NotNull
        public final @NotNull java.lang.String url
        The URL of the database connection
      • properties

        @NotNull
        public final @NotNull java.util.Properties properties
        The properties used to connect to the database
        Recommended to use getPropertiesRedacted() for logging/other outputs
    • Constructor Detail

      • ConnectionException

        public ConnectionException​(@NotNull
                                   @NotNull java.lang.Throwable e,
                                   @NotNull
                                   @NotNull java.lang.String url,
                                   @NotNull
                                   @NotNull java.util.Properties properties)
        Constructs a new connection exception with the given URL and properties
        Parameters:
        e - the exception that occurred
        url - url
        properties - properties
      • ConnectionException

        public ConnectionException​(@NotNull
                                   @NotNull java.lang.String message,
                                   @NotNull
                                   @NotNull java.lang.String url,
                                   @NotNull
                                   @NotNull java.util.Properties properties)
        Constructs a new connection exception with the given message, URL, and properties
        Parameters:
        message - the message to display
        url - url
        properties - properties
    • Method Detail

      • getPropertiesRedacted

        @NotNull
        public @NotNull java.util.Properties getPropertiesRedacted()
        Get the properties used to connect to the database, with the password redacted
        Returns:
        the redacted properties