static String getDetailedTableDescription(Statement stmt, String table) throws SQLException {
    String extendedDescription = null;
    try (ResultSet rs = stmt.executeQuery("describe extended " + table)) {
      while (rs.next()) {
        String out = rs.getString(1);
        String tableInfo = rs.getString(2);
        if ("Detailed Table Information".equals(out)) { // from TextMetaDataFormatter
          extendedDescription = tableInfo;
        }
      }
    }
    return extendedDescription;
  }
Get Detailed Table Information via jdbc
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java