Jawa / Говнокод #28658 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  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 yamert89, (Updated )

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

  • Вы запостили это сюда оттого что Вам нечего делать, или, быть может, Вы хотите потешить своё самолюбие? - "Все кругом - ламергандоны, а я шарик с гелием"
    Ответить
  • Надо наверное новый оффтоп создать, а то предыдущие потёр ПИДОР СРАКЕР.
    Ответить
  • аштрологи обиаваили неделю гостьяю.
    Ответить
  • SELECT temperature FROM dual; -- спрашиваем температуру в Дуале
    Ответить
      • Так точно!

        Several other databases (including Microsoft SQL Server, MySQL, PostgreSQL, SQLite, and Teradata) enable one to omit the FROM clause entirely if no table is needed. This avoids the need for any dummy table.
        Ответить
        • Firebird has a one-row system table RDB$DATABASE that is used in the same way as Oracle's DUAL, although it also has a meaning of its own.

          IBM Db2 has a view that resolves DUAL when using Oracle Compatibility.[3] It also has a table called sysibm.sysdummy1 that has similar properties to the Oracle DUAL one.

          Informix: Informix version 11.50 and later has a table named sysmaster:"informix".sysdual with the same functionality but a more verbose name.[4] You can use CREATE PUBLIC SYNONYM dual FOR sysmaster:"informix".sysdual to create a name dual in the current database with the same functionality.

          Microsoft Access: A table named DUAL may be created and the single-row constraint enforced via ADO (Table-less UNION query in MS Access)

          Microsoft SQL Server: SQL Server does not require a dummy table. Queries like 'select 1 + 1' can be run without a "from" clause/table name.[5]

          MySQL allows DUAL to be specified as a table in queries that do not need data from any tables.[6] It is suitable for use in selecting a result function such as SYSDATE() or USER(), although it is not essential.

          PostgreSQL: A DUAL-view can be added to ease porting from Oracle.[7]
          Ответить
          • Snowflake: DUAL is supported, but not explicitly documented. It appears in sample SQL for other operations in the documentation.

            SQLite: A VIEW named "dual" that works the same as the Oracle "dual" table can be created as follows: CREATE VIEW dual AS SELECT 'x' AS dummy;

            SAP HANA has a table called DUMMY that works the same as the Oracle "dual" table.
            Teradata database does not require a dummy table. Queries like 'select 1 + 1' can be run without a "from" clause/table name.

            Vertica has support for a DUAL table in their official documentation.[8]
            Ответить
            • В общем, некоторые СУБД позволяют слепить костыль для dual, хотя у них обычно FROM не требуется, если запрашиваются данные не из таблиц, и только Оракакал всегда требует FROM, ради которого и придумали dual.
              Ответить
      • Charles Weiss explains why he created DUAL:

        “I created the DUAL table as an underlying object in the Oracle Data Dictionary. It was never meant to be seen itself, but instead used inside a view that was expected to be queried. The idea was that you could do a JOIN to the DUAL table and create two rows in the result for every one row in your table. Then, by using GROUP BY, the resulting join could be summarized to show the amount of storage for the DATA extent and for the INDEX extent(s). The name, DUAL, seemed apt for the process of creating a pair of rows from just one.”
        Ответить
        • It may be not be obvious from the above, but the original DUAL table had two rows in it (hence its name). Nowadays it only has one row.

          Какой багор )))
          Ответить
      • Представляешь, в чём прикол? Виртуальную таблицу назвали dual, потому что в ней было две строки. В новых версия Оракла в ней одна строка (и одна колонка DUMMY, в которой хранится строка X), а название оставили старое.
        Ответить
            • Есть СУБД без неговна, и ты знаешь, как она назыавается
              Ответить
          • И правильно сделали, что не пошли на поводу SQLBASIC. После Селект по стандарту ожидается наличие Эрих Фромм.
            Ответить
            • «Пусть безобразно, зато однообразно».

              Возможно, правильное решение не ломать синтаксис, но плохо, что они внезапно сменили количество строк у таблицы dual. Столько кода сразу сломалось...
              Ответить
    • А мы смеялись над ЯП PETOOH (Брейнфак с петушиным словарём)...


      kokoon = illative singular of koko = все вместе

      koko = размер (существительное) или весь (наречие)


      nominative koko koot
      genitive koon kokojen
      partitive kokoa kokoja
      illative kokoon kokoihin

      -----

      kokko = костёр

      nominative kokko kokot
      genitive kokon kokkojen
      partitive kokkoa kokkoja
      illative kokkoon kokkoihin

      ----

      Kokoo и kokkoko не нашёл. Придётся учить грамматику, чтобы понять начальную форму.
      Ответить
      • Всё-таки тюркские языки проще финно-угорских.

        У тюрков во множественном числе окончание -лар- (либо дар, тар, нар, лер, дер, тер, нер, если язык поддерживает сингармонизм) добавляется во всех падежах перед падежным окончанием.

        А у финно-угров нужно учить окончание каждого падежа в обоих числах, как в индоевропейских языках, сохранивших склонения. Радует то, что у финно-угров склонение одно.
        Ответить
      • koota = собрать

        present tense perfect
        person positive negative person positive negative
        1st sing. kokoan en kokoa 1st sing. olen koonnut en ole koonnut
        2nd sing. kokoat et kokoa 2nd sing. olet koonnut et ole koonnut
        3rd sing. kokoaa ei kokoa 3rd sing. on koonnut ei ole koonnut
        1st plur. kokoamme emme kokoa 1st plur. olemme koonneet emme ole koonneet
        2nd plur. kokoatte ette kokoa 2nd plur. olette koonneet ette ole koonneet
        3rd plur. kokoavat eivät kokoa 3rd plur. ovat koonneet eivät ole koonneet
        passive kootaan
        Ответить
        • imperative mood
          present perfect
          person positive negative person positive negative
          1st sing. — — 1st sing. — —
          2nd sing. kokoa älä kokoa 2nd sing. ole koonnut älä ole koonnut
          3rd sing. kootkoon älköön kootko 3rd sing. olkoon koonnut älköön olko koonnut
          1st plur. kootkaamme älkäämme kootko 1st plur. olkaamme koonneet älkäämme olko koonneet
          2nd plur. kootkaa älkää kootko 2nd plur. olkaa koonneet älkää olko koonneet
          3rd plur. kootkoot älkööt kootko 3rd plur. olkoot koonneet älkööt olko koonneet
          passive koottakoon älköön koottako passive olkoon koottu älköön olko koottu
          Ответить
      • Нагуглил перевод. Так и есть, в первом слове орфографическая ошибка.

        1. Kokoo koko kokko kokoon. = Put together the whole bonfire (Put up the bonfire).
        Kokoo = put together
        Kokoo = spoken language version of kokoa. Kokoa = imperative of koota, meaning to put together
        koko = all, entire
        kokko = bonfire
        kokoon = together, in one piece
        koko = size, measure; kokoon = ilative of koko, used here as an emphasizer, meaning: in(to) one piece
        koota kokoon = to put together, to build up, to put all the parts together into one piece
        2. Koko kokkoko kokoon? = The whole bonfire together?
        kokkoko = kokko + ko: the interrogative form, meaning that the target of the question is kokko
        -ko: interrogative particle, used to emphasize the target of a question
        3. Koko kokko kokoon. = The whole bonfire together (this is the answer to the previous question).
        Notice that the only difference compared to the question is the missing -ko particle from kokkoko.
        Ответить

Добавить комментарий

Из-за тебя ушел bormand, guest!

    А не использовать ли нам bbcode?


    8