项目需要将数据库字段的注释取出来,数据库oracle10g
代码如下:
ResultSet rs =databaseMetaData.getColumns(null,Utils.getSchemaName().toUpperCase(),Utils.getTableName().toUpperCase(),"%");
while(rs.next()){
     System.out.println(rs.getString("REMARKS"));
}


这样打印会是null,取不到comments
需要在连接的时候加一个属性
 (红色的)

Class.forName(driver); // 载入驱动程式类别
Properties props = new Properties();
props.put("user", user);
props.put("password", password);
props.put("remarksReporting","true");
conn = DriverManager.getConnection(url, props);