title: How can I get size in bytes of a column from result set in java jdbc?
body: <pre><code>ResultSet res
  
  ResultSetMetaData rsmds= res.getMetaData();
  int size = rsmds.getColumnDisplaySize(i);
  </code></pre>
  
  <p>gives the width of a column, I want to get size of a column in bytes. How can I do this?</p>
  
  <p>Query for the result set:</p>
  
  <pre><code>SELECT * FROM LevelOne ORDER BY (SELECT NULL) OFFSET 0 ROWS FETCH NEXT 50000 ROWS ONLY;
  </code></pre>
  
  <p>create table query:</p>
  
  <pre><code>CREATE TABLE Q_680_6([Id] INT, [Title] NVARCHAR(MAX) DEFAULT '', [Description] VARCHAR(MAX) Dta_db.dbo.Q_680_6([Id] INT, [Title] NVARCHAR(MAX) DEFAULT '', [Description] VARCHAR(MAX) DEFAULT '', [StartDate] DATETIME DEFAULT NULL, [EndDate] DATETIME DEFAULT NULL, [Lead] NVARCHAR(MAX) DEFAULT '', [CreatedOn] DATETIME DEFAULT NULL, [CreatedBy] INT, [ModifiedOn] DATETIME DEFAULT NULL, [ModifiedBy] INT) END
  </code></pre>