Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Visual J++ v1.1 and jConnect

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-04-11 13:18:57.0Z
Victor DeLima Posted on 1997-04-11 13:18:57.0Z
Message-ID: <334E3A41.58B2@pcnet.com>
Date: Fri, 11 Apr 1997 09:18:57 -0400
From: Victor DeLima <vdelima@pcnet.com>
Reply-To: vdelima@pcnet.com
X-Mailer: Mozilla 3.01Gold (Win95; I)
MIME-Version: 1.0
Subject: Visual J++ v1.1 and jConnect
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 6
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:1034
Article PK: 252786

I am having problems comparing a column name to text
ex: if (rsmd.getColumnName(i) == "divName")
i have verified the contents of rsmd.getColumnName(i) and it does match
"divName" but the if still fails.
Any ideas?


Eric Giguere Posted on 1997-04-11 12:50:54.0Z
From: "Eric Giguere" <giguere@watcom.com>
Subject: Re: Visual J++ v1.1 and jConnect
References: <334E3A41.58B2@pcnet.com>
Organization: Sybase, Inc. (Waterloo)
Message-ID: <01bc4687$99422730$01831fac@giguere>
X-Newsreader: Microsoft Internet News 4.70.1161
Newsgroups: sybase.public.jdbcconnect
Date: Fri, 11 Apr 1997 08:50:54 -0400
Lines: 16
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:1033
Article PK: 252784


Victor DeLima <vdelima@pcnet.com> wrote in article
<334E3A41.58B2@pcnet.com>...
> I am having problems comparing a column name to text
> ex: if (rsmd.getColumnName(i) == "divName")
> i have verified the contents of rsmd.getColumnName(i) and it does match
> "divName" but the if still fails.
> Any ideas?

In Java '==' means object equality, i.e. two object references are exactly
equal. What you want is:

if( rsmd.getColumnName(i).equals( "divName" ) ){
}

Or even (this looks weird):

if( "divName".equals( rsmd.getColumnName(i) ) ){
}

Of course, I prefer the former :-)

Eric