You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Florian Theurich <fl...@wcp.de> on 2002/09/10 01:42:57 UTC

Counting the rows of a ResultSet

I had a serious Problem. I'm developing a JSP Tag Library in order to create
images like charts and tables from the content of a database. For achieving
this, I created two Tags, that connect to a database and create a ResultSet
with a certain query. The third Tag, the Chart-Tag,  should get the
ResultSet out of the PageContext and use it to create the chart or whatever.

Now the problem: To create the chart I need the number of rows, which are
read from the database. When I tried to create a scrollable ResultSet (in
the second tag, which is responsible for the exececution of the query) to
count the rows (in the Chart-Tag) and afterwards jump back to the first row
again, the result was an empty ResultSet, although the ResultSet's Type
(rs.getType()) was scrollable.

I hope, my bad Englisch did not prevent to make my problem undestandable.
It's really urgent. Does anybody know a solution?
Best regards

Florian Theurich


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Counting the rows of a ResultSet

Posted by Ryan Lubke <Ry...@Sun.COM>.
On Mon, 2002-09-09 at 19:42, Florian Theurich wrote:
> I had a serious Problem. I'm developing a JSP Tag Library in order to create
> images like charts and tables from the content of a database. For achieving
> this, I created two Tags, that connect to a database and create a ResultSet
> with a certain query. The third Tag, the Chart-Tag,  should get the
> ResultSet out of the PageContext and use it to create the chart or whatever.
> 
> Now the problem: To create the chart I need the number of rows, which are
> read from the database. When I tried to create a scrollable ResultSet (in
> the second tag, which is responsible for the exececution of the query) to
> count the rows (in the Chart-Tag) and afterwards jump back to the first row
> again, the result was an empty ResultSet, although the ResultSet's Type
> (rs.getType()) was scrollable.
> 
> I hope, my bad Englisch did not prevent to make my problem undestandable.
> It's really urgent. Does anybody know a solution?
> Best regards
> 
> Florian Theurich
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Counting the rows of a ResultSet

Posted by Henri Yandell <ba...@generationjava.com>.
This will be database specific I believe. Try writing some Java code away
from the Web container to test whether it works for you on that database
and solve the issue without adding the confusion of a web server.

Hen

On Tue, 10 Sep 2002, Florian Theurich wrote:

> I had a serious Problem. I'm developing a JSP Tag Library in order to create
> images like charts and tables from the content of a database. For achieving
> this, I created two Tags, that connect to a database and create a ResultSet
> with a certain query. The third Tag, the Chart-Tag,  should get the
> ResultSet out of the PageContext and use it to create the chart or whatever.
>
> Now the problem: To create the chart I need the number of rows, which are
> read from the database. When I tried to create a scrollable ResultSet (in
> the second tag, which is responsible for the exececution of the query) to
> count the rows (in the Chart-Tag) and afterwards jump back to the first row
> again, the result was an empty ResultSet, although the ResultSet's Type
> (rs.getType()) was scrollable.
>
> I hope, my bad Englisch did not prevent to make my problem undestandable.
> It's really urgent. Does anybody know a solution?
> Best regards
>
> Florian Theurich
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>