We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
spring.datasource.hikari.maximum-pool-size=10
@Component public class ConnectionPoolHiraki { private static HikariDataSource ds; static void createPool() { HikariConfig config = new HikariConfig(); config.setDriverClassName("org.postgresql.Driver"); config.setJdbcUrl( "jdbc:postgresql://localhost:5432/postgres" ); config.setUsername("postgres"); config.setPassword("postgres"); config.setMinimumIdle(5); config.setMaxLifetime(1800000); config.setMaximumPoolSize(20); ds = new HikariDataSource( config ); } public static synchronized Connection getPool() throws SQLException { if (ds == null) createPool(); return ds.getConnection(); } }
@Component public class PostgresFactory { @Value("") private String dataBaseUrl; @Value("") private String dataBaseUser; @Value("") private String dataBasePassword; private static PostgresFactory ourInstance; public static PostgresFactory getInstance() { if (ourInstance == null) { synchronized (PostgresFactory .class) { if (ourInstance == null) { ourInstance = new PostgresFactory(); } } } return ourInstance; } private PostgresFactory() { }
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click