public class GeneratorDetailsTab extends BasePreparedStatementTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(GeneratorDetailsTab.class); /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { // i18n[firebird.genDetails=Details] String TITLE = s_stringMgr.getString("firebird.genDetails"); // i18n[firebird.seqDetails=Display sequence details] String HINT = s_stringMgr.getString("firebird.seqDetails"); } /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(GeneratorDetailsTab.class); public GeneratorDetailsTab() { super(i18n.TITLE, i18n.HINT, true); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); String sql = "SELECT CAST('" + doi.getSimpleName() + "' AS VARCHAR(31)) as generator_name, " + "gen_id(" + doi.getSimpleName() + ", 0) as current_value " + "from rdb$database"; if (s_log.isDebugEnabled()) { s_log.debug("Preparing SQL: "+sql); } PreparedStatement pstmt = session.getSQLConnection().prepareStatement(sql); return pstmt
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
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebird/src/org/firebirdsql/squirrel/tab/GeneratorDetailsTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/IndexColumnInfoTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class GeneratorDetailsTab extends BasePreparedStatementTab
1
public class IndexColumnInfoTab extends BasePreparedStatementTab
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(GeneratorDetailsTab.class);
4
		StringManagerFactory.getStringManager(IndexColumnInfoTab.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[firebird.genDetails=Details]
11
		// i18n[oracle.columns=Columns]
12
		String TITLE = s_stringMgr.getString("firebird.genDetails");
12
		String TITLE = s_stringMgr.getString("
13
		// i18n[firebird.seqDetails=Display sequence details
13
oracle.columns");
14
]
14
		// i18n[oracle.displayColumns=Display index column information]
15
		String HINT = s_stringMgr.getString("firebird.seqDetails");
15
		String HINT = s_stringMgr.getString("
16
	}
17
	/** Logger for this class
16
oracle.displayColumns");
17
	}
18
. */
18
	/** SQL that retrieves the data. */
19
	private final static ILogger s_log =
19
	private static 
20
		LoggerController.createLogger(GeneratorDetailsTab.class);
21
	public GeneratorDetails
20
String SQL =
21
            "select table_name, column_name, column_length, decode(descend, \'Y\', \'DESC\', \'ASC\')"
22
            + " from sys.all_ind_columns where index_owner = ?"
23
            + " and index_name = ?"
24
            + " order by column_position";
22
Tab()
25
	public IndexColumnInfoTab()
23
	{
26
	{
24
		super(i18n.TITLE, i18n.HINT, true);
27
		super(i18n.TITLE, i18n.HINT);
25
	}
28
	}
26
	protected PreparedStatement createStatement() throws SQLException
29
	protected PreparedStatement createStatement() throws SQLException
27
	{
30
	{
28
		ISession session = getSession();
31
		ISession session = getSession();
29
        IDatabaseObjectInfo doi = getDatabaseObjectInfo();
30
        
31
        String sql = "SELECT CAST('" + doi.getSimpleName() + "' AS VARCHAR(31)) as generator_name, " +
32
            "gen_id(" +
32
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
33
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
33
 doi.getSimpleName() + ", 0) as current_value " +
34
		pstmt.setString(1, doi.getSchemaName()
34
            "from rdb$database";
35
        
36
        if (s_log.isDebugEnabled()) {
37
            s_log.debug("Preparing SQL: "+sql);
38
        }
39
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(sql
35
);
40
);
36
		pstmt.setString(2, doi.getSimpleName());
41
		return pstmt
37
		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