| Retrieving a CLOB in iBatis |
| Java - Tutorials |
| Friday, 05 November 2010 11:43 |
|
When I was but a youngling and the Force was yet to fully develop within me, I had issues calling stored procedures which returned a CLOB.
I'm pleased that those days are behind me (somewhat) and I now want to share my learnings with you. What this does is force Ibatis to use the specified handler when dealing with the java type specified. So in this case, we're telling Ibatis to use the ClobTypeHandlerCallback when dealing with objects of type java.sql.Clob. Just one other step is required. Ensure that you have the correct type mapping in your parameter map. Remember to cast your return value when getting it back. And viola! That's it. Go ahead and test it out. |

