1 | public class IndexDetailsTab extends BasePreparedStatementTab↵ | | 1 | public class TriggerDetailsTab extends BasePreparedStatementTab↵
|
2 | {↵ | | 2 | {↵
|
3 | private static final StringManager s_stringMgr =↵ | | 3 | private static final StringManager s_stringMgr =↵
|
4 | StringManagerFactory.getStringManager(IndexDetailsTab.class);↵ | | 4 | StringManagerFactory.getStringManager(TriggerDetailsTab.class);↵
|
|
|
5 | /**↵ | | 5 | /**↵
|
6 | * This interface defines locale specific strings. This should be↵ | | 6 | * This interface defines locale specific strings. This should be↵
|
7 | * replaced with a property file.↵ | | 7 | * replaced with a property file.↵
|
8 | */↵ | | 8 | */↵
|
9 | private interface i18n↵ | | 9 | private interface i18n↵
|
10 | {↵ | | 10 | {↵
|
11 | // i18n[oracle.details=Details]↵ | | 11 | // i18n[oracle.triggerDetails=Details]↵
|
12 | String TITLE = s_stringMgr.getString("oracle.details");↵ | | 12 | String TITLE = s_stringMgr.getString("oracle.triggerDetails");↵
|
13 | // i18n[oracle.displayDetails=Display index details]↵ | | 13 | // i18n[oracle.displayTriggerDetails=Display trigger details]↵
|
14 | String HINT = s_stringMgr.getString("oracle.displayDetails");↵ | | 14 | String HINT = s_stringMgr.getString("oracle.displayTriggerDetails");↵
|
15 | }↵ | | 15 | }↵
|
|
16 | /** SQL that retrieves the data. */↵ | | 16 | /** SQL that retrieves the data. */↵
|
17 | private static final String SQL =↵ | | 17 | private static String SQL =↵
|
18 | "select index_type, tablespace_name, table_owner, table_nam↵ | | 18 | "select t.owner, t.trigger_name, t.trigger_type, t.triggering_event, t.table_owner, " +↵
|
19 | e, table_type, uniqueness"↵ | | 19 | " t.base_object_type, t.table_↵
|
20 | +" compression, initial_extent, next_extent, min_extents, max_extents,"↵ | | |
|
21 | +" pct_increase, pct_threshold, status, num_rows, last_analyzed"↵ | | |
|
22 | +" from sys.all_indexes where owner = ?"↵ | | |
|
23 | +" and index↵ | | 20 | name, t.column_name, " +↵
|
| | | 21 | " t.referencing_names, t.when_clause, t.status, t.description, t.action_type, o.status as validity " +↵
|
| | | 22 | " from sys.all_triggers t, user_objects o " +↵
|
| | | 23 | " where t.trigger_name = o.OBJECT_NAME " +↵
|
| | | 24 | " and t.owner = ? " +↵
|
24 | _name = ?";↵ | | 25 | " and t.trigger_name = ? ";↵
|
|
|
25 | public IndexDetailsTab()↵ | | 26 | public TriggerDetailsTab()↵
|
26 | {↵ | | 27 | {↵
|
27 | super(i18n.TITLE, i18n.HINT, true);↵ | | 28 | super(i18n.TITLE, i18n.HINT, true);↵
|
28 | }↵ | | 29 | }↵
|
|
29 | protected PreparedStatement createStatement() throws SQLException↵ | | 30 | protected PreparedStatement createStatement() throws SQLException↵
|
30 | {↵ | | 31 | {↵
|
31 | ISession session = getSession();↵ | | 32 | ISession session = getSession();↵
|
32 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵ | | 33 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵
|
33 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵ | | 34 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵
|
34 | pstmt.setString(1, doi.getSchemaName());↵ | | 35 | pstmt.setString(1, doi.getSchemaName());↵
|
35 | pstmt.setString(2, doi.getSimpleName());↵ | | 36 | pstmt.setString(2, doi.getSimpleName());↵
|
36 | return pstmt | | 37 | return pstmt
|