views:

488

answers:

2

How to get the size(in bytes) of the given ResultSet within the java code. Is there any direct way to find out?

A: 

You will need to use a network stack monitoring tool to intercept and record the network packets sent and received between your application and the database.

Software Monkey
+1  A: 

Hm, I'm not even sure there is a well-defined answer. A ResultSet is just an abstraction for a database concept (usually it wraps a DB cursor). What is the size even supposed to be? The total amount of data fetched by the last query? Do you want the amount of bytes sent over the network? The amount of memory needed to store the results?

I think you should go back a step and tell us what your underlying requirement is. Then you might actually get an answer :-).

sleske
I want the amount of memory that is used to store the results in the ResultSet object.
Bhaskara Krishna Mohan Potam