java - how to know the data size returned from mysql server with connector-j -


i using mysql connector-j java perform query. know size of data returned when use with/without compression.
best way obtain total amount of data passed server client?

the code using works preparedstatement , resultset:

preparedstatement preparedstatement = connection.preparestatement(sql); rs = preparedstatement.executequery(); while (rs.next()) {     function.apply(rs); } 

can obtain amount of data in java?
there external way it?

you can make that:

stringbuffer sb = new stringbuffer();  while (rs.next()) {     function.apply(rs);     sb.append(<your_data>); }  double len = sb.tostring().length() / 1024; 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -