public class IndexColumnInfoTab extends BasePreparedStatementTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(IndexColumnInfoTab.class); /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { // i18n[oracle.columns=Columns] String TITLE = s_stringMgr.getString("oracle.columns"); // i18n[oracle.displayColumns=Display index column information] String HINT = s_stringMgr.getString("oracle.displayColumns"); } /** SQL that retrieves the data. */ private static String SQL = "select table_name, column_name, column_length, decode(descend, \'Y\', \'DESC\', \'ASC\')" + " from sys.all_ind_columns where index_owner = ?" + " and index_name = ?" + " order by column_position"; public IndexColumnInfoTab() { super(i18n.TITLE, i18n.HINT); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
public class TriggerColumnInfoTab extends BasePreparedStatementTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(TriggerColumnInfoTab.class); /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { // i18n[oracle.triggerColumns=Columns] String TITLE = s_stringMgr.getString("oracle.triggerColumns"); // i18n[oracle.displayTriggerColumns=Display trigger column information] String HINT = s_stringMgr.getString("oracle.displayTriggerColumns"); } /** SQL that retrieves the data. */ private static String SQL = "select table_owner, table_name, column_name, column_list, column_usage" + " from sys.all_trigger_cols where trigger_owner = ?" + " and trigger_name = ?"; public TriggerColumnInfoTab() { super(i18n.TITLE, i18n.HINT); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexColumnInfoTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/TriggerColumnInfoTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class IndexColumnInfoTab extends BasePreparedStatementTab
1
public class TriggerColumnInfoTab 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(TriggerColumnInfoTab.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.triggerColumns=Columns]
12
		String TITLE = s_stringMgr.getString("oracle.columns");
12
		String TITLE = s_stringMgr.getString("oracle.triggerColumns");
13
		// i18n[oracle.displayColumns=Display index column information]
13
		// i18n[oracle.displayTriggerColumns=Display trigger column information]
14
		String HINT = s_stringMgr.getString("oracle.displayColumns");
14
		String HINT = s_stringMgr.getString("oracle.displayTriggerColumns");
15
	}
15
	}
16
	/** SQL that retrieves the data. */
16
	/** SQL that retrieves the data. */
17
	private static String SQL =
17
	private static String SQL =
18
            "select table_name, column_name, column_length, decode(descend, \'Y\', \'DESC\', \'ASC\')"
18
		"select table_owner, table_name, column_name, column_l
19
            
19
ist, column_usage"
20
+ " from sys.all_ind_columns where index_owner = ?"
20
			+ " from sys.all_trigger_cols where trigger_owner = ?"
21
            + " and index_name = ?"
21
			+ " and trigger_name = ?"
22
            + " order by column_position";
22
;
23
	public IndexColumnInfoTab()
23
	public TriggerColumnInfoTab()
24
	{
24
	{
25
		super(i18n.TITLE, i18n.HINT);
25
		super(i18n.TITLE, i18n.HINT);
26
	}
26
	}
27
	protected PreparedStatement createStatement() throws SQLException
27
	protected PreparedStatement createStatement() throws SQLException
28
	{
28
	{
29
		ISession session = getSession();
29
		ISession session = getSession();
30
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
30
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
31
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
31
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
32
		pstmt.setString(1, doi.getSchemaName());
32
		pstmt.setString(1, doi.getSchemaName());
33
		pstmt.setString(2, doi.getSimpleName());
33
		pstmt.setString(2, doi.getSimpleName());
34
		return pstmt
34
		return pstmt
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0