Bug #82251 Table comments and schema are not returned in DatabaseMetaData
Submitted: 15 Jul 2016 16:43 Modified: 18 Jul 2016 13:52
Reporter: Lisa Cabrera Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.39 OS:Any
Assigned to: CPU Architecture:Any

[15 Jul 2016 16:43] Lisa Cabrera
Description:
DBMD.getTables()->REMARKS is blank
DBMD.getTables()->TABLE_SCHEM is null

When looking up this information via SQL query, the information is found. But it is not returned by the JDBC driver.
SQL query:
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = <myTable>;

How to repeat:
1 - Create a table with a comment:

create table <myTable> (col_int int comment 'my col_int description', col2_year year) comment 'table description';

2 - Retrieve the metadata information about the table. Here's some sample Java code:
---------------------
ResultSet rsmd3 = dm.getTables(null, null, tableName, null);
while(rsmd3.next())
{
     System.out.println("TABLE_SCHEM="+rsmd3.getString("TABLE_SCHEM"));
     System.out.println("TABLE_NAME="+rsmd3.getString("TABLE_NAME"));
     System.out.println("TABLE_TYPE="+rsmd3.getString("TABLE_TYPE"));
     System.out.println("REMARKS="+rsmd3.getString("REMARKS"));           
}
---------------------

Suggested fix:
Return relevant information for DBMD.getTables()->REMARKS and
DBMD.getTables()->TABLE_SCHEM
[18 Jul 2016 4:40] Chiranjeevi Battula
Hello  Lisa Cabrera,

Thank you for the bug report.
This is most likely duplicate of Bug #80473, please see Bug #80473.

Thanks,
Chiranjeevi.