Currently I am very busy with a new Java webapp project. One of the specifiactions was to collect XML data and store it via an Stored Procedure in a Oracle table. The XML data can be very large so we should use CLOB (Character Large Object ). For details, see http://en.wikipedia.org/wiki/CLOB.
The customer is using for all there Java web applications JBoss as the Java Server. As a framework, they have chosen for Spring Framework. It is not bad as a framework, you will get lots of usefull scaffolding, but as almost every framework there are also some annoying parts.
One of the annoying parts is the Oracle Connections, Spring is using lots of wrapper classes around the native Oracle Connections.
After some trial and error I found a fairly simple solution.
In the ApplicationContext.xml, the place where the beans for the webapp are specified, I specified 2 new beans. One of the beans points to the nativeJdbcExtractor. In the oracleLOBHandler I make reference to the other bean.
In the end my DAO class looks a little bit like below ( I removed customer related code and the imports )
The bold parts in the code above do the trick, to get great chuncks of XML data in an Oracle Table