久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='VOJis'></small><noframes id='VOJis'>

  • <legend id='VOJis'><style id='VOJis'><dir id='VOJis'><q id='VOJis'></q></dir></style></legend>

      <i id='VOJis'><tr id='VOJis'><dt id='VOJis'><q id='VOJis'><span id='VOJis'><b id='VOJis'><form id='VOJis'><ins id='VOJis'></ins><ul id='VOJis'></ul><sub id='VOJis'></sub></form><legend id='VOJis'></legend><bdo id='VOJis'><pre id='VOJis'><center id='VOJis'></center></pre></bdo></b><th id='VOJis'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VOJis'><tfoot id='VOJis'></tfoot><dl id='VOJis'><fieldset id='VOJis'></fieldset></dl></div>
      <tfoot id='VOJis'></tfoot>

        • <bdo id='VOJis'></bdo><ul id='VOJis'></ul>

        使用 Java 為 DB2 和 Oracle 插入 BLOB

        Insert BLOB using java for both DB2 and Oracle(使用 Java 為 DB2 和 Oracle 插入 BLOB)
        <tfoot id='pTgsj'></tfoot>

          <i id='pTgsj'><tr id='pTgsj'><dt id='pTgsj'><q id='pTgsj'><span id='pTgsj'><b id='pTgsj'><form id='pTgsj'><ins id='pTgsj'></ins><ul id='pTgsj'></ul><sub id='pTgsj'></sub></form><legend id='pTgsj'></legend><bdo id='pTgsj'><pre id='pTgsj'><center id='pTgsj'></center></pre></bdo></b><th id='pTgsj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pTgsj'><tfoot id='pTgsj'></tfoot><dl id='pTgsj'><fieldset id='pTgsj'></fieldset></dl></div>
              <tbody id='pTgsj'></tbody>

              <small id='pTgsj'></small><noframes id='pTgsj'>

                <bdo id='pTgsj'></bdo><ul id='pTgsj'></ul>
                <legend id='pTgsj'><style id='pTgsj'><dir id='pTgsj'><q id='pTgsj'></q></dir></style></legend>
                • 本文介紹了使用 Java 為 DB2 和 Oracle 插入 BLOB的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我目前正在驗證在 Oracle 上為 DB2 開發的應用程序.由于我們不想維護兩個單獨的源,我需要一些查詢來將 blob 插入到字段中,這在 oracle 和 db2 中都可以使用.我沒有任何標識符來區分應用程序在哪個數據庫下運行.

                  I am currently validating an application developed on Oracle for DB2. Since we don't want to maintain two separate sources, I need some query to insert blob into a field, that works in both oracle and db2. I don't have any identifier to distinguish under which DB the application is running.

                  我在oracle中使用utl_raw.cast_to_raw,在DB2中使用CAST() as BLOB,兩者互不兼容.

                  I used utl_raw.cast_to_raw in oracle and CAST() as BLOB in DB2 which are mutually incompatible.

                  推薦答案

                  您將無法找到使用某種類型轉換的通用 SQL.但是您可以使用 JDBC 的 setBinaryStream()

                  You won't be able to find a common SQL that uses some kind of casting. But you can do this with "plain" SQL using JDBC's setBinaryStream()

                  PreparedStatement pstmt = connection.prepareStatement(
                     "insert into blob_table (id, blob_data) values (?, ?)";
                  
                  File blobFile = new File("your_document.pdf");
                  InputStream in = new FileInputStream(blobFile);
                  
                  pstmt.setInt(1, 42);
                  pstmt.setBinaryStream(2, in, (int)blobFile.length());
                  pstmt.executeUpdate();
                  connection.commit();
                  

                  您可以使用 setBinaryStream() 以與 UPDATE 語句相同的方式.

                  You can use setBinaryStream() the same way with an UPDATE statement.

                  這篇關于使用 Java 為 DB2 和 Oracle 插入 BLOB的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                  1. <tfoot id='5TQVX'></tfoot>

                      <tbody id='5TQVX'></tbody>
                      • <bdo id='5TQVX'></bdo><ul id='5TQVX'></ul>
                      • <small id='5TQVX'></small><noframes id='5TQVX'>

                        <legend id='5TQVX'><style id='5TQVX'><dir id='5TQVX'><q id='5TQVX'></q></dir></style></legend>

                          • <i id='5TQVX'><tr id='5TQVX'><dt id='5TQVX'><q id='5TQVX'><span id='5TQVX'><b id='5TQVX'><form id='5TQVX'><ins id='5TQVX'></ins><ul id='5TQVX'></ul><sub id='5TQVX'></sub></form><legend id='5TQVX'></legend><bdo id='5TQVX'><pre id='5TQVX'><center id='5TQVX'></center></pre></bdo></b><th id='5TQVX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5TQVX'><tfoot id='5TQVX'></tfoot><dl id='5TQVX'><fieldset id='5TQVX'></fieldset></dl></div>
                            主站蜘蛛池模板: 久久久精彩视频 | 中文在线一区二区 | 中文字幕av一区 | 一道本不卡视频 | 久久高清| 日日天天| 欧美色偷拍 | 国产精品久久久久久久久免费相片 | www.887色视频免费 | www.色综合| 草久网 | 久久久国产精品网站 | 91综合网 | 插插插干干干 | h片免费在线观看 | 伊人焦久影院 | 国产成人精品一区二区三区四区 | 国产免费一区二区 | 成人午夜在线 | 欧美精品一区二区在线观看 | 欧美日韩高清免费 | 一区二区三区免费 | 亚洲精品乱码久久久久久按摩观 | 日韩成人影院 | 亚洲最大福利网 | 国产免费拔擦拔擦8x高清 | 99视频网| 干干干操操操 | 日韩一二区在线 | 9久久精品 | 黄色片视频 | 91麻豆蜜桃一区二区三区 | 色综合99| 天天宗合网| 99精品久久久久久久 | 免费在线观看h片 | 免费污视频 | 国产精品久久久久久久久久久新郎 | 欧美日韩不卡合集视频 | 久久久久久久一区二区三区 | 国产一级片网站 |