Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSession Attributes

 
Geetu Bahl
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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 ???

Thanks
Geetu
 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seeing the exception, it appears that problem is with SQL query u are using. Can you show me the code?
 
Geetu Bahl
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey

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

Thanks
Geetu
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Geetu"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic