Class JdbcConfig<T extends JdbcConfig<?>>

java.lang.Object
de.chojo.sqlutil.jdbc.JdbcConfig<T>
Type Parameters:
T - type of config
Direct Known Subclasses:
RemoteJdbcConfig, SqLiteJdbc

public abstract class JdbcConfig<T extends JdbcConfig<?>> extends Object
A basic jdbc config
  • Constructor Details

    • JdbcConfig

      public JdbcConfig()
  • Method Details

    • setDriverClass

      public T setDriverClass(@NotNull @NotNull String driverClass)
    • setDriverClass

      public <V extends Driver> T setDriverClass(@NotNull V driverClass)
    • setDriverClass

      public <V extends Driver> T setDriverClass(@NotNull @NotNull Class<V> driverClass)
    • defaultDriverClass

      protected abstract String defaultDriverClass()
      Returns the full path of the driver class
      Returns:
      driver class
    • driverClass

      public final String driverClass()
    • driver

      protected abstract String driver()
      Returns the driver name of the jdbc url
      Returns:
      driver
    • self

      protected T self()
      Returns the instance with the correct type.
      Returns:
      instance
    • addParameter

      public <V> T addParameter(String key, V value)
      Add a new parameter to the url
      Type Parameters:
      V - value type
      Parameters:
      key - key
      value - value
      Returns:
      builder instance
    • baseUrl

      protected abstract String baseUrl()
      Returns the base url without parameter
      Returns:
      base url
    • parameter

      protected String parameter()
      Build the parameter, which were added
      Returns:
      parameter chained as a parameter string with encoded values.
    • jdbcUrl

      public String jdbcUrl()
      Get the jdbc url which combines the results of baseUrl() and parameter()
      Returns:
      jdbc string