Please help with the following problem.
(I am using Orion 4.7)

I am trying to use the value of the session variable for database
accesses( I am not concerned about security).

First, I tried to get the session value back in  b.jsp  by:
String pwd =(String)session.getAttribute("Login.Password");

and then use pwd to query oracle DB by:
rs = stmt.executeQuery("SELECT * FROM customers WHERE password
='"+this.pwd+"'");


I got this error message:

Syntax error in source/jsp/db_proj/BillingDB/jsp_servlet/myAcct.jsp.java:92:
No variable pwd defined in class
/jsp/db_proj/BillingDB/jsp_servlet/myAcct.jsp. (JSP page line 122)
           rs = stmt.executeQuery("SELECT * FROM customers WHERE CUSTID
='"+this.pwd+"'");

^
1 error

My questions are:

1. How do I define pwd. Why can't "String pwd
=(String)session.getAttribute("Login.Password");" define pwd? I tried to put
it into <%! %> then I got another
error message saying variable "session" is undefined...

2. Since password is a number type, how do I change pwd into an number type?

3. What is the solution?

Thanks in advance.

Roland

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to