Changed the way to get the DB url

This commit is contained in:
Luca Frosini 2021-03-18 13:32:35 +01:00
parent 3bac5f159c
commit d1c996dec7
1 changed files with 2 additions and 8 deletions

View File

@ -12,13 +12,11 @@ public class RecordToDBConnection {
private static final Logger logger = LoggerFactory.getLogger(RecordToDBConnection.class);
public static final String URL_PROPERTY_KEY = "url";
public static final String URL_PROPERTY_KEY = "URL";
public static final String DB_SUFFIX = "-db";
public static final String USERNAME_SUFFIX = "-username";
public static final String PASSWORD_SUFFIX = "-password";
private final String baseURL;
private final String dbName;
private final String url;
private final String username;
private final String password;
@ -29,11 +27,7 @@ public class RecordToDBConnection {
protected RecordToDBConnection(String type, Class<? extends Record> clz, PersistenceBackendConfiguration configuration) throws Exception {
this.clz = clz;
this.typeName = type;
this.baseURL = configuration.getProperty(URL_PROPERTY_KEY);
this.dbName = configuration.getProperty(typeName+DB_SUFFIX);
this.url = baseURL + "/" + dbName;
this.url = configuration.getProperty(typeName+DB_SUFFIX);
this.username = configuration.getProperty(typeName+USERNAME_SUFFIX);
this.password = configuration.getProperty(typeName+PASSWORD_SUFFIX);
}