使用hikari时如何获取oracle.jdbc.OracleConnection [英] How can I get an oracle.jdbc.OracleConnection when using hikari
问题描述
我需要一个oracle.jdbc.OracleConnection才能直接与ORACLE的SDO_GEOMETRY一起使用.
I need an oracle.jdbc.OracleConnection to directly work with ORACLE's SDO_GEOMETRY.
我有一个类型为Object的对象: com.zaxxer.hikari.proxy.ConnectionJavassistProxy类
I have an Object that is of type: class com.zaxxer.hikari.proxy.ConnectionJavassistProxy
我的调试器说它的值是: ConnectionJavassistProxy(1082639682)包装oracle.jdbc.driver.T4CConnection@220c1ab2
My debugger says its value is: ConnectionJavassistProxy(1082639682) wrapping oracle.jdbc.driver.T4CConnection@220c1ab2
请注意,T4CConnection实现了oracle.jdbc.OracleConnection
Note that T4CConnection implements oracle.jdbc.OracleConnection
因此,如果我可以访问它,我将拥有所需的东西.
So if I can get access to it, I will have what I need.
推荐答案
OracleConnection oracleConnection = connection.unwrap(OracleConnection.class);
OracleConnection oracleConnection = connection.unwrap(OracleConnection.class);
这篇关于使用hikari时如何获取oracle.jdbc.OracleConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!