1

Is there any simple way to get amount of data transferred from database to client using plain JDBC? DB's in question are Oracle, MSSQL and Firebird.

What I need is, that after executing statement I need to check, if the amount of data doesn't overflow at client side. Problem is, that the DB can contain BLOBs of variable size. So some data will fit, some not. I cannot change the DB structure and additional SQL query is not option too. I need it for testing purposes, to identify problematic use-cases.

So far I came with this pseudo-code solution:

   totalSize = 0;
   foreach(Result in ResultSet){
        totalSize = getFieldSizeInBytes();
   }

TL;DR: How to get exact number of bytes transferred from DB to client.

4

1 に答える 1

1

You can't do this from JDBC. You would either need to monitor traffic on the machine itself or introduce a proxy which does the monitoring for you.

于 2012-06-28T09:27:48.667 に答える