public class InformixTableIndexExtractorImpl implements ITableIndexExtractor { /** Logger for this class */ private final static ILogger s_log = LoggerController.createLogger(InformixTableIndexExtractorImpl.class); /** The query that finds the indexes for a given table */ private static final String query = "SELECT T1.idxname " + "FROM informix.sysindices AS T1, informix.systables AS T2 " + "WHERE T1.tabid = T2.tabid " + "and t1.owner = ? "+ "and T2.tabname = ? "; /** * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo) */ public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo) throws SQLException { if (s_log.isDebugEnabled()) { s_log.debug("Binding schema name "+dbo.getSchemaName()+ " as first bind value"); s_log.debug("Binding table name "+dbo.getSimpleName()+ " as second bind value"); } pstmt.setString(1, dbo.getSchemaName()); pstmt.setString(2, dbo.getSimpleName()); } /** * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#getTableIndexQuery() */ public String getTableIndexQuery() { return query
public class MysqlTableTriggerExtractorImpl implements ITableTriggerExtractor { /** Logger for this class */ private final static ILogger s_log = LoggerController.createLogger(MysqlTableTriggerExtractorImpl.class); /** The query that finds the trigger definition */ private static String SQL = "select TRIGGER_NAME " + "from information_schema.triggers " + "where EVENT_OBJECT_SCHEMA = ? " + "and EVENT_OBJECT_TABLE = ? "; /** * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo) */ public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo) throws SQLException { if (s_log.isDebugEnabled()) { s_log.debug("Binding catalog name "+dbo.getCatalogName()+ " as first bind value"); s_log.debug("Binding table name "+dbo.getSimpleName()+ " as second bind value"); } pstmt.setString(1, dbo.getCatalogName()); pstmt.setString(2, dbo.getSimpleName()); } /** * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#getTableTriggerQuery() */ public String getTableTriggerQuery() { return SQL
Clone fragments detected by clone detection tool
File path: /sql12/plugins/informix/src/net/sourceforge/squirrel_sql/plugins/informix/exp/InformixTableIndexExtractorImpl.java File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/expander/MysqlTableTriggerExtractorImpl.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class InformixTableIndexExtractorImpl implements ITableIndexExtractor {
1
public class MysqlTableTriggerExtractorImpl implements ITableTriggerExtractor {
2
    
3
    /** Logger for this class */
2
    /** Logger for this class */
4
    private final static ILogger s_log = 
3
    private final static ILogger s_log = 
5
        LoggerController.createLogger(InformixTableIndexExtractorImpl.class);
4
        LoggerController.createLogger(MysqlTableTriggerExtractorImpl.class);
6
            
5
 
7
    
6
    
8
    /** The query that finds the indexes for a given table */
7
    /** The query that finds the trigger definition */
9
    private static final String query = 
8
    private static String SQL = 
10
        "SELECT  T1.idxname " +
9
        "select TRIGGER_NAME " +
11
        "FROM informix.sysindices AS T1, informix.systables AS T2 " +
10
        "from inform
12
        "WHERE T1.tabid = T2.tabid " +
13
        "and t1.owner
11
ation_schema.triggers " +
14
 = ? "+
12
        "where EVENT_OBJECT_SCHEMA = ? " +
15
        "and T2.tabname = ? ";
13
        "and EVENT_OBJECT_TABLE = ? ";
16
    
14
    
17
    /**
15
    /**
18
     * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)
16
     * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)
19
     */
17
     */
20
    public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo)
18
    public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo) 
21
        throws SQLException 
19
        throws SQLException 
22
    {
20
    {
23
        if (s_log.isDebugEnabled()) {
21
        if (s_log.isDebugEnabled()) {
24
            s_log.debug("Binding schema name "+dbo.getSchemaName()+
22
            s_log.debug("Binding catalog name "+dbo.getCatalogName()+
25
                        " as first bind value");
23
                        " as first bind value");
26
            s_log.debug("Binding table name "+dbo.getSimpleName()+
24
            s_log.debug("Binding table name "+dbo.getSimpleName()+
27
                        " as second bind value");            
25
                        " as second bind value");            
28
        }                        
26
        }
29
        pstmt.setString(1, dbo.getSchemaName());
27
        pstmt.setString(1, dbo.getCatalogName());
30
        pstmt.setString(2, dbo.getSimpleName());
28
        pstmt.setString(2, dbo.getSimpleName());        
31
    }
29
    }
32
    /**
30
    /**
33
     * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#getTableIndexQuery()
31
     * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#getTableTriggerQuery()
34
     */
32
     */
35
    public String getTableIndexQuery() {
33
    public String getTableTriggerQuery() {
36
        return query
34
        return SQL
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