Bug #13586 | getTables() does not handle VIEWS properly | ||
---|---|---|---|
Submitted: | 28 Sep 2005 21:35 | Modified: | 30 Sep 2005 13:45 |
Reporter: | Thomas Kellerer | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 3.2 alpha | OS: | Windows (Windows 2000) |
Assigned to: | CPU Architecture: | Any |
[28 Sep 2005 21:35]
Thomas Kellerer
[30 Sep 2005 8:30]
Vasily Kishkin
Could you please provide full text of test case ?
[30 Sep 2005 8:40]
Thomas Kellerer
Well it's quite simple. Connect to a database which contains tables and views. Then for case 1) do: DatabaseMetaData meta = con.getMetaData(); rs = meta.getTables(null, null, null, new String[] { "TABLE"} ); while (rs.next()) { String name = rs.getString("TABLE_NAME"); String type = rs.getString("TABLE_TYPE"); System.out.println("Table=" + name + ", type=" + type); } Note that it returns views as well but does report the type "TABLE" for them. According to the JDBC specs, this should only return objects of type TABLE For case 2) use rs = meta.getTables(null, null, null, new String[] { "VIEW"} ); This returns tables and views, but should only return views. The type column is correct though. You can run the same program with 3.1.10 and see the difference (3.1.10 works correctly).
[30 Sep 2005 13:45]
Mark Matthews
The 3.2 branch will not be released as a product. You can switch to the latest 3.1 which doesn't have this issue, and supports VIEWs in database metadata calls.