Is it possible to know the size of a dataset returned by a SQL statement in bytes
It would be nice if from the query itself I can get the size of the data. I found something like using SQL Plus, but I could not use that in my Java codes.
I know there maybe ways in doing it Java, can anyone guide me on how can I do that.
Thanks in advance.
Docs:
ResultSetis not a collection, it is merely an abstraction of the cursor that is being used to get the data in a row-wise manner.So, what exactly do need? The amount of memory needed to store the result? The size of the data in the database? …? Why would it be nice?
You can always do
SELECT COUNT(*) FROMand using a certain average size of row estimate the result size… Instead of using theSELECT COUNT(*)you can use a more convoluted way: go to the last elementResultSet.last()and get the row number:ResultSet.getRow().