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.

Problems when calling stored procedures

2 posts in QAnywhere Last posting was on 2005-03-20 03:46:05.0Z
Edgar Rodriguez Posted on 2005-03-19 18:25:44.0Z
Sender: 3d6e.423156a7.1804289383@sybase.com
From: Edgar Rodriguez
Newsgroups: ianywhere.public.sqlanywhere.qanywhere
Subject: Problems when calling stored procedures
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <423c6ea8.5f2a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 19 Mar 2005 10:25:44 -0800
X-Trace: forums-1-dub 1111256744 10.22.241.41 (19 Mar 2005 10:25:44 -0800)
X-Original-Trace: 19 Mar 2005 10:25:44 -0800, 10.22.241.41
Lines: 42
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.sqlanywhere.qanywhere:86
Article PK: 10441

When executing any stored procedure from an application
developed in Java using driver of connection provided by the
application jConnect 5.5 (jconn2.jar) happens that the
method getUpdateCount() of the CallableStatement class never
returns value -1 by that an exception goes off.

The code that I use in the Java application he is the
following one:

public void displayRows( CallableStatement stmt)
throws SQLException
{

boolean results = stmt.execute();
int rsnum = 0; // Number of Result
Sets processed
int rowsAffected = 0;
do
{
if(results)
{
ResultSet rs = stmt.getResultSet();
output("\n\nDisplaying ResultSet: " + rsnum
+ "\n");
dispResultSet(rs);
rsnum++;
rs.close();
}
else
{
rowsAffected = stmt.getUpdateCount();
if (rowsAffected >= 0)
output(rowsAffected + " rows Affected.\n");
}
results = stmt.getMoreResults();
}
while (results || rowsAffected != -1);

}

I thank for any information of how it could to be solved
east problem.


Chris Keating (iAnywhere Solutions) Posted on 2005-03-20 03:46:05.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.sqlanywhere.qanywhere
References: <423c6ea8.5f2a.1681692777@sybase.com>
Subject: Re: Problems when calling stored procedures
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: cpe001217e36468-cm012059936305.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpe001217e36468-cm012059936305.cpe.net.cable.rogers.com
Message-ID: <423cf1fd@forums-1-dub>
Date: 19 Mar 2005 19:46:05 -0800
X-Trace: forums-1-dub 1111290365 24.112.219.40 (19 Mar 2005 19:46:05 -0800)
X-Original-Trace: 19 Mar 2005 19:46:05 -0800, cpe001217e36468-cm012059936305.cpe.net.cable.rogers.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.sqlanywhere.qanywhere:87
Article PK: 10439

This is a qanywhere newsgroup. You should
move this question to either sybase.public.jconnect or
sybase.public.sqlanywhere.general.


--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

*****************************************************************************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

*****************************************************************************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

*****************************************************************************

<Edgar Rodriguez> wrote in message
news:423c6ea8.5f2a.1681692777@sybase.com...
> When executing any stored procedure from an application
> developed in Java using driver of connection provided by the
> application jConnect 5.5 (jconn2.jar) happens that the
> method getUpdateCount() of the CallableStatement class never
> returns value -1 by that an exception goes off.
>
> The code that I use in the Java application he is the
> following one:
>
> public void displayRows( CallableStatement stmt)
> throws SQLException
> {
>
> boolean results = stmt.execute();
> int rsnum = 0; // Number of Result
> Sets processed
> int rowsAffected = 0;
> do
> {
> if(results)
> {
> ResultSet rs = stmt.getResultSet();
> output("\n\nDisplaying ResultSet: " + rsnum
> + "\n");
> dispResultSet(rs);
> rsnum++;
> rs.close();
> }
> else
> {
> rowsAffected = stmt.getUpdateCount();
> if (rowsAffected >= 0)
> output(rowsAffected + " rows Affected.\n");
> }
> results = stmt.getMoreResults();
> }
> while (results || rowsAffected != -1);
>
> }
>
> I thank for any information of how it could to be solved
> east problem.