I usually use the lobHandler + JdbcTemplate + PreparedStatementSetter triplet to insert my Clob into the database, as I saw on http://www.java2s.com/Code/Java/Spring/InsertC
I do something like this, obviously we use an Oracle database if you use something else you will have to fiddle with some of the parameter. The getJdbcTemplate method is a helper method of JdbcDaoSupport (a spring helper class.)
getJdbcTemplate().execute(new ConnectionCallback() {
public Object doInConnection(Connection con) throws SQLException, DataAccessException {
PublishResponseObject responseObject = new PublishResponseObject();
OracleCallableStatement ocstmt = null;
CLOB clob = null;
try {
clob = createCLOB(xmlString, con);
ocstmt = (OracleCallableStatement) con.prepareCall("{call schmea.publish(?)}");
//When in insert mode and update By Pk is specified updates are possible and version numbers will be returned.
ocstmt.setCLOB(1, clob);
...
}
finally {
clob.close()
stmt.close
}