Menu

How to get the value from RowSetDynaClass

Help
Ajanthan R
2006-12-05
2012-10-09
  • Ajanthan R

    Ajanthan R - 2006-12-05

    I am trying to get the value from RowSetDynaClass, but i am not getting the value. What am i doing wrong here?

    <%
    Connection con = ...; // just open a connection

      Statement stmt = con.createStatement();
      ResultSet rs = stmt.executeQuery(&quot;SELECT * from table&quot;);
      RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
      stmt.close();
      con.close();
      request.setAttribute(&quot;mylist&quot;, resultSet);
    

    %>

    <display table id="row" name="${mylist.rows}">
    <display:column title="row number" >
    <c:out value="${row_rowNum}"/>
    </display:column>
    <display:column title="name" >
    <c:out value="${row.first_name}"/>
    <c:out value="${row.last_name}"/>
    </display:column>
    </display:table>

     
    • courtenayt

      courtenayt - 2007-02-08

      Here is what worked for me. (Only difference was that I used a function to hide my creation of the RowSetDynaClass that I called new_ncs) The first column displays the sfdid value from the RowSetDynaClass and the second column, "View", is dynamically created - it wasn't in the original RowSetDynaClass, but I used the c:out function to create the link using the value from the RowSetDynaClass.

      <%
      RowSetDynaClass new_ncs = ActionViewTables.newNCTableSC(sdid_string);
      %>

      <% request.setAttribute("new_ncs_sc", new_ncs); %>

      <display:table name="requestScope.new_ncs_sc.rows" id="row">
      <display:column property="sfdid" title="ID" sortable="true"/>
      <display:column title="View">
      <a href="../displayView.jsp?sfdid=<c:out value="${row.sfdid}"/>">View</a>
      </display:column>
      </display:table>

       

Log in to post a comment.