1 | public class IndexColumnInfoTab extends BasePreparedStatementTab↵ | | 1 | public class SequenceDetailsTab extends BasePreparedStatementTab↵
|
2 | {↵ | | 2 | {↵
|
3 | private static final StringManager s_stringMgr =↵ | | 3 | private static final StringManager s_stringMgr =↵
|
4 | StringManagerFactory.getStringManager(IndexColumnInfoTab.class);↵ | | 4 | StringManagerFactory.getStringManager(SequenceDetailsTab.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.columns=Columns]↵ | | 11 | // i18n[oracle.sequenceDetails=Details]↵
|
12 | String TITLE = s_stringMgr.getString("oracle.columns");↵ | | 12 | String TITLE = s_stringMgr.getString("oracle.sequenceDetails");↵
|
13 | // i18n[oracle.displayColumns=Display index column information]↵ | | 13 | // i18n[oracle.displaysSequenceDetails=Display sequence details]↵
|
14 | String HINT = s_stringMgr.getString("oracle.displayColumns");↵ | | 14 | String HINT = s_stringMgr.getString("oracle.displaysSequenceDetails");↵
|
15 | }↵ | | 15 | }↵
|
|
16 | /** SQL that retrieves the data. */↵ | | 16 | /** SQL that retrieves the data. */↵
|
17 | private static String SQL =↵ | | 17 | private static final String SQL =↵
|
18 | "select table_name, column_name, column_length, decode(descend, \'Y\', \'DESC\', \'ASC\')"↵ | | 18 | "select sequence_name, ↵
|
19 | + " from sys.all_ind_columns where index_owner = ?"↵ | | |
|
20 | + " and index_name = ?"↵ | | |
|
21 | + " order by column_position";↵ | | |
|
|
22 | public IndexColumnInfo↵ | | 19 | min_value, max_value, increment_by, cycle_flag,"↵
|
| | | 20 | + " order_flag, cache_size, last_number"↵
|
| | | 21 | + " from all_sequences"↵
|
| | | 22 | + " where sequence_owner = ?"↵
|
| | | 23 | + " and sequence_name = ?";↵
|
|
23 | Tab()↵ | | 24 | public SequenceDetailsTab()↵
|
24 | {↵ | | 25 | {↵
|
25 | super(i18n.TITLE, i18n.HINT);↵ | | 26 | super(i18n.TITLE, i18n.HINT, true);↵
|
26 | }↵ | | 27 | }↵
|
|
27 | protected PreparedStatement createStatement() throws SQLException↵ | | 28 | protected PreparedStatement createStatement() throws SQLException↵
|
28 | {↵ | | 29 | {↵
|
29 | ISession session = getSession();↵ | | 30 | ISession session = getSession();↵
|
30 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵ | | 31 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵
|
31 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵ | | 32 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵
|
32 | pstmt.setString(1, doi.getSchemaName());↵ | | 33 | pstmt.setString(1, doi.getSchemaName());↵
|
33 | pstmt.setString(2, doi.getSimpleName());↵ | | 34 | pstmt.setString(2, doi.getSimpleName());↵
|
34 | return pstmt | | 35 | return pstmt
|