使用Spring的SimpleJdbcCall调用Oracle存储过程新增带有CLOG数据时,我们需要声明变量为OracleTypes.CLOB变量如:

SimpleJdbcCall sjc = this.createSimpleJdbcCall();
sjc.getJdbcTemplate().setResultsMapCaseInsensitive(true);
sjc.withCatalogName(PACKAGE_SUFFIX)                // 存储过程所在的包名
.declareParameters(
new SqlParameter(“answer”,OracleTypes.CLOB)
)
.withProcedureName(procedureName);

其中answer字段在数据库存储的时候为CLOB数据。只有在新增或者修改的时候需要,查询无需。

一般常用类型如varchar2,number这些变量则无需声明。

转载自:http://www.javaxxz.com/thread-66413-1-1.html

posted on 2013-01-15 13:04  Java学习者  阅读(497)  评论(0)    收藏  举报