Hi Jimmy,

>
> Use rs.next(). This returns false if it is empty.
>

well I just want to check on an empty rs and not move the pointer to the
first record.. but I rewrote the code to just use next()... I use 2
resultsets. one for my normal menu items and one for submenu items. If there
are no submenuitems the menu item is an action else it creates a pulldown
sub menu..
Now I tested it and the next() does work in a while loop but always fails
when used in an if statement.. :(( if I force it to enter the if() statement
by adding "|| true" the sub menus are created correctly (but then I loose my
action items ofcoz)..
I realy need this so I hope someone can help me out..

Anyway here is the code:

while (rs_item.next())
{
        sql = "SELECT * ... AND ParentID="+subFuncID;
        rs_subitem = s2.executeQuery(sql);

        if (rs_subitem.next())  //false if no results
        {
                "print submenu name"
                if (thisFuncID.equals(subFuncID))
                {
                        boolean loop=true;
                        while (loop)
                        {
                                "print submenu action item"
                                loop=rs_subitem.next();
                        }
                }
        }
        else    "print action item"
}



> Subject:        empty resultset
>
> Hi,
>
> I'm using the JDBC:ODBC bridge to access data in an
> access database.
> Can someone tell me how to check for an empty result set?
> If I use a rs.isBeforeFirst() call it gives me an
> UnsupportedOperationException..
> So it seems that some JDBC functions are not supported by
> the bridge
> :(
>
> Mark..

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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