1. Лучший говнокод

    В номинации:
    За время:
  2. C# / Говнокод #9808

    +118

    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
    Params.Name                 =   GetControl(pnlName) ? edName.Text : "";                                    
    Params.DateMeasurement      =   TOperation.GetDateValue(edDateTime);            
    Params.HalfYear             =   pnlHalfYear.Tag                        != null &&      
                                                    pnlHalfYear.Tag                        is bool && 
                                                    (bool)pnlHalfYear.Tag                          &&
                                                    edHalfYear.SelectedItem         != null &&
                                                    edHalfYear.SelectedItem.Value   != null &&
                                                    edHalfYear.SelectedItem.Value   is byte ? (byte)
                                                    edHalfYear.SelectedItem.Value   : (byte)0;
    Params.IdDepSource          =   GetControl(pnlDepSource) ? TDataList.GetComboRecId(edDepSource) : 0;          
    Params.IdDepSource2         =   pnlDepSource2.Tag                        != null &&      
                                                    pnlDepSource2.Tag                        is bool && 
                                                    (bool)pnlDepSource2.Tag                          ?
                                                    TDataList.GetComboRecId(edDepSource2) : 0;
    Params.Salt                 =   pnlDepSource2.Tag                        != null &&      
                                                    pnlDepSource2.Tag                        is bool && 
                                                    (bool)pnlDepSource2.Tag                          ?
                                                    getSalt()                               : 0;
    Params.Description          =   edComment.Text;

    ацкий код сохранения параметров. Досталось в наследство. Автор кода естественно имеет в/о факультета компьютерных педиков.

    gcoder, 29 Марта 2012

    Комментарии (6)
  3. JavaScript / Говнокод #9755

    +142

    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
    <script language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Я же написал русским языком НЕ НАЖИМАТЬ !"))
    // End hiding of script 
    // --></script><script
    language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("ГЫ-ГЫ-ГЫ :) САМИ ВИНОВАТЫ !"))
    // End hiding of script 
    // --></script><script language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Ну , начнём !"))
    // End hiding of script 
    // --></script><script
    language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Что Вы тут собирались увидеть ?"))
    // End hiding of script 
    // --></script><script language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Здесь Вы этого не увидите !"))
    // End hiding of script 
    // --></script><script
    language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Сколько Вам лет ?"))
    // End hiding of script 
    // --></script><script language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("И Вы всё еще так наивны :)"))
    // End hiding of script 
    // --></script><script
    language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Вы действительно собирались запустить ракету ?."))
    // End hiding of script 
    // --></script><script language="JavaScript"><!--
    // Hide the JavaScript from older browsers
    (window.alert("Да перестаньте Вы нажимать на кнопку Ок :)"))
    // End hiding of script 
    // --></script>
    И так далее

    Взято с УГозовского сайта drakebellklick.3dn.ru

    high-five, 24 Марта 2012

    Комментарии (6)
  4. Pascal / Говнокод #9752

    +81

    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
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    type
      TString=string[20];
      TInputRec=record      //Inputable record type - тип вводимой информации
              FCol: TString;  //первый, второй, третий столбец
              SCol: TString;
              TCol: TString;
                end;
      TInputRecArray=array [1..127]of TInputRec;
    <...>
    procedure InFile (var n0,k0:byte);       //процедура формирования файлов
    Var
        InRec0   :TInputRec;
        BufChar  :char;
        BufString:TString;
        C,CharCheck,DigitCheck,DelBool,IncorBool:Boolean;
      begin
        n0:=0;
        repeat
          InRec0.FCol:='';
          InRec0.SCol:='';
          InRec0.TCol:='';
          BufString:='';
          IncorBool:=true;
          DelBool:=false;
          Inc(n0);
          Writeln(n0:20);
          while IncorBool do
          begin
          repeat
            BufChar:=readkey;
            StringDel(DelBool);
            ExitCond(k0,C,CharCheck,DigitCheck,BufChar);
            If C then Break;
            If CharCheck then
              begin
                write(bufchar);
                BufString:=BufString+BufChar;
              end;
            if DelBool then BufString:='';
            DelBool:=false;
          until BufChar=' ';
          If C then Break;
          InRec0.FCol:=Trim(BufString);
          BreakProc(n0,IncorBool,InRec0.FCol);
          end;
          Writeln;
          BufString:='';
          IncorBool:=true;
          if (k0=1) or (k0=2) then Break;
          while IncorBool do
          begin
          repeat
            BufChar:=readkey;
            StringDel(DelBool);
            ExitCond(k0,C,CharCheck,DigitCheck,BufChar);
            If C then Break;
            If DigitCheck or (BufChar='-') or (BufChar='/') or (BufChar='.') then
              begin
                Write(bufchar);
                BufString:=BufString+BufChar;
              end;
          if DelBool then BufString:='';
          DelBool:=false;
          until BufChar=' ';
          If C then Break;
          InRec0.SCol:=Trim(BufString);
          BreakProc(n0,IncorBool,InRec0.SCol);
          end;
          Writeln;
          BufString:='';
          DelBool:=false;
          IncorBool:=true;
          while IncorBool do
          begin
          repeat
            BufChar:=readkey;
            StringDel(DelBool);
            ExitCond(k0,C,CharCheck,DigitCheck,BufChar);
            If C then Break;
            If DigitCheck or (BufChar='-') or (BufChar='/') or (BufChar='.') then
              begin
                Write(bufchar);
                BufString:=BufString+BufChar;
              end;
          if DelBool then BufString:='';
          DelBool:=false;
          until BufChar=' ';
          If C then Break;
          InRec0.TCol:=Trim(BufString);
          BreakProc(n0,IncorBool,InRec0.TCol);
          end;
          Writeln;
          BufString:='';
          DelBool:=false;
          IncorBool:=true;
          InputRecArray[n0]:=InRec0;
        until False;
        ClrScr;
      end;

    Одна из ужасных моих программ (сдал и забыл как страшный сон (задача на первом курсе была сформировать 2 файла)). Тогда даже не знал про оператор continue...

    Psilon, 23 Марта 2012

    Комментарии (6)
  5. C# / Говнокод #9732

    +122

    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
    else
                    {
                        if ((textBox1.Text == textBox2.Text) | (textBox1.Text == textBox3.Text) | (textBox1.Text == textBox4.Text) | (textBox1.Text == textBox7.Text)) textBox1.ForeColor = Color.Red; else textBox1.ForeColor = Color.Black;
                        if ((textBox2.Text == textBox1.Text) | (textBox2.Text == textBox3.Text) | (textBox2.Text == textBox5.Text) | (textBox2.Text == textBox8.Text)) textBox2.ForeColor = Color.Red; else textBox2.ForeColor = Color.Black;
                        if ((textBox3.Text == textBox1.Text) | (textBox3.Text == textBox2.Text) | (textBox3.Text == textBox6.Text) | (textBox3.Text == textBox9.Text)) textBox3.ForeColor = Color.Red; else textBox3.ForeColor = Color.Black;
                        if ((textBox4.Text == textBox5.Text) | (textBox4.Text == textBox6.Text) | (textBox4.Text == textBox1.Text) | (textBox4.Text == textBox7.Text)) textBox4.ForeColor = Color.Red; else textBox4.ForeColor = Color.Black;
                        if ((textBox5.Text == textBox4.Text) | (textBox5.Text == textBox6.Text) | (textBox5.Text == textBox2.Text) | (textBox5.Text == textBox8.Text)) textBox5.ForeColor = Color.Red; else textBox5.ForeColor = Color.Black;
                        if ((textBox6.Text == textBox4.Text) | (textBox6.Text == textBox5.Text) | (textBox6.Text == textBox3.Text) | (textBox6.Text == textBox9.Text)) textBox6.ForeColor = Color.Red; else textBox6.ForeColor = Color.Black;
                        if ((textBox7.Text == textBox8.Text) | (textBox7.Text == textBox9.Text) | (textBox7.Text == textBox1.Text) | (textBox7.Text == textBox4.Text)) textBox7.ForeColor = Color.Red; else textBox7.ForeColor = Color.Black;
                        if ((textBox8.Text == textBox7.Text) | (textBox8.Text == textBox9.Text) | (textBox8.Text == textBox2.Text) | (textBox8.Text == textBox5.Text)) textBox8.ForeColor = Color.Red; else textBox8.ForeColor = Color.Black;
                        if ((textBox9.Text == textBox7.Text) | (textBox9.Text == textBox8.Text) | (textBox9.Text == textBox3.Text) | (textBox9.Text == textBox6.Text)) textBox9.ForeColor = Color.Red; else textBox9.ForeColor = Color.Black;
                        if ((textBox1.Text == textBox2.Text) | (textBox1.Text == textBox3.Text) | (textBox1.Text == textBox4.Text) | (textBox1.Text == textBox7.Text) |
                            (textBox2.Text == textBox1.Text) | (textBox2.Text == textBox3.Text) | (textBox2.Text == textBox5.Text) | (textBox2.Text == textBox8.Text) |
                            (textBox3.Text == textBox1.Text) | (textBox3.Text == textBox2.Text) | (textBox3.Text == textBox6.Text) | (textBox3.Text == textBox9.Text) |
                            (textBox4.Text == textBox5.Text) | (textBox4.Text == textBox6.Text) | (textBox4.Text == textBox1.Text) | (textBox4.Text == textBox7.Text) |
                            (textBox5.Text == textBox4.Text) | (textBox5.Text == textBox6.Text) | (textBox5.Text == textBox2.Text) | (textBox5.Text == textBox8.Text) |
                            (textBox6.Text == textBox4.Text) | (textBox6.Text == textBox5.Text) | (textBox6.Text == textBox3.Text) | (textBox6.Text == textBox9.Text) |
                            (textBox7.Text == textBox8.Text) | (textBox7.Text == textBox9.Text) | (textBox7.Text == textBox1.Text) | (textBox7.Text == textBox4.Text) |
                            (textBox8.Text == textBox7.Text) | (textBox8.Text == textBox9.Text) | (textBox8.Text == textBox2.Text) | (textBox8.Text == textBox5.Text) |
                            (textBox9.Text == textBox7.Text) | (textBox9.Text == textBox8.Text) | (textBox9.Text == textBox3.Text) | (textBox9.Text == textBox6.Text)) ;
                        else
                        {
                            label1.Visible = true;
                            label2.Visible = true;
                        }

    Удивлению нет границ! Полная версия: http://pastebin.com/S2getyHn

    P4R4, 22 Марта 2012

    Комментарии (6)
  6. PHP / Говнокод #9730

    +158

    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
    function return_report($new,$do) {
     $dosec = $do - $new;
     $days = floor($dosec / 86400);
     $hour = floor(($dosec - ($days*86400))/3600);
     $min = floor(($dosec - ($days*86400) - ($hour*3600))/60);
     $sec = floor(($dosec - ($days*86400) - ($hour*3600) - ($min*60)));
     switch(substr($days, -2)) { // какое выводить слово
     case 1: case 21: $ost = 'остался '; break;
     default: $ost = 'осталось '; break;
     }
     switch(substr($days, -2)) { // вывод дней
     case 1: case 21: case 31: case 41: $d=' день '; break;
     case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: $d=' дня '; break;
     default: $d=' дней '; 
     }
     switch(substr($hour, -2)) { // вывод часов
     case 1: case 21: $h=' час '; break;
     case 2: case 3: case 4: case 22: case 23: case 24: $h=' часа '; break;
     default: $h=' часов '; 
     }
     switch(substr($min, -2)) { // вывод минут
     case 1: case 21: case 31: case 41: case 51: $m=' минута '; break;
     case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: $m=' минуты '; break;
     default:$m=' минут ';
     }
     switch(substr($sec, -2)) { // вывод секунд
     case 1: case 21: case 31: case 41: case 51: $s=' секунда'; break;
     case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: $s=' секунды'; break;
     default:$s=' секунд';
     }
     if ($dosec > 0) {
     $period = $ost;
     if ($days > 0) $period .= '<b>'.$days.'</b>'
    .$d;
     if ($hour > 0) $period .= '<b>'.$hour.'</b>'
    .$h;
     if ($min > 0) $period .= '<b>'.$min.'</b>'.
    $m;
     if ($sec > 0) $period .= '<b>'.$sec.'</b>'.
    $s;
     return $period;
     }
    return false;
    }

    Человек пытался сделать вывод времени, прошедшего с определенного момента *FACEPALM*

    pro100shureg, 22 Марта 2012

    Комментарии (6)
  7. PHP / Говнокод #9716

    +158

    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
    <?php
    class User
    {
       protected $_user_id;
       protected $_user_email;
       protected $_user_password;
     
       public function __construct($user_id)
       {
          $user_record = self::_getUserRecord($user_id);
          $this->_user_id = $user_record['id'];
          $this->_user_email = $user_record['email'];
          $this->_user_password = $user_record['password'];
       }
     
       public function __get($value) {}
       public function __set($name, $value) {}
     
       private static function _getUserRecord($user_id)
       {
          $user_record = array();
          switch($user_id) {
             case 1:
                $user_record['id'] = 1;
                $user_record['email'] = '[email protected]';
                $user_record['password'] = 'i like croissants';
                break;
     
             case 2:
                $user_record['id'] = 2;
                $user_record['email'] = '[email protected]';
                $user_record['password'] = 'me too!';
                break;
     
             case 'error':
                throw new Exception('Ошибка библиотеки SQL!');
                break;
          }
     
          return $user_record;
       }
    }
    ?>

    PHP исключения...

    Govnisti_Diavol, 19 Марта 2012

    Комментарии (6)
  8. PHP / Говнокод #9714

    +150

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    if ($_GET['type']) $link = 'type='.$_GET['type'];
    if ($_GET['cat']) $link = 'cat='.$_GET['cat'];
    if ($_GET['param']) $link = 'param='.$_GET['param'];

    isset, 19 Марта 2012

    Комментарии (6)
  9. ActionScript / Говнокод #9691

    −112

    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
    public static function isDynamicObject(obj:Object):Boolean
        {
            try
            {
                // this test for checking whether an object is dynamic or not is 
                // pretty hacky, but it assumes that no-one actually has a 
                // property defined called "wootHackwoot"
                obj["wootHackwoot"];
            }
            catch (e:Error)
            {
                // our object isn't from a dynamic class
                return false;
            }
            return true;
        }

    http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

    aquahawk, 16 Марта 2012

    Комментарии (6)
  10. 1C / Говнокод #9670

    −126

    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
    Процедура ОбработкаПроведения(Отказ, РежимПроведения)
    	Для Каждого Строка Из тчПутевыеЛисты Цикл
    		Если Строка.ПринятКУчету = Истина Тогда
    			ПутЛист = Строка.ПутевойЛист.ПолучитьОбъект();
    			ПутЛист.ПринятКУчету = Истина;
    			ПутЛист.ДатаПринятияКУчету = Дата;
    			ПутЛист.Записать(РежимЗаписиДокумента.Проведение, РежимПроведенияДокумента.Неоперативный);
    		КонецЕсли;
    	КонецЦикла;
    	Форма = ЭтотОбъект.ПолучитьФорму("ФормаДокумента");
    	Форма.ЭлементыФормы.тчПутевыеЛисты.Доступность = Ложь;
    	Форма.ЭлементыФормы.тчРаспределениеЗатрат.Доступность = Ложь;
    	Форма.ЭлементыФормы.КоманднаяПанель2.Кнопки.СформироватьДокумент.Доступность = Ложь;
    	Форма.ЭлементыФормы.КоманднаяПанель2.Кнопки.Заполнить.Доступность = Ложь;
    	Форма.ЭлементыФормы.КоманднаяПанель1.Кнопки.ЗаполнитьПоДаннымПоставщика.Доступность = Ложь;
    	Форма.ЭлементыФормы.КоманднаяПанель1.Кнопки.Заполнить.Доступность = Ложь;
    КонецПроцедуры

    ШЕДЕВР!
    Конечно, база данных ведь запоминает, что мы элементы формы сделали недоступными...

    mrbus, 14 Марта 2012

    Комментарии (6)
  11. Java / Говнокод #9657

    +74

    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
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    for (Tm_RecipientConstructor recipient: m_Recipients) {
    	
    	Tm_PHB_Contact m_Contact = recipient.getContact();
    	
    	if ( m_Contact != null) {					
    		if(m_Contact.getMobile()!=null) {						
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"mobile");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getMobile());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}
    		if(m_Contact.getName()!=null) {						
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"first_name");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getName());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}
    		if(m_Contact.getSurName()!=null) {
    			
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"last_name");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getSurName());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}					
    		if(m_Contact.getPatrName()!=null) {
    			
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"second_name");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getPatrName());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}					
    		if(m_Contact.getCompanyName()!=null) {
    			
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"company");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getCompanyName());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}
    		if(m_Contact.getComment()!=null) {
    			
    			st.setLong(1,recipient.getEntry().getID());//nWebEntryID
    			st.setLong(2,Tm_Registry.getInstance().getAttachementTypes().getID(En_AttachementType.ARGUMENT));//NTYPE
    			st.setString(3,"comments");//STRNAME
    			st.setLong(4,Tm_Registry.getInstance().getAttributeType().getID(En_AttributeType.STRING));//NDATATYPE
    			st.setString(5,m_Contact.getComment());//STRVALUE
    			st.addBatch();
        		index++;
        		if (index % 5000 == 0){		    				
        			st.executeBatch();
        			st.clearBatch();				            
        			st = conn.prepareStatement(sql);
        		}
    		}	
    	}
    }

    Функции? Не, не слышал.

    SadKo, 12 Марта 2012

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