I'm going to take a wild guess and say that your returned result set is
transient, meaning that once the result set is out of scope, the data goes
away.  Data objects from queries usually aren't guaranteed to live past
the result set that they came from.

I don't know if that RowSetDynaBean actually creates actual data objects
from the returned data.  Using direct query results like that can be very
iffy and environment dependent.

To test this possiblity, you have two workarounds:

* Iterate the returned data set and populate a POJO for each row and put
the POJOs into your list instead of data objects returned directly from
the query.

* Embed your table within the scriptlet.  To do this, you might need to
not use the <jsp:scriptlet> tag and instead do:

<%
   try
   {
      List rows1= null;
      // Code to populate here
      rows1=resultSet.getRows();
      request.setAttribute("rows2",rows1);
%>
<display:table name="rows2" ...>
   ...
</display:table>
<%
   }
   catch ()
   {
      ...
   }
%>

Also, you're just setting the result set to null.  That is BAD BAD BAD. 
You always want to close your result sets and connections and you should
do it in a finally block:

ResultSet rs;
Connection conn;

try
{
   ...
}
catch()
{
   ...
}
finally
{
   if (rs != null)
   {
      rs.close();
   }
   if (conn != null)
   {
      conn.close();
   }
}

Or better yet, use something like Hibernate to manage ORB mappings or a
JDBC management framework or something...

SourceForge.net wrote:
>
> Read and respond to this message at:
> https://sourceforge.net/forum/message.php?msg_id=3809600
> By: buntyindia
>
> i want to display the content of my database usin DisplayTag
> Pagination...m
> using NetBeans5.5 with tomcat 5.5.16.
>
> Please Help....
>
>
> Following is my code....
>
> <jsp:scriptlet>
>         List rows1= null;
>
>         try {
>         ResultSet rs;
>         Statement stmt;
>         Class.forName("com.mysql.jdbc.Driver");
>
>
>         Connection conn =
> DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&amp;pass
> word=passit");
>
>         String sql = "SELECT * FROM gc";
>         stmt = conn.createStatement();
>         rs = stmt.executeQuery(sql);
>         RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
>
>         rows1=resultSet.getRows();
>         request.setAttribute("rows2",rows1);
>
>         String dd = resultSet.getName();
>
>         out.println(dd);//printing name
>         out.println(rows1);//printing content of rows
>
>         rs=null;
>         stmt=null;
>         } catch(Exception e) {
>         e.printStackTrace();
>         }
>
>
>     </jsp:scriptlet>
>
> When i run the above code it displays the following
>
> org.apache.commons.beanutils.RowSetDynaClass
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED]
>
> When i add
>
> <display:table name="rows1" />
>
> it display nothing found to display.
>
>
> Please help what i do?
>
>
> BuntyIndia
>
>
> ______________________________________________________________________
> You are receiving this email because you elected to monitor this forum.
> To stop monitoring this forum, login to SourceForge.net and visit:
> https://sourceforge.net/forum/unmonitor.php?forum_id=249318
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> displaytag-user mailing list
> displaytag-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>


-- 
Rick Herrick
[EMAIL PROTECTED]

I haven't got time for inner peace.

"No reasonable definition of reality could be expected to permit
this."--Albert Einstein, Boris Podolsky and Nathan Rosen in 1935


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to