I need to store large XML data to CLOB and convert back CLOB to String
But the problem is we are using (Spring NamedParameterJdbc template)
SqlParameterSource paramSource = new BeanPropertySqlParameterSource(
positionResponsesDO);
this.jdbcTemplate.update(sql, paramSource);
Where PositionResponsesDO has get and set property
private Clob xmlData;
Now I need to convert String data (large) to Clob and Clob to String.
Please suggest to me the best way.
I can’t use File operations as it’s WebApp
You can use
LobHandlerandLobCreatorto take Clobs and Blobs and turn them into something else.The Spring documentation discusses them here.
To convert a clob or blob column to something , you can use a
query()method onNamedParameterJdbcTemplatethat takes aRowMapper.