T
TManners
Ok I'm hoping someone can clarify and help me with this. Working in
JSP, I have a session variable that is giving me fits when I try to
get it and pass it to an Oracle stored procedure.
The session variable is an integer and was store like this on a login
page:
session.setAttribute("userid", new Integer(sRetVal));
This is the snippet of code for the page that is trying to use that
session variable:
Integer iUserid=(Integer)session.getValue("userid");
CallableStatement oCs = oCn.prepareCall("{CALL " + sSPName + "(?, ?,
?, ?)}");
oCs.setString(1, CleanPath);
oCs.setString(2, " ");
oCs.setInt(3, iUserid);
oCs.registerOutParameter(4, java.sql.Types.INTEGER);
oCs.setInt(4, 0);
oCs.execute();
int iRetVal=oCs.getInt(4);
out.print(iRetVal);
The problem is that I get an error when I try to set iUserid as the
3rd parameter in the stored procedure call. I can't figure out why. I
think I have tracked it down to being the recasting of the session
variable to Integer. Thoughts? I have a deadline I am trying to
meet.
-Tom
JSP, I have a session variable that is giving me fits when I try to
get it and pass it to an Oracle stored procedure.
The session variable is an integer and was store like this on a login
page:
session.setAttribute("userid", new Integer(sRetVal));
This is the snippet of code for the page that is trying to use that
session variable:
Integer iUserid=(Integer)session.getValue("userid");
CallableStatement oCs = oCn.prepareCall("{CALL " + sSPName + "(?, ?,
?, ?)}");
oCs.setString(1, CleanPath);
oCs.setString(2, " ");
oCs.setInt(3, iUserid);
oCs.registerOutParameter(4, java.sql.Types.INTEGER);
oCs.setInt(4, 0);
oCs.execute();
int iRetVal=oCs.getInt(4);
out.print(iRetVal);
The problem is that I get an error when I try to set iUserid as the
3rd parameter in the stored procedure call. I can't figure out why. I
think I have tracked it down to being the recasting of the session
variable to Integer. Thoughts? I have a deadline I am trying to
meet.
-Tom