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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to