tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David kerber <dcker...@verizon.net>
Subject Re: Tomcat 5.59 with jTDS, and SQL Server 2005
Date Tue, 20 Oct 2009 18:34:54 GMT
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.

>                         //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.

D


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


Mime
View raw message