Hikaricp Oracle连接问题

Hikaricp Oracle连接问题,第1张

概述我有以下代码来连接到oracle数据库.但是使用hikaricp我得到了例外. java.sql.SQLException: Invalid Oracle URL specified: OracleDataSource.makeURL 码: private static HikariDataSource dataSource() { final HikariDataSource hikar @H_502_1@ 我有以下代码来连接到oracle数据库.但是使用hikaricp我得到了例外.

java.sql.sqlException: InvalID Oracle URL specifIEd: OracleDataSource.makeURL

码:

private static HikarIDataSource dataSource() {    final HikarIDataSource hikarIDataSource = new HikarIDataSource();    hikarIDataSource.setMaximumPoolSize(100);    hikarIDataSource.setMinimumIDle(10);    hikarIDataSource.setDataSourceClassname("oracle.jdbc.pool.OracleDataSource");    PropertIEs propertIEs = new PropertIEs();    propertIEs.put("user","user");    propertIEs.put("password","pass");    propertIEs.put("databasename","XE");    propertIEs.put("servername","192.168.21.13");    propertIEs.put("portNumber","1521");    hikarIDataSource.setDataSourcePropertIEs(propertIEs);    //Additionally I am setting connection test query and max life time also    return hikarIDataSource;}

完整的堆栈跟踪是

Exception in thread "main" java.lang.RuntimeException: fail-fast during pool initialization    at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:499)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:162)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:113)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at com.zaxxer.hikari.HikarIDataSource.getConnection(HikarIDataSource.java:102)    at java.lang.reflect.Method.invoke(Method.java:597)Caused by: java.sql.sqlException: InvalID Oracle URL specifIEd: OracleDataSource.makeURL    at oracle.jdbc.pool.OracleDataSource.makeURL(OracleDataSource.java:1277)    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:185)    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)    at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:418)    at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:498)    ... 11 more

如何建立成功的游泳池?我正在使用oracle jar
http://download.oracle.com/otn/utilities_drivers/jdbc/111070/ojdbc6.jar
而jdk是1.6.对于java 6,Hikaricp版本为2.2.5.

解决方法 尝试将驱动程序类型设置为精简.

propertIEs.put("driverType","thin");
总结

以上是内存溢出为你收集整理的Hikaricp Oracle连接问题全部内容,希望文章能够帮你解决Hikaricp Oracle连接问题所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1157502.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存