public class ViewSourceTab extends FormattedSourceTab { /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select view_definition " + "from information_schema.views " + "where table_schema = ? " + "and table_name = ? "; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ViewSourceTab.class); public ViewSourceTab(String hint, String stmtSep) { super(hint); super.setCompressWhitespace(true); super.setupFormatter(stmtSep, null); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); if (s_log.isDebugEnabled()) { s_log.debug("Running SQL for View source tab: "+SQL); } PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt;
public class ViewSourceTab extends FormattedSourceTab { /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select view_definition " + "from information_schema.views " + "where table_schema = ? " + "and table_name = ? "; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ViewSourceTab.class); public ViewSourceTab(String hint, String stmtSep) { super(hint); super.setCompressWhitespace(true); super.setupFormatter(stmtSep, null); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); if (s_log.isDebugEnabled()) { s_log.debug("Running SQL for View source tab: "+SQL); } PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/h2/src/net/sourceforge/squirrel_sql/plugins/h2/tab/ViewSourceTab.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/tab/ViewSourceTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class ViewSourceTab extends FormattedSourceTab
1
public class ViewSourceTab extends FormattedSourceTab
2
{
2
{
3
	/** SQL that retrieves the source of a stored procedure. */
3
	/** SQL that retrieves the source of a stored procedure. */
4
	private static String SQL =
4
	private static String SQL =
5
        "select view_definition " +
5
        "select view_definition " +
6
        "from information_schema.views " +
6
        "from information_schema.views " +
7
        "where table_schema = ? " +
7
        "where table_schema = ? " +
8
        "and table_name = ? ";
8
        "and table_name = ? ";
9
    
9
    
10
	/** Logger for this class. */
10
	/** Logger for this class. */
11
	private final static ILogger s_log =
11
	private final static ILogger s_log =
12
		LoggerController.createLogger(ViewSourceTab.class);
12
		LoggerController.createLogger(ViewSourceTab.class);
13
	public ViewSourceTab(String hint, String stmtSep)
13
	public ViewSourceTab(String hint, String stmtSep)
14
	{
14
	{
15
		super(hint);
15
		super(hint);
16
        super.setCompressWhitespace(true);
16
        super.setCompressWhitespace(true);
17
        super.setupFormatter(stmtSep, null);
17
        super.setupFormatter(stmtSep, null);
18
	}
18
	}
19
	protected PreparedStatement createStatement() throws SQLException
19
	protected PreparedStatement createStatement() throws SQLException
20
	{
20
	{
21
		final ISession session = getSession();
21
		final ISession session = getSession();
22
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
22
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
23
		ISQLConnection conn = session.getSQLConnection();
23
		ISQLConnection conn = session.getSQLConnection();
24
        if (s_log.isDebugEnabled()) {
24
        if (s_log.isDebugEnabled()) {
25
            s_log.debug("Running SQL for View source tab: "+SQL);
25
            s_log.debug("Running SQL for View source tab: "+SQL);
26
        }
26
        }
27
		PreparedStatement pstmt = conn.prepareStatement(SQL);
27
		PreparedStatement pstmt = conn.prepareStatement(SQL);
28
        
28
        
29
        pstmt.setString(1, doi.getSchemaName());
29
        pstmt.setString(1, doi.getSchemaName());
30
		pstmt.setString(2, doi.getSimpleName());
30
		pstmt.setString(2, doi.getSimpleName());
31
		return pstmt;
31
		return pstmt;
32
	
32
	
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