Simple Display problem ....

From: Raquel (raquel_at_nospam.com)
Date: 06/30/04


Date: Tue, 29 Jun 2004 23:29:35 -0400

I think this really is not a database problem but something wrong with the
coe.

Following is a very simple piece of SQLJ:

     try
      {
 #sql [sqlj4context] sqlj4_iterator = {SELECT PHONENO FROM
   DB2ADM.EMPLOYEE WHERE WORKDEPT = 'D11'};
 
 while(sqlj4_iterator.next())
  {
   System.out.println(sqlj4_iterator.phoneno());
   if (sqlj4_iterator.phoneno() == "2890")
   {
    System.out.println("YES!!");
   }
  }
 sqlj4_iterator.close();
 #sql [sqlj4context] {COMMIT};
 sqlj4context.close();
      } catch (SQLException sqlexcp)

The output generated, as expected, consists of all the phone nos. (please
note that I am SELECTing PHONENOs in the query):

6423
4510
3782
2890
1682
2986
4501
0942
0672

So far, so good..but why is "YES" not produced in the output when phone
no. 2890 appears in the output? PHONENO is defined as CHAR(4) in the
table.

TIA
Raquel.