public class TriggerSourceTab extends BaseSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(TriggerSourceTab.class); /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select trigger_body from sys.all_triggers" + " where owner = ? and trigger_name = ?"; public TriggerSourceTab() { // i18n[oracle.showTriggerSource=Show trigger source] super(s_stringMgr.getString("oracle.showTriggerSource")); } 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.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
public class ViewSourceTab extends OracleSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ViewSourceTab.class); /** * This interface defines locale specific strings. */ private interface i18n { // i18n[oracle.diplayScriptDetails=Display script details] String HINT = s_stringMgr.getString("oracle.diplayScriptDetails"); } /** SQL that retrieves the data. */ private static final String SQL = "select 'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " + "FROM SYS.ALL_VIEWS " + "WHERE OWNER = ? AND VIEW_NAME = ? "; public ViewSourceTab() { super(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/TriggerSourceTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/ViewSourceTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class TriggerSourceTab extends BaseSourceTab
1
public class ViewSourceTab extends OracleSourceTab
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(TriggerSourceTab.class);
4
		StringManagerFactory.getStringManager(ViewSourceTab.class);
5
	/** SQL that retrieves the source of a stored procedure
5
	/**
6
	 * This interface defines locale specific strings.
7
	 */
8
	private interface i18n
9
	{
10
		// i18n[oracle.diplayScriptDetails=Display script details]
11
		String HINT = s_stringMgr.getString("oracle.diplayScriptDetails");
12
	}
6
. */
13
	/** SQL that retrieves the data. */
7
	private static String SQL =
14
	private static final String SQL =
8
		"select trigger_body from sys.all_triggers"
9
			+ " where owner = ? and trigger_name
15
        "select  'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " +
16
        "FROM SYS.ALL_VIEWS " +
10
 = ?";
17
        "WHERE OWNER = ? AND VIEW_NAME = ? ";
18
    
11
	public TriggerSourceTab()
19
	public ViewSourceTab()
12
	{
20
	{
13
		// i18n[oracle.showTriggerSource=Show trigger source]
21
		
14
		super(s_stringMgr.getString("oracle.showTriggerSource"));
22
super(i18n.HINT);
15
	}
23
	}
16
	protected PreparedStatement createStatement() throws SQLException
24
	protected PreparedStatement createStatement() throws SQLException
17
	{
25
	{
18
		final ISession session = getSession();
26
		ISession session = getSession();
19
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
27
		
20
		ISQLConnection conn = session.getSQLConnection();
28
PreparedStatement pstmt = session.getSQLConnection()
21
		PreparedStatement pstmt = conn.prepareStatement(SQL
29
.prepareStatement(SQL);
22
);
30
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
23
		pstmt.setString(1, doi.getSchemaName());
31
		pstmt.setString(1, doi.getSchemaName());
24
		pstmt.setString(2, doi.getSimpleName());
32
		pstmt.setString(2, doi.getSimpleName());
25
		return pstmt
33
		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