我们需要在 Eclipse 中从 SQL Server 2005 中获取表名而不是 referenced_object_id。它是这样做的,但没有得到表名:
Statement smt = con.createStatement();
smt.executeQuery("SELECT * from table_references");
ResultSet rs = smt.getResultSet();
while (rs.next()) {
String column1 = rs.getString("referenced_object_id");
String column2 = rs.getString("name");
String column3 = rs.getString("parent_column_id");
String column4 = rs.getString("referenced_column_id");
String sql = "SELECT name from sys.tables WHERE object_id='" + column1 + "'";
System.out.println(column1 + " | " + column2 + " | " + column3 + " | " + column4);