环境
视窗
HikariCP 版本:2.6.0
JDK 版本:1.8.0_65
数据库:PostgreSQL
驱动程序版本:42.0.0 org.postgresql
它工作了一段时间,比如 2 小时,然后引发异常。
我的配置:
ds = new HikariDataSource();
ds.setMaximumPoolSize(poolSize);
ds.setLeakDetectionThreshold(15000);
ds.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
ds.addDataSourceProperty("serverName", serverAddress);
ds.addDataSourceProperty("databaseName", database);
ds.addDataSourceProperty("user", user);
ds.addDataSourceProperty("portNumber", port);
ds.addDataSourceProperty("password", password);
我的 postgresql.conf 也没有设置与 ssl 相关的任何内容。
最佳答案
您可以通过设置 useSSL=false 来显式禁用 SSL
例如
ds.addDataSourceProperty("useSSL", "false");
关于pool - PSQLException : The server does not support SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42911275/