tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ULS Tech Support <tech_supp...@uls.com>
Subject Re: Tomcat 5.59 with jTDS, and SQL Server 2005
Date Tue, 20 Oct 2009 18:49:25 GMT
Hi David,



--------------------------------------------------
From: "David kerber" <dckerber@verizon.net>
Sent: Tuesday, October 20, 2009 12:34 PM
To: "Tomcat Users List" <users@tomcat.apache.org>
Subject: Re: Tomcat 5.59 with jTDS, and SQL Server 2005

> ULS Tech Support wrote:
>> Hi there,
>>
>> Let's try this again...
>>
>> I am using Tomcat 5.5.9, using jTDS, with SQL Server 2005 i am getting 
>> this issue.
>>
>> 2009/10/16 10:47:15 - sql exception:java.sql.SQLException: No current row 
>> in the ResultSet.
>>
>> This issue doesn't happen with TWFreeTDS (in fact, when i switch to
>> twfreetds it works fine).. but from my research so far, i may have been
>> wrong in the way i implemented it.
>>
>> Here is the code.
>>
>
> ...
>
>>                     while (dbResultSet.next()) {
>
> Have you verified that you're getting here?  The .next() should
> essentially guarantee that you are on a valid row.

I'm not actually getting to this point... it stops back when i try and get 
the data from the first resultset.

 try {
                rs_info = call.getResultSet();

                //Save the total number of records (value) in
queryPagedRecords
                queryPagedRecords = rs_info.getInt("TotalRec");
                queryPagedMore = rs_info.getInt("MoreRecords");
                nLowestID = rs_info.getInt("FirstRec");
                nHighestID = rs_info.getInt("LastRec");

It stops at the first line, queryPagedRecords = rs_info.getInt("TotalRec");

>
>>                         //System.out.println("2: " + 
>> dbResultSet.getInt("ID"));
>>                         rc = true;
>>
>>                         //Set the items object based on the resultset.
>>                         temp = this.setItemsObject(true, dbResultSet);
>>
>>                         dbRecords.addElement(temp);
>>                     }
>>                 }
>>             } catch (SQLException e) {
>>                 System.out.println("SQLException: " + e);
>>                 System.out.println("SQLException Message: " + 
>> e.getMessage());
>>             } finally {
>>                 rs_info = null;
>>                 temp = null;
>>                 dbResultSet = null;
>>             }
>>             System.out.println("end");
>>         }
>>
>>         return dbRecords;
>>     }
>>
>> Basically i'm getting the resultsets, but i'm not able to pull the data 
>> from
>> the resultsets as i get the error when i try and getInt.
>>
>> Does anyone have any clue on why this is happening, or how i can make 
>> this
>> work?
>>
>> I did try and modify the code to the following to see if it helped, but
>> again, i'm still stumped on HOW to retrieve the data from the resultsets.
>
> The first thing I'd suggest would be to eliminate the handling of
> multiple resultsets until you can verify that you can read a single one.
>  Your code above is pretty much what I do, but I don't use SQL SErver.

The majority of the other webpages are set up as a single resultset, which 
do work :)  It is only when i have multiple results sets.

Thanks for answering, i appreciate this.



>
> D
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message