simpleJdbcCall调用函数语法

前端之家收集整理的这篇文章主要介绍了simpleJdbcCall调用函数语法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


@Bean

publicSimpleJdbcCallsaveServiceRecord(JdbcTemplatejdbcTemplate){

SimpleJdbcCalljdbcCall=newSimpleJdbcCall(jdbcTemplate).withSchemaName("CRMII")

.withFunctionName("FUNC_700212").withReturnValue(); 这样子声明,就会把函数返回值放到mapLli

jdbcCall.addDeclaredParameter(newsqlOutParameter("P_CURSOR",OracleTypes.CURSOR));

jdbcCall.addDeclaredParameter(newsqlParameter("P_YWLB",Types.BIGINT));

jdbcCall.addDeclaredParameter(newsqlParameter("P_FWLB",Types.BIGINT));

jdbcCall.addDeclaredParameter(newsqlParameter("P_FWLBXF",Types.BIGINT));

jdbcCall.addDeclaredParameter(newsqlParameter("P_ZT",Types.VARCHAR));

jdbcCall.addDeclaredParameter(newsqlParameter("P_XXNR",Types.VARCHAR));

jdbcCall.addDeclaredParameter(newsqlParameter("P_FWRY",Types.VARCHAR));

jdbcCall.addDeclaredParameter(newsqlParameter("P_KHH",Types.VARCHAR));

jdbcCall.addDeclaredParameter(newsqlParameter("P_CZLX",Types.BIGINT));

jdbcCall.addDeclaredParameter(newsqlParameter("P_WJDANR",Types.VARCHAR));

returnjdbcCall;


}


@Override

publicResponseEntityqueryQuestionOrAnswer(Longywlb,Longfwlb,Longfwlbxf,LongqueryType,Longwjtmid){

//TODOAuto-generatedmethodstub

intreturnValue=-1;

Map<String,Object>returnMap=queryQuestion.execute(ywlb,fwlb,fwlbxf,queryType,wjtmid);

if(returnMap!=null){

returnValue=(int)returnMap.get("return"); 获取函数返回值

if(returnValue==1){

returnsuccess(returnMap.get("P_CURSOR"));

}else{

returnfail("获取问题失败");

}

}

returnnull;

}

}

原文链接:https://www.f2er.com/oracle/211697.html

猜你在找的Oracle相关文章