HikariConfig config = new HikariConfig(); config.setJdbcUrl("jdbc:mysql://localhost/testdb"); config.setUsername("username"); config.setPassword("password"); config.setMaximumPoolSize(10); HikariDataSource dataSource = new HikariDataSource(config); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) { ResultSet resultSet = statement.executeQuery("SELECT * FROM employees"); while (resultSet.next()) { } } catch (SQLException e) { } config.setMaximumPoolSize(10); config.setMinimumIdle(5); HikariConfig config = new HikariConfig(); config.setMetricRegistry(new MetricRegistry()); HikariDataSource dataSource = new HikariDataSource(config);


上一篇:
下一篇:
切换中文