tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Cheesman <jch...@msl.es>
Subject Re: Problems with ResultSet
Date Tue, 29 May 2001 13:27:01 GMT
At 03:01 PM 29/05/01, you wrote:

>Hi!
>I'm using Tomcat and JSP but there are problem, my JSP don' work.....
>I have this code in my JSP
>(code.....)
>Statement 
>s=cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
>
>(more code........)
>
>
>            if (!rs.isFirst()) rs.previous();


Is there any particular reason you're going backwards through the result 
set? Wouldn't it be more efficient/logical to use rs.next()?

<snip>

>         [Microsoft][ODBC Driver Manager] Invalid cursor state


Try something like:
if (rs.next()) {
   <%= rs.getString(1) %>
}



Salud2.
Jim




--

                           *   Jim Cheesman   *
             Trabajo: 
jchees@msl.es - (34)(91) 724 9200 x 2360
              Not only am I 
redundant and superfluous, but I
                also tend to use more 
words than necessary.



Mime
View raw message