Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

can't use getString to get char value

Posted on 2006-05-23
11
Medium Priority
?
533 Views
Last Modified: 2012-06-22
if (rst.getString("Inv_ItemModelNo").equals(""))  -----> if Inv_Type data type varchar den this statement is working

if (rst.getString("Inv_Type").equals(""))  -----> if Inv_Type data type char den this statement is nt working (how to make this work?)

thks


            
0
Comment
Question by:mayachoy
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 23

Expert Comment

by:basicinstinct
ID: 16740689
Would this work?

if (Character.toString(rst.getString("Inv_Type")).equals(""))
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 16741656
How about:

if (rst.getString("Inv_Type") == '')

That is 2 single quotes at the end.

If rs.getString is returning type char (java primitive) then you cannot perform a .equals operation on it, its not an object.
0
 

Author Comment

by:mayachoy
ID: 16742874
both way are nt working

on my jsp is still not working
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:jpolin1
ID: 16742894
What exception are you getting when the data type is char ?
0
 
LVL 3

Expert Comment

by:Krule
ID: 16743984
if (String.valueOf(rst.getString("Inv_Type")).equals("") )
0
 

Author Comment

by:mayachoy
ID: 16748411
i had tried all the solution above still not working.
0
 

Author Comment

by:mayachoy
ID: 16752535
if (!rst.getString("Inv_Type").equals("OH"))

if (!rst.getString("Inv_ISOCountryCode").equals("ID"))

both inv_type and Inv_ISOCountryCode are char type

but inv_type is working on the if statement but Inv_ISOCountryCode  is nt working in the if statemenet

is it because the field name too long? is it jsp got such limits? if yes how should i solve it?

thanks
0
 
LVL 3

Accepted Solution

by:
Krule earned 600 total points
ID: 16752640
I suggest some debugging techniques.

Print out (display) what is in the field, so you can see. Perhaps the data you are getting back is not what you are expecting?
0
 
LVL 6

Assisted Solution

by:Mujtaba_Alam_Khan
Mujtaba_Alam_Khan earned 600 total points
ID: 16784230
have you tried:

if (rst.getString("Inv_Type").equals(null))

-Muj ;-)

0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The deadly train derailment that occurred recently in DuPont, Washington, raises a lot of questions. It was a new route, the first trip tested with passengers, and the train was travelling at 50 mph over the zone’s speed limit. Could IoT play a role…
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question