I am forced into a situation where i am using hibernate createNativeQuery to return a List of Objects arrays.
One of the (many) columns from which my query returns values is a CLOB.
The Object which is returned is com.sun.Proxy object.
I have seen a question here where
getClass().getInterfaces()
was used to identify that it is a WrappedClob being returned.
However given that I now have this proxy object in my Java code, how do I convert it into something useful ... like a String?
The following code helped to unProxy the clob
Link which help me, just add a bit of makeup to the code :D
You can try this code. Probably it is not perfect, but it works for me :) I'm using it to convert regular clob to string so it should also work if you unwrap clob object with getWrappedClob()