1. Список говнокодов пользователя yamert89

    Всего: 1

  2. Java / Говнокод #28658

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    Statement stmt1 = null;
            ResultSet rs1 = null;
         
            try {
                StringBuilder sb = new StringBuilder(2000);
                String sql = "";
                String ss = "";
                String ss_begin = "";
                String ss_middle = "";
                String ss_end = "";
                int xcount = 0;
                String XXX_ID = "";
                String XXX_NAME = "";
    
    
                if (c.XLANG_ID == 1) {
                    sql = sql + " SELECT  99 , 'Исходные'  FROM dual union all ";
                    sql = sql + " SELECT  1 , 'Непарные исходные'  FROM dual union all ";
                    sql = sql + " SELECT  2 , 'Временная'            FROM dual union all ";
                    sql = sql + " SELECT  3 , 'Встречные'         FROM dual ";
                    //sql = sql +  " SELECT  4 , 'Непарные встречные'         FROM dual ";
                } else if (c.XLANG_ID == 2) {
                    sql = sql + " SELECT  99 , 'Base BPEBs' FROM dual union all ";
                    sql = sql + " SELECT  1 , 'Base BPEBs unpaired' FROM dual union all ";
                    sql = sql + " SELECT  2 , 'Temporary BPEB' FROM dual union all ";
                    sql = sql + " SELECT  3 , 'Generated BPEBs' FROM dual ";
                    //sql = sql +  " SELECT  4 , 'Generated BPEBs unpaired' FROM dual ";
                }
    
                stmt1 = this.con.createStatement();
                rs1 = stmt1.executeQuery(sql);
    
                while (rs1.next()) {
                    xcount = xcount + 1;
                    XXX_ID = rs1.getString(1);
                    XXX_NAME = rs1.getString(2);
    
                    sb = sb.append("<msg>")
                            .append("<xid>").append(XXX_ID).append("</xid>")
                            .append("<xname>").append(vtb.budget.osa.tools.Tools.stringToXML(XXX_NAME)).append("</xname>")
    
                            .append("</msg>");
                }
                rs1.close();
                stmt1.close();
    
                ss_begin = ss_begin + "<xml id='XML_table1'>"
                        + "<tab1>";
    
                ss_end = ss_end
                        + "</tab1>"
                        + "</xml>";
    
                if (xcount == 0) {
                    ss_middle = ss_middle + "<msg>"
                            + "<xid></xid>"
                            + "<xcode></xcode>"
                            + "<xname></xname>"
                            + "</msg>";
                } else {
                    ss_middle = sb.toString();
                }
    
    
                ss = ss_begin + ss_middle + ss_end;
    
                ss_begin = null;
                ss_middle = null;
                ss_end = null;
                sb = null;
    
    
                return ss;
    
            }

    yamert89, 04 Апреля 2023

    Комментарии (35)