Result set

From: Sami Mohammed (SMOHAMME..ndependenthealth.com)
Date: Mon Mar 14 2005 - 16:02:19 EST

  • Next message: Todd O'Bryan: "Re: getting a List of Comparables, feature request?"

    Hi

    How to convert the below jdbc code to cayenne.
    I want to display the table value in the <option > tag with label and value

    CODE:
    Vector vMappingNames = new Vector();
    String formFieldAll = getResources(request).getMessage("forms.select.all");

    ResultSet rs = prepStmt.executeQuery();

                            // Fill the vector with Display Mapping Names
                            if (rs.first())
                            {
                                    vMappingNames.add(new TableLableValueBean("- All Mapping Names -", formFieldAll));
                                    rs.beforeFirst();
                                                                   // List resultList =context.performQuery(Cw_Table.class);

                                    while (rs.next()) --->HOW TO CONVERT THE FOLLOWING CODE IN CAYENNE, or iterate
                                    {
                                            String tableName = rs.getString("TABLE_NAME");
                                            vMappingNames.add(new TableLableValueBean(tableName, tableName));
                                    }

                            }

                            rs.close();

                                                       // Set the Result Collections
                            if (!vMappingNames.isEmpty())
                            {
                                    request.setAttribute("MappingNames", vMappingNames);
                                    
                            }

    jsp page:

                                                                                      <logic:present name="MappingNames">
                                                    <html:select name="errorFilterForm" property="tableNameValue">
                                                            <html:options collection="MappingNames"
                                                                    labelProperty="tableNameLabel" property="tableNameValue" />
                                                    </html:select>
                                            </logic:present>

    Thanks in Advance

    Sami

    CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State
    confidentiality laws rules and regulations. This e-mail and attachments, if any, are intended for the designated addressee only. If you are not the designated addressee, you
    are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you
    have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your
    computer. Thank you for your attention



    This archive was generated by hypermail 2.0.0 : Mon Mar 14 2005 - 16:02:44 EST