I saw a similar question asked:
Issue while creating Oracle ARRAY Type in java using ArrayDescriptor
However my issue is that other coders on the team are using the same code and apparently it is working fine for them.
Connection conn = null;
Connection oracleConn = null;
CallableStatement stmt = null;
try {
conn = this.getDataSource().getConnection();
if ( conn.isWrapperFor(oracle.jdbc.OracleConnection.class)) {
oracleConn = conn.unwrap(oracle.jdbc.OracleConnection.class);
}
I did not develop this code, I found it odd they're unwrapping an OracleConnection into a regular Connection class. Bawwwt.
I've tried a whole boat load of things, but really this code is supposed to work as is.
Now the above code generates a null pointer later on when a prepared statement is called since the if statement never fires. I never make it inside that if statement,
However when I force myself to do an unwrapping I get:
java.sql.SQLException: DSRA9122E: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@35c735c7 does not wrap any objects of type oracle.jdbc.OracleConnection
The environment is running ojdbc14 and JVM 6.0. Setup in WebSphere
First time poster, so I apologize in advance if I am mucking something up.
EditRemoved two variables from code that don't matter