Hi,
I would make some suggestions. One instead of casting your object
into a string
>(java.lang.String) valueAtColumnRow(BV_NBR_COLUMN, index);
I find it easier to convert the data straight to a string when
getting the object data from the sql statement
so for example:
your_recordset.getObject(1).toString()
Of course this won't work if you need to use the data element as other
than a string, but most of the time in a JSP you really only care about
the string representation of the data.
On the actual problem
I would trim the data and check after the trim. If that doesn't work
literally print out the values of each to the screen side by side and double
check what you have is actually what you think it is.
Casey Kochmer
>From: "Jay H. Lang" <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Confused on JSP problem
>Date: Sat, 13 Jan 2001 17:37:28 -0700
>
>Hi All,
>I have a JSP that uses a Java Bean to get data from DB2. I am trying to
>use an IF statement in the JSP to look for a value returned from the
>bean.
>
>Here is the Java beans return statement:
>
>return (java.lang.String) valueAtColumnRow(BV_NBR_COLUMN, index);
>
>In the JSP I want check if this value is ever 000000, so the statement
>looks like:
>
>java.lang.String _p0_1 = CN31BVListDBBean.getBV_NBR(0);
>java.lang.String checknum = "000000";
>
> if( _p0_1.equals(checknum)) {
> do something
> }
>else {
> do something else
>}
>
>I have also tried to use the:
>if( _p0_1.compareTo(checknum)) method and it doesn't seem to ever match.
>
>I have also declared the checknum String as:
>
>java.lang.String checknum = new String("000000");
>
>And it doesn't seem to matter. I know that I have 000000 values coming
>in from this bean because I am displaying them in the page.
>
>Any help is appreciated.
>Thanks.
>--
>Jay H. Lang
>Chief Technologist
>Distributed Computing Professionals Inc.
>IBM Certified Specialist - MQSeries
>303 277-1873 - Office
>303 807-9700 - Cell
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets