我收到此错误: UnableToExecuteStatementException:无法执行,没有命名参数匹配“nroCotizacion”,并且没有设置位置0(在JDBC'1'方案中为1)的位置参数...
代码是:
Handle h = null;
try{
h = dbi.open();
String stmt = "{call pkg.test_procedure(:nroCotizacion,:ramo,:tipoVista,:planes)}";
ResultSet rs = (ResultSet) h.createCall(stmt)
.bind("p_nuCotizacion", nroCotizacion)
.bind("p_ramo", ramo)
.bind("p_tipoVista",tipoVista)
.bind("p_subproducto",planes)
.registerOutParameter("v_titulos", OracleTypes.CURSOR)
.registerOutParameter("v_datos", OracleTypes.CURSOR)
.invoke();
List<TituloCoberturaBeneficioTO> titulos = new ArrayList<TituloCoberturaBeneficioTO>();
ResultSet rs2 = (ResultSet)rs.getObject("v_titulos");
while(rs2.next()){ ......
我不知道出了什么问题,我是jdbi的新手。
答案 0 :(得分:0)
您的绑定参数名称必须与语句中的参数列表匹配。例如:
ResultSet rs = ...
...
.bind("nroCotizacion", nroCotizacion)
...
从绑定参数名称中删除p_
前缀,或修改语句以使用p_
前缀。