CloneSet215


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
37210.988class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
137466
E:/TSE/Projects-CloneDR/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java
238282
E:/TSE/Projects-CloneDR/sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/util/DBUtil.java
Next
Last
Clone Instance
1
Line Count
37
Source Line
466
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java

/**
 * Returns a count of the records in the specified table.
 * 
 * @param con
 *        the SQLConnection to use to execute the count query.
 * @param tableName
 *        the name of the table. This name should already be qualified by the schema.
 * 
 * @return -1 if the table does not exist, otherwise the record count is returned.
 */
private static int getTableCount(ISession session, String tableName) {
  int result = -1;
  ResultSet rs = null;
  try {
    String sql = "select count(*) from " + tableName;
    rs = executeQuery(session, sql);
    if (rs.next()) {
      result = rs.getInt(1);
    }
  }
  catch (Exception
         e) {
  /* Do Nothing - this can happen when the table doesn't exist */
  }
  finally {
    SQLUtilities.closeResultSet(rs, true);
  }
  return result;
}

/**
 * Returns a count of the records in the specified table.
 * 
 * @param con
 *        the SQLConnection to use to execute the count query.
 * @param tableName
 *        the name of the table
 * 
 * @return -1 if the table does not exist, otherwise the record count is returned.
 */
public static int getTableCount(ISession session, String catalog, String schema, String tableName, int sessionType) throws UserCancelledOperationException {
  String table = getQualifiedObjectName(session, catalog, schema, tableName, sessionType);
  return getTableCount(session, table);
}


First
Previous
Clone Instance
2
Line Count
38
Source Line
282
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/util/DBUtil.java

/**
 * Returns a count of the records in the specified table.
 * 
 * @param con
 *           the SQLConnection to use to execute the count query.
 * @param tableName
 *           the name of the table. This name should already be qualified by the schema.
 * @return -1 if the table does not exist, otherwise the record count is returned.
 */
private static int getTableCount(ISession session, String tableName) {
  int result = -1;
  ResultSet rs = null;
  try {
    String sql = "select count(*) from " + tableName;
    rs = executeQuery(session, sql);
    if (rs.next()) {
      result = rs.getInt(1);
    }
  }
  catch (Exception
         e) {
  /* Do Nothing - this can happen when the table doesn't exist */
  }
  finally {
    SQLUtilities.closeResultSet(rs);
  }
  return result;
}

/**
 * Returns a count of the records in the specified table.
 * 
 * @param con
 *           the SQLConnection to use to execute the count query.
 * @param tableName
 *           the name of the table
 * @return -1 if the table does not exist, otherwise the record count is returned.
 */
public static int getTableCount(ISession session, String catalog, String schema, String tableName, int sessionType) throws UserCancelledOperationException {
  String table = getQualifiedObjectName(session, catalog, schema, tableName, sessionType);
  return getTableCount(session, table);
}


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Returns a count of the records in the specified table.
         * 
         * @param con
         *        the SQLConnection to use to execute the count query.
         * @param tableName
         *        the name of the table. This name should already be qualified by the schema.
         * 
         * @return -1 if the table does not exist, otherwise the record count is returned.
         */
/**
         * Returns a count of the records in the specified table.
         * 
         * @param con
         *           the SQLConnection to use to execute the count query.
         * @param tableName
         *           the name of the table. This name should already be qualified by the schema.
         * @return -1 if the table does not exist, otherwise the record count is returned.
         */
private static int getTableCount(ISession session, String tableName) {
  int result = -1;
  ResultSet rs = null;
  try {
    String sql = "select count(*) from " + tableName;
    rs = executeQuery(session, sql);
    if (rs.next()) {
      result = rs.getInt(1);
    }
  }
  catch (Exception
         e) {
  /* Do Nothing - this can happen when the table doesn't exist */
  }
  finally {
    SQLUtilities.closeResultSet( [[#variable18d4be20]]);
  }
  return result;
}

/**
         * Returns a count of the records in the specified table.
         * 
         * @param con
         *        the SQLConnection to use to execute the count query.
         * @param tableName
         *        the name of the table
         * 
         * @return -1 if the table does not exist, otherwise the record count is returned.
         */
/**
         * Returns a count of the records in the specified table.
         * 
         * @param con
         *           the SQLConnection to use to execute the count query.
         * @param tableName
         *           the name of the table
         * @return -1 if the table does not exist, otherwise the record count is returned.
         */
public static int getTableCount(ISession session, String catalog, String schema, String tableName, int sessionType) throws UserCancelledOperationException {
  String table = getQualifiedObjectName(session, catalog, schema, tableName, sessionType);
  return getTableCount(session, table);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#18d4be20]]
rs, true 
12[[#18d4be20]]
rs