tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guido Medina" <gu...@ns2.iiac.net>
Subject Re: Problems with ResultSet
Date Wed, 30 May 2001 05:37:36 GMT
It also happens with MS Access if your try to getType(int n), Type = {String
| Int | ...} more than once, it means that you cannot do the follow with MS
Access:

Statement st = con.createStatement();
ResultSet rs = st.executeQuery("......");
while (rs.next()) {
   out.println(String a = rs.getString(1));
   ...
   ...
   ...
   out.println(String a = rs.getString(1));
}

This should work in every database manager but doesn't work, you must do:
String a = rs.getString(1) and keep using a instead of try to get the value
again...

This happens with MS Access, I don't know if with some else database
manager...

Guido.
----- Original Message -----
From: "Moin Anjum H." <moinanjum@yahoo.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Wednesday, May 30, 2001 1:14 AM
Subject: Re: Problems with ResultSet


> Hi,
>
> Is your Database MSAccess?
>
> If yes then try Statement
s=cn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_O
NLY);
> for a full blown Explain Explaination Please go through Java Docs.
>
> HTH
> Best Regards
> Moin.
>
> Enrique Prados Valiente 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();
> >
> >               %><tr>
> >               <td><%=rs.getString(1)%></td><%
> >
> >            }
> >
> > (more code........)
> >
> > In begin of my JSP there is this code line <%@ page language="java"
import="java.sql.*,java.io.*,java.util.*" %>
> >
> > but when I run the server and JSP, it appears this error
> >
> >         [Microsoft][ODBC Driver Manager] Invalid cursor state
> >
> > I think that Jsp fails in this code line,
<td><%=rs.getString(1)%></td><%
> >
> >
> > Can anyone out there help me?
> > Thanks in advance,
> > Enrique.
>


Mime
View raw message