如何调用如下存储过程的返回值?
希望高手能给出个具体的方法》:
drop procedure if exists usr_login//
create procedure usr_login(in _USER_NAME varchar(255),in _PASSWORD varchar(255),in _USER_CERT blob)
begin
declare _PURVIEW integer;
declare _USER_ID integer;
declare _USER_STATE integer;
declare _PERSON_NAME varchar(255);
if _USER_CERT is not null then
select USER_ID,PERSON_NAME,USER_PURVIEW,USER_STATE into _USER_ID,_PERSON_NAME,_PURVIEW,_USER_STATE from USERS where USER_NAME=_USER_NAME and USER_CERT=_USER_CERT;
else
select USER_ID,PERSON_NAME,USER_PURVIEW,USER_STATE into _USER_ID,_PERSON_NAME,_PURVIEW,_USER_STATE from USERS where USER_NAME=_USER_NAME and PASSWORD=_PASSWORD;
end if;
if _PURVIEW is not null then
insert into SYSLOGS(LOG_TIME,USER_ID,OPER_ID,OBJECT_ID,LOG_REMARK)
values (now(), _USER_ID,10, _USER_ID, null);
if _USER_STATE=0 then
update USERS set USER_STATE=1 where USER_NAME=_USER_NAME and PASSWORD=_PASSWORD;
end if;
select _USER_ID,_PERSON_NAME,_PURVIEW,_USER_STATE;
else
select 'Login incorrect!' as _ERROR;
end if;
end;//
參考答案:ResultSet rs = executeQuery(sql);
String xx = rs.getString("xxxx");