code: public String replicateTable(String tableName, boolean toCopyData) throws SQLException {
          String tempTableName = MySqlCommunication.getTempTableName(tableName);
          LOG.debug("Replicate table {} into {}", tableName, tempTableName);
          if (this.tableExists(tempTableName)) {
              this.truncateTempTable(tempTableName);
          } else {
              this.createTempTable(tableName);
          }
          if (toCopyData) {
              final String sql = "INSERT INTO " + tempTableName + " SELECT * FROM " + tableName + ";";
              this.executeUpdate(sql);
          }
          return tempTableName;
      }
docs: Replicates table structure and data from source to temporary table.
  
  @param tableName  existing table name
  @param toCopyData boolean
  
  @return new table name
  
  @throws SQLException for any issue