Question

Java Spring Mybatis I am trying to createDescriptor but i need raw Connection instead of "NewProxyConnection" can some one help me how can i get Oracle Connection object out of "NewProxyConnection" object

I come across method proxyCon.rawConnectionOperation(arg0, arg1, arg2) but i am unaware if i can use it. any help appreciated.

public class MarketListTypeHandler implements TypeHandler {

// other override methods



        public void setParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {


                NewProxyConnection proxyCon = (NewProxyConnection) ps.getConnection();
                    StructDescriptor structDescriptor = StructDescriptor.createDescriptor("mkt_list_rec", proxyCon);
    // rest of the code goes here


        }


        }
Was it helpful?

Solution

Found solution, sharing with you all.

    C3P0NativeJdbcExtractor cp30NativeJdbcExtractor = new C3P0NativeJdbcExtractor(); 
    OracleConnection connection = (OracleConnection) cp30NativeJdbcExtractor.getNativeConnection(ps.getConnection()); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top