Link to home
Start Free TrialLog in
Avatar of mayachoy
mayachoy

asked on

can't use getString to get char value

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


            
Avatar of basicinstinct
basicinstinct
Flag of Australia image

Would this work?

if (Character.toString(rst.getString("Inv_Type")).equals(""))
Avatar of jpolin1
jpolin1

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.
Avatar of mayachoy

ASKER

both way are nt working

on my jsp is still not working
What exception are you getting when the data type is char ?
if (String.valueOf(rst.getString("Inv_Type")).equals("") )
i had tried all the solution above still not working.
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
ASKER CERTIFIED SOLUTION
Avatar of Krule
Krule
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial