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.

iODBC 9.0.2.3850 getString(col1) and getInt(col1) throws "No data found" exception

3 posts in General Discussion (old) Last posting was on 2009-11-05 13:22:31.0Z
André Schild Posted on 2009-11-04 19:16:11.0Z
From: =?ISO-8859-15?Q?Andr=E9_Schild?= <a.schild@aarboard.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.6pre) Gecko/20091103 Shredder/3.0pre
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
Subject: iODBC 9.0.2.3850 getString(col1) and getInt(col1) throws "No data found" exception
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af1d2fb@forums-1-dub>
Date: 4 Nov 2009 11:16:11 -0800
X-Trace: forums-1-dub 1257362171 10.22.241.152 (4 Nov 2009 11:16:11 -0800)
X-Original-Trace: 4 Nov 2009 11:16:11 -0800, vip152.sybase.com
Lines: 26
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:312
Article PK: 866745

Hello,

I have the following java code:

String v1= rs.getString("Column1");
if (v1 != null)
{
int i= rs.getInteger("Column1");
}

With the jConnect driver this works fine,
but when we try to use the iODBC driver (9.0.2.3850)
then at the getInteger call, a "No data found" SQLException is thrown.

Questions:

- Is the iODBC behaviour correct (Defined where?)
- Is there a way to tell iODBC to accept such calls
- Is there another way to find out if a int/bit etc. column is NULL from
the resultset


Thanks a lot.


André


André Schild Posted on 2009-11-05 13:22:31.0Z
From: =?ISO-8859-15?Q?Andr=E9_Schild?= <a.schild@aarboard.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.6pre) Gecko/20091103 Shredder/3.0pre
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
Subject: Re: iODBC 11.0.1.2044 and 9.0.2.3850 getString(col1) and getInt(col1) throws "No data found" exception
References: <4af1d2fb@forums-1-dub>
In-Reply-To: <4af1d2fb@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af2d197@forums-1-dub>
Date: 5 Nov 2009 05:22:31 -0800
X-Trace: forums-1-dub 1257427351 10.22.241.152 (5 Nov 2009 05:22:31 -0800)
X-Original-Trace: 5 Nov 2009 05:22:31 -0800, vip152.sybase.com
Lines: 46
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:314
Article PK: 866743

I did just check this, and it also accurs with jODBC included in SQL
Anywhere 11.0.1.2044

It seems that the jODBC driver has a problem when a field is read twice,
but with another data type.

For example:

rs.getObject("Column1");
rs.getString("Column1");


All the jConnect drivers don't have this problem....

André

Any Ideas on this topic ?

Am 04.11.2009 20:16, schrieb André Schild:

> Hello,
>
> I have the following java code:
>
> String v1= rs.getString("Column1");
> if (v1 != null)
> {
> int i= rs.getInteger("Column1");
> }
>
> With the jConnect driver this works fine,
> but when we try to use the iODBC driver (9.0.2.3850)
> then at the getInteger call, a "No data found" SQLException is thrown.
>
> Questions:
>
> - Is the iODBC behaviour correct (Defined where?)
> - Is there a way to tell iODBC to accept such calls
> - Is there another way to find out if a int/bit etc. column is NULL from
> the resultset
>
>
> Thanks a lot.
>
>
> André


André Schild Posted on 2009-11-04 19:43:53.0Z
From: =?ISO-8859-15?Q?Andr=E9_Schild?= <a.schild@aarboard.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.6pre) Gecko/20091103 Shredder/3.0pre
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
Subject: Re: iODBC 9.0.2.3850 getString(col1) and getInt(col1) throws "No datafound" exception
References: <4af1d2fb@forums-1-dub>
In-Reply-To: <4af1d2fb@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af1d979$1@forums-1-dub>
Date: 4 Nov 2009 11:43:53 -0800
X-Trace: forums-1-dub 1257363833 10.22.241.152 (4 Nov 2009 11:43:53 -0800)
X-Original-Trace: 4 Nov 2009 11:43:53 -0800, vip152.sybase.com
Lines: 17
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:313
Article PK: 866744

Ok,

I found one answer already:


Am 04.11.2009 20:16, schrieb André Schild:

> - Is there another way to find out if a int/bit etc. column is NULL from
> the resultset
>

rs.getInteger(...);
rs.wasNull();

tells us if the last read column/field had a NULL value.

André