File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
frameworks/Java/httpserver Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 3030 <artifactId >postgresql</artifactId >
3131 <version >42.7.2</version >
3232 </dependency >
33- <dependency >
34- <groupId >com.zaxxer</groupId >
35- <artifactId >HikariCP</artifactId >
36- <version >3.3.1</version >
37- </dependency >
38-
3933 <dependency >
4034 <groupId >com.github.httl</groupId >
4135 <artifactId >httl</artifactId >
4236 <version >1.0.11</version >
4337 </dependency >
44-
4538 <dependency >
4639 <groupId >org.slf4j</groupId >
4740 <artifactId >slf4j-simple</artifactId >
4841 <version >1.8.0-beta4</version >
4942 </dependency >
43+ <dependency >
44+ <groupId >com.zaxxer</groupId >
45+ <artifactId >HikariCP</artifactId >
46+ <version >7.0.2</version >
47+ </dependency >
5048 </dependencies >
5149 <profiles >
5250 <profile >
Original file line number Diff line number Diff line change @@ -54,10 +54,22 @@ private static List<Fortune> queryFortunes(DataSource ds) throws SQLException {
5454 private static DataSource createPostgresDataSource () throws ClassNotFoundException {
5555 Class .forName ("org.postgresql.Driver" );
5656 HikariConfig config = new HikariConfig ();
57+
5758 config .setJdbcUrl ("jdbc:postgresql://tfb-database:5432/hello_world" );
5859 config .setUsername ("benchmarkdbuser" );
5960 config .setPassword ("benchmarkdbpass" );
60- config .setMaximumPoolSize (512 );
61+
62+ config .setMaximumPoolSize (520 );
63+ config .setMinimumIdle (512 );
64+
65+ config .setConnectionTimeout (30000 );
66+ config .setIdleTimeout (600000 );
67+ config .setMaxLifetime (1800000 );
68+
69+ config .setAutoCommit (true );
70+
71+ config .setPoolName ("PostgreSQL-HikariCP-Pool" );
72+
6173 return new HikariDataSource (config );
6274 }
6375
@@ -145,4 +157,4 @@ static void main(String[] args) throws Exception {
145157 // start server
146158 server .start ();
147159 }
148- }
160+ }
You can’t perform that action at this time.
0 commit comments