1 | public class PrimaryKeyTab extends BaseTableTab↵ | | 1 | public class TablePriviligesTab extends BaseTableTab↵
|
2 | {↵ | | 2 | {↵
|
3 | ↵ | | 3 | ↵
|
4 | /** Internationalized strings for this class. */↵ | | 4 | /** Internationalized strings for this class. */↵
|
5 | private static final StringManager s_stringMgr =↵ | | 5 | private static final StringManager s_stringMgr =↵
|
6 | StringManagerFactory.getStringManager(PrimaryKeyTab.class);↵ | | 6 | StringManagerFactory.getStringManager(TablePriviligesTab.class);↵
|
| | | 7 | ↵
|
| | | 8 | private int[] columnIndices = new int[] { 5, 6, 7, 4 };↵
|
7 | ↵ | | 9 | ↵
|
8 | /**↵ | | 10 | /**↵
|
9 | * Return the title for the tab.↵ | | 11 | * Return the title for the tab.↵
|
10 | *↵ | | 12 | *↵
|
11 | * @return The title for the tab.↵ | | 13 | * @return The title for the tab.↵
|
12 | */↵ | | 14 | */↵
|
13 | public String getTitle()↵ | | 15 | public String getTitle()↵
|
14 | {↵ | | 16 | {↵
|
15 | //i18n[PrimaryKeyTab.title=Primary Key]↵ | | 17 | //i18n[TablePriviligesTab.title=Privileges]↵
|
16 | return s_stringMgr.getString("PrimaryKeyTab.title");↵ | | 18 | return s_stringMgr.getString("TablePriviligesTab.title");↵
|
17 | }↵ | | 19 | }↵
|
|
18 | /**↵ | | 20 | /**↵
|
19 | * Return the hint for the tab.↵ | | 21 | * Return the hint for the tab.↵
|
20 | *↵ | | 22 | *↵
|
21 | * @return The hint for the tab.↵ | | 23 | * @return The hint for the tab.↵
|
22 | */↵ | | 24 | */↵
|
23 | public String getHint()↵ | | 25 | public String getHint()↵
|
24 | {↵ | | 26 | {↵
|
25 | //i18n[PrimaryKeyTab.hint=Show primary key for the selected table] ↵ | | 27 | //i18n[TablePriviligesTab.hint=Show access rights for the selected table]↵
|
26 | return s_stringMgr.getString("PrimaryKeyTab.hint");↵ | | 28 | return s_stringMgr.getString("TablePriviligesTab.hint");↵
|
27 | }↵ | | 29 | }↵
|
|
28 | /**↵ | | 30 | /**↵
|
29 | * Create the <TT>IDataSet</TT> to be displayed in this tab.↵ | | 31 | * Create the <TT>IDataSet</TT> to be displayed in this tab.↵
|
30 | */↵ | | 32 | */↵
|
31 | protected IDataSet createDataSet() throws DataSetException↵ | | 33 | protected IDataSet createDataSet() throws DataSetException↵
|
32 | {↵ | | 34 | {↵
|
33 | final ISQLConnection conn = getSession().getSQLConnection();↵ | | 35 | final SQL↵
|
34 | IDataSet result = null;↵ | | |
|
35 | SQLDatabaseMetaData md = conn.getSQLMetaData↵ | | 36 | DatabaseMetaData md = ↵
|
| | | 37 | getSession().getSQLConnection().getSQLMetaData();↵
|
36 | ();↵ | | 38 | ITableInfo ti = getTableInfo();↵
|
37 | result = md.getPrimaryKey(getTableInfo(),↵ | | 39 | return md.get↵
|
38 | new int[] { 6, 5, 4 },↵ | | |
|
39 | true);↵ | | |
|
40 | return result;↵ | | 40 | TablePrivilegesDataSet(ti, columnIndices, true);↵
|
41 | | | 41 |
|