Revision: 6272
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6272&view=rev
Author: wis775
Date: 2011-05-25 19:12:16 +0000 (Wed, 25 May 2011)
Log Message:
-----------
Oracle Plugin: Added the ability to show the source of a index
Modified Paths:
--------------
trunk/sql12/doc/src/main/resources/changes.txt
trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/OraclePlugin.java
trunk/sql12/plugins/oracle/src/main/resources/net/sourceforge/squirrel_sql/plugins/oracle/tab/I18NStrings.properties
Added Paths:
-----------
trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexSourceTab.java
Modified: trunk/sql12/doc/src/main/resources/changes.txt
===================================================================
--- trunk/sql12/doc/src/main/resources/changes.txt 2011-05-24 00:56:09 UTC (rev 6271)
+++ trunk/sql12/doc/src/main/resources/changes.txt 2011-05-25 19:12:16 UTC (rev 6272)
@@ -7,6 +7,9 @@
Enhancements:
+Oracle Plugin:
+ The DDL of a index could be displayed under the source tab.
+
New plugin "WIKI table configurations":
This plugin provides some pre-defined configurations for various WIKI engines. With this configurations, Squirrel knows, how to transform the selection
of a result table into a WIKI table. At the moment, configurations for the following WIKI's are provided:
Modified: trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/OraclePlugin.java
===================================================================
--- trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/OraclePlugin.java 2011-05-24 00:56:09 UTC (rev 6271)
+++ trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/OraclePlugin.java 2011-05-25 19:12:16 UTC (rev 6272)
@@ -99,6 +99,7 @@
import net.sourceforge.squirrel_sql.plugins.oracle.tab.ConstraintSourceTab;
import net.sourceforge.squirrel_sql.plugins.oracle.tab.IndexColumnInfoTab;
import net.sourceforge.squirrel_sql.plugins.oracle.tab.IndexDetailsTab;
+import net.sourceforge.squirrel_sql.plugins.oracle.tab.IndexSourceTab;
import net.sourceforge.squirrel_sql.plugins.oracle.tab.InstanceDetailsTab;
import net.sourceforge.squirrel_sql.plugins.oracle.tab.LobDetailsTab;
import net.sourceforge.squirrel_sql.plugins.oracle.tab.ObjectSourceTab;
@@ -796,6 +797,7 @@
addDetailTab(objTree, DatabaseObjectType.INDEX, new DatabaseObjectInfoTab());
addDetailTab(objTree, DatabaseObjectType.INDEX, new IndexColumnInfoTab());
addDetailTab(objTree, DatabaseObjectType.INDEX, new IndexDetailsTab());
+ addDetailTab(objTree, DatabaseObjectType.INDEX, new IndexSourceTab());
addDetailTab(objTree, _objectTypes.getLob(), new DatabaseObjectInfoTab());
addDetailTab(objTree, _objectTypes.getLob(), new LobDetailsTab());
addDetailTab(objTree, DatabaseObjectType.SEQUENCE, new DatabaseObjectInfoTab());
Added: trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexSourceTab.java
===================================================================
--- trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexSourceTab.java (rev 0)
+++ trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexSourceTab.java 2011-05-25 19:12:16 UTC (rev 6272)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011 Stefan Willinger
+ * wi...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.plugins.oracle.tab;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseSourceTab;
+import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
+import net.sourceforge.squirrel_sql.fw.sql.ISQLConnection;
+import net.sourceforge.squirrel_sql.fw.util.StringManager;
+import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
+
+/**
+ * This class displays the source of a INDEX.
+ * @see http://www.dba-oracle.com/oracle_tips_dbms_metadata.htm
+ * @author Stefan Willinger
+ *
+ */
+public class IndexSourceTab extends BaseSourceTab {
+ private static final StringManager s_stringMgr =
+ StringManagerFactory.getStringManager(IndexSourceTab.class);
+
+ /** SQL that retrieves the source of a index
+ * @see http://www.dba-oracle.com/oracle_tips_dbms_metadata.htm
+ */
+ private static String SQL = "select dbms_metadata.get_ddl('INDEX',?,?) from dual";
+
+ public IndexSourceTab()
+ {
+ // i18n[oracle.showIndexSource=Show index source]
+ super(s_stringMgr.getString("oracle.showIndexSource"));
+ }
+
+ protected PreparedStatement createStatement() throws SQLException
+ {
+ final ISession session = getSession();
+ final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
+
+ ISQLConnection conn = session.getSQLConnection();
+ PreparedStatement pstmt = conn.prepareStatement(SQL);
+ pstmt.setString(1, doi.getSimpleName());
+ pstmt.setString(2, doi.getSchemaName());
+ return pstmt;
+ }
+}
Property changes on: trunk/sql12/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexSourceTab.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/sql12/plugins/oracle/src/main/resources/net/sourceforge/squirrel_sql/plugins/oracle/tab/I18NStrings.properties
===================================================================
--- trunk/sql12/plugins/oracle/src/main/resources/net/sourceforge/squirrel_sql/plugins/oracle/tab/I18NStrings.properties 2011-05-24 00:56:09 UTC (rev 6271)
+++ trunk/sql12/plugins/oracle/src/main/resources/net/sourceforge/squirrel_sql/plugins/oracle/tab/I18NStrings.properties 2011-05-25 19:12:16 UTC (rev 6272)
@@ -29,4 +29,5 @@
oracle.triggerColumns=Columns
oracle.triggerDetails=Details
oracle.userDetails=Details
+oracle.showIndexSource=Show index source
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|