01: package org.jsqltool.gui.tableplugins.indexes;
02:
03: import javax.swing.*;
04: import javax.swing.table.*;
05: import org.jsqltool.conn.DbConnectionUtil;
06:
07: /**
08: * <p>Title: JSqlTool Project</p>
09: * <p>Description: This implementation defines indexes panel for Oracle databases.
10: * </p>
11: * <p>Copyright: Copyright (C) 2006 Mauro Carniel</p>
12: *
13: * <p> This file is part of JSqlTool project.
14: * This library is free software; you can redistribute it and/or
15: * modify it under the terms of the (LGPL) Lesser General Public
16: * License as published by the Free Software Foundation;
17: *
18: * GNU LESSER GENERAL PUBLIC LICENSE
19: * Version 2.1, February 1999
20: *
21: * This library is distributed in the hope that it will be useful,
22: * but WITHOUT ANY WARRANTY; without even the implied warranty of
23: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24: * Library General Public License for more details.
25: *
26: * You should have received a copy of the GNU Library General Public
27: * License along with this library; if not, write to the Free
28: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29: *
30: * The author may be contacted at:
31: * maurocarniel@tin.it</p>
32: *
33: * @author Mauro Carniel
34: * @version 1.0
35: */
36: public class OracleIndexes implements Indexes {
37:
38: private DbConnectionUtil dbConnUtil = null;
39:
40: public OracleIndexes(DbConnectionUtil dbConnUtil) {
41: this .dbConnUtil = dbConnUtil;
42: }
43:
44: public String getQueryIndexes(String tableName) {
45: if (tableName.indexOf(".") > -1)
46: tableName = tableName.substring(tableName.indexOf(".") + 1);
47: return "SELECT i.index_name, i.uniqueness, c.column_name, i.status, "
48: + " c.column_position, i.owner, c.table_name, c.descend, i.partitioned "
49: + "FROM all_ind_columns c, all_indexes i "
50: + "WHERE c.index_owner = i.owner "
51: +
52: // "AND i.table_owner = :ownname "+
53: "AND c.index_name = i.index_name "
54: + "AND i.table_name = '"
55: + tableName
56: + "' "
57: + "ORDER BY 1, 4 ";
58: }
59:
60: }
|