문제

I am using Oracle AQ within WAS. It requires an OracleConnection instance to work. Currently I am obtaining the connection via the deprecated method WSJdbcUtil.getNativeConnection

Class.forName("oracle.AQ.AQOracleDriver")
val ctx = new InitialContext()
val datasource = ctx.lookup("jdbc/MessageManagerDB").asInstanceOf[DataSource]
val wasConnection = datasource.getConnection.asInstanceOf[WSJdbcConnection]
val nativeConnection = WSJdbcUtil.getNativeConnection(wasConnection)
AQDriverManager.createAQSession(nativeConnection.asInstanceOf[Connection])

Is there a non-deprecated alternative to this method?

(ps, code sample is scala, but this question tagged java, as it is regarding the WAS Java API).

도움이 되었습니까?

해결책

WSCallHelper.getNativeConnection

다른 팁

also, if the connection implements java.sql.Wrapper, you should be able to use to get the underlying connection.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top