public class IndexDetailsTab extends BasePreparedStatementTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(IndexDetailsTab.class); /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { // i18n[oracle.details=Details] String TITLE = s_stringMgr.getString("oracle.details"); // i18n[oracle.displayDetails=Display index details] String HINT = s_stringMgr.getString("oracle.displayDetails"); } /** SQL that retrieves the data. */ private static final String SQL = "select index_type, tablespace_name, table_owner, table_name, table_type, uniqueness" +" compression, initial_extent, next_extent, min_extents, max_extents," +" pct_increase, pct_threshold, status, num_rows, last_analyzed" +" from sys.all_indexes where owner = ?" +" and index_name = ?"; public IndexDetailsTab() { super(i18n.TITLE, i18n.HINT, true); } 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 SessionStatisticsTab extends BasePreparedStatementTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(SessionStatisticsTab.class); /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { // i18n[oracle.sessionStatistics=Session Statistics] String TITLE = s_stringMgr.getString("oracle.sessionStatistics"); // i18n[oracle.displaySessionStatistics=Display database session statistics] String HINT = s_stringMgr.getString("oracle.displaySessionStatistics"); } /** SQL that retrieves the data. */ private static String SQL = "select sn.name, ss.value" + " from sys.v_$sesstat ss, sys.v_$statname sn" + " where ss.sid = ?" + " and ss.statistic# = sn.statistic#"; public SessionStatisticsTab() { super(i18n.TITLE, i18n.HINT); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); String[] parts = doi.getSimpleName().split("\\s+"); pstmt.setLong(1, Long.parseLong(parts[0])); return pstmt
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexDetailsTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/SessionStatisticsTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class IndexDetailsTab extends BasePreparedStatementTab
1
public class SessionStatisticsTab extends BasePreparedStatementTab
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(IndexDetailsTab.class);
4
		StringManagerFactory.getStringManager(SessionStatisticsTab.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.details=Details]
11
		// i18n[oracle.sessionStatistics=Session Statistics]
12
		String TITLE = s_stringMgr.getString("oracle.details");
12
		String TITLE = s_stringMgr.getString("oracle.sessionStatistics");
13
		// i18n[oracle.displayDetails=Display index details]
13
		// i18n[oracle.displaySessionStatistics=Display database session statistics]
14
		String HINT = s_stringMgr.getString("oracle.displayDetails");
14
		String HINT = s_stringMgr.getString("oracle.displaySessionStatistics");
15
	}
15
	}
16
	/** SQL that retrieves the data. */
16
	/** SQL that retrieves the data. */
17
	private static final String SQL =
17
	private static String SQL =
18
            "select index_type, tablespace_name, table_owner, table_name, table_type, uniqueness"
19
            +" compression, initial_extent, next_extent, min_extents, max_extents,"
20
            +" pct_increase, pct_threshold, status, num_rows, last_analyzed"
21
            +" from
18
		"select sn.name, ss.value"
19
			+ " from sys.v_$sesstat ss, sys.v_$statname sn"
22
 sys.all_indexes where owner = ?"
20
			+ " where ss.
23
            +" and index_name = ?
21
sid = ?"
24
";
22
			+ " and ss.statistic# = sn.statistic#";
25
	public IndexDetailsTab()
23
	public SessionStatisticsTab()
26
	{
24
	{
27
		super(i18n.TITLE, i18n.HINT, true);
25
		super(i18n.TITLE, i18n.HINT);
28
	}
26
	}
29
	protected PreparedStatement createStatement() throws SQLException
27
	protected PreparedStatement createStatement() throws SQLException
30
	{
28
	{
31
		ISession session = getSession();
29
		ISession session = getSession();
32
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
30
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
33
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
31
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
34
		pstmt.setString(1, doi.getSchemaName());
32
        String[] parts = doi.getSimpleName()
35
		
33
.split("\\s+");
36
pstmt.setString(2, doi.getSimpleName());
34
        pstmt.setLong(1, Long.parseLong(parts[0]));
37
		return pstmt
35
		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