Hi guys,

I have a problem with the resultSets, when i made the getObject method
more than one time...example:

String temp="";
String depto="";

String paisd=(String)rst_loc.getObject("PAIS_ORIGEN"); <--may be here


while (rst_loc_hasData)
{

            temp = (String)rst_loc.getObject("PAIS_ORIGEN"); <--here is the
problem

                while (paisd.equals(temp))
           {

                        depto=(String)rst_loc.getObject("DEPARTAMENTO");
                        %>
                        listB.addOptions(<%=paisd%>,<%=depto%>,<%=depto%>);
<-- my JavaScript function
                        <%
                        rst_loc_hasData = rst_loc.next();
                        paisd=(String)rst_loc.getObject("PAIS_ORIGEN");
                }
}
rst_loc.close();
rst_loc = Statementrst_loc.executeQuery();
rst_loc_hasData = rst_loc.next();
rst_loc_isEmpty = !rst_loc_hasData;
%>

I don't know why... and is the same thing when i am populate a listbox



<%
                        String pais = "";                <-- I have to
declare this variables because i can't use getObject method
String pais_iso = "";
                        while (rst_paises_hasData)
                        {
                                pais = (String)rst_paises.getObject("PAIS");
                                pais_iso =
(String)rst_paises.getObject("PAIS_ORIGEN");
                        %>
                      <option value="<%=pais_iso%>"><%=pais%></option>
<-- i must can put(String)rst_paises.getObject("PAIS_ORIGEN") directly
          <%
                                rst_paises_hasData = rst_paises.next();
                        }
                        rst_paises.close();
                        rst_paises = Statementrst_paises.executeQuery();
                        rst_paises_hasData = rst_paises.next();
                        rst_paises_isEmpty = !rst_paises_hasData;
                %>


Thanks a lot friends..!!

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to