Subject Re: [Firebird-Java] getUpdateCount Problem
Author Gonzalo Odiard
I am replying me because nobody hes responded and i don t know if this
is the wrong list or what.
Shortly firebirdsql 1.5.5 returns -1 ever when do getUpdateCount()
(version 1.0.0 work ok)
Is this a bug?
The solution proposed is correct?
Thanks

Gonzalo

Gonzalo Odiard wrote:

>We have a problem with an application in a JBoss, this is using
>firebirdsql.rar 1.0.0
>Trying to resolve this, we have changed to version 1.5.5 but have the
>following problem:
>Our application make a massive importation.
>We make a update and if getUpdateCount <= 0 make a insert. We are
>reusing PreparedStatements.
>This work in version 1.0.0, but in 1.5.5 not, (getUpdateCout returns -1)
>We have modified AbstractStatement. getUpdateCount() and its working,
>but we don t know if there are another situation when this is not correct.
>
> public int getUpdateCount() throws SQLException {
>// if (isResultSet || !hasMoreResults) { // we changed
>this line
> if (isResultSet) {
> return -1;
> }
> else {
> try {
> c.getSqlCounts(fixedStmt);
> int insCount = fixedStmt.getInsertCount();
> int updCount = fixedStmt.getUpdateCount();
> int delCount = fixedStmt.getDeleteCount();
> int resCount = ((updCount>delCount) ? updCount:delCount);
> resCount = ((resCount>insCount) ? resCount:insCount);
> return resCount;
> }
> catch (GDSException ge) {
> throw new FBSQLException(ge);
> } finally {
> hasMoreResults = false;
> }
> }
> }
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>