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

int Session value problem

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
Dear Ranchers,
I'm using JSP and MySQL for my project and when in my code when I try to retrieve the data in int format, I'm getting the following errors. Please help me to fix this problem

The code is given below

The error I'm getting is

The code in line : 61 is

Please help me fix this problem.

Thanks and regards

Aravind Prasad
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Hi Aravind,
the menu1 you are getting is the Wrapper Class Integer. But the value what you are trying to compare '1' is of built in type 'int'. thats why the mismatch.
try doing with parsing the Integer as int and compare. You can use Integer.intValue() to get the int out of Integer.

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
I agree. Here's the link:
subject: int Session value problem
jQuery in Action, 3rd edition