Package de.chojo.sqlutil.jdbc
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
A basic jdbc config
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<V> TaddParameter(String key, V value) Add a new parameter to the urlprotected abstract StringbaseUrl()Returns the base url without parameterprotected abstract StringReturns the full path of the driver classprotected abstract Stringdriver()Returns the driver name of the jdbc urlfinal StringjdbcUrl()Get the jdbc url which combines the results ofbaseUrl()andparameter()protected StringBuild theparameter, which were addedprotected Tself()Returns the instance with the correct type.setDriverClass(@NotNull Class<V> driverClass) setDriverClass(@NotNull String driverClass) setDriverClass(V driverClass)
-
Constructor Details
-
JdbcConfig
public JdbcConfig()
-
-
Method Details
-
setDriverClass
-
setDriverClass
-
setDriverClass
-
defaultDriverClass
Returns the full path of the driver class- Returns:
- driver class
-
driverClass
-
driver
Returns the driver name of the jdbc url- Returns:
- driver
-
self
Returns the instance with the correct type.- Returns:
- instance
-
addParameter
Add a new parameter to the url- Type Parameters:
V- value type- Parameters:
key- keyvalue- value- Returns:
- builder instance
-
baseUrl
Returns the base url without parameter- Returns:
- base url
-
parameter
Build theparameter, which were added- Returns:
- parameter chained as a parameter string with encoded values.
-
jdbcUrl
Get the jdbc url which combines the results ofbaseUrl()andparameter()- Returns:
- jdbc string
-