( i_id_number IN varchar2, i_card_id IN varchar2, o_customer_id_and_passwd OUT VARCHAR2 ) IS BEGIN SELECT l.customer_id||'&'||l.password INTO o_customer_id_and_passwd FROM ecc_account_card a,ecc_card c,ecc_customer_login l WHERE a.card_id = c.card_id AND a.card_id = i_card_id AND c.holder_id_num = i_id_number AND l.customer_id = a.customer_id AND a.status_id = '101'; EXCEPTION WHEN OTHERS THEN RAISE; end;请问我的存储过程是这样的,怎么用CALLSTATEMENT??
CallableStatement callFunction = connection.prepareCall( "{ call test(?,?) }");callFunction.setString(1,"paramerer1"); callFunction.setString(1,"paramerer2"); callFunction.registerOutParameter(1,OracleTypes.VARCHAR); // execute the function and return the result callFunction.execute(); String sbResult = callFunction.getString(3); System.out.println("处理结果:"+sbResult);;
CallableStatement callFunction = connection.prepareCall(
"{ ? = call PKG_ZXSB.P_ZXSB_SKSSQ(?,?) }");PKG_ZXSB为包名,P_ZXSB_SKSSQ为存储过程名。
i_id_number IN varchar2,
i_card_id IN varchar2,
o_customer_id_and_passwd OUT VARCHAR2
)
IS
BEGIN
SELECT l.customer_id||'&'||l.password INTO o_customer_id_and_passwd
FROM ecc_account_card a,ecc_card c,ecc_customer_login l
WHERE a.card_id = c.card_id
AND a.card_id = i_card_id
AND c.holder_id_num = i_id_number
AND l.customer_id = a.customer_id
AND a.status_id = '101';
EXCEPTION
WHEN OTHERS THEN
RAISE;
end;请问我的存储过程是这样的,怎么用CALLSTATEMENT??
"{ call test(?,?) }");callFunction.setString(1,"paramerer1");
callFunction.setString(1,"paramerer2");
callFunction.registerOutParameter(1,OracleTypes.VARCHAR);
// execute the function and return the result
callFunction.execute();
String sbResult = callFunction.getString(3);
System.out.println("处理结果:"+sbResult);;