Разобрался с postrgresql:
public static final HikariConfig hikariConfig() {
HikariConfig hc = new HikariConfig();
hc.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
hc.setJdbcUrl(DataSources.PROPERTIES.getProperty("jdbc.url"));
hc.setUsername(DataSources.PROPERTIES.getProperty("jdbc.username"));
hc.setPassword(DataSources.PROPERTIES.getProperty("jdbc.password"));
hc.setMaximumPoolSize(10);
return hc;
}
public static final HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig());
public static final void dbInit() {
Base.open(hikariDataSource); // get connection from pool
}
public static final void dbClose() {
Base.close();
}