File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HttpSession Attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession Attributes" Watch "HttpSession Attributes" New topic

HttpSession Attributes

Geetu Bahl

Joined: Dec 01, 2004
Posts: 14

I have the problem in the following few lines of code

String attrib = null;
attrib = (String)session.getAttribute("mybook");

Now i need to use this attrib in a where clause of a SQL query. But when i use,it gives me an exception

java.sql.SQLException: ORA-00904:: invalid identifier

Basically in this code, user makes a serach and the i am trying to display the selected items to the user if they are available in the database.

So to make appropriate selection i need to get the value which user searched for and use it in the where clause.But it is giving exception

Please guide ???

Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
Seeing the exception, it appears that problem is with SQL query u are using. Can you show me the code?

Sanjeev Kaushik
Geetu Bahl

Joined: Dec 01, 2004
Posts: 14

Thanks Sanjeev.I figured out and now the code is compiling fine.

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it


Thanks! and welcome to the JavaRanch!


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: HttpSession Attributes
It's not a secret anymore!