久久久久久久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的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我目前正在驗(yàn)證在 Oracle 上為 DB2 開發(fā)的應(yīng)用程序.由于我們不想維護(hù)兩個(gè)單獨(dú)的源,我需要一些查詢來將 blob 插入到字段中,這在 oracle 和 db2 中都可以使用.我沒有任何標(biāo)識(shí)符來區(qū)分應(yīng)用程序在哪個(gè)數(shù)據(jù)庫下運(yùn)行.

                  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.

                  推薦答案

                  您將無法找到使用某種類型轉(zhuǎn)換的通用 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.

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

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

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測(cè) 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲(chǔ)為 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在线 | 国产aa视频| 激情五月综合色婷婷一区二区 | 成人福利视频 | 99在线视频免费观看 | 中文字幕一区二区三区四区 | 亚洲成人av在线播放 | 国产精品成人在线观看 | 丁香在线视频 | 久久99精品久久久久久琪琪 | 天天视频黄 | 国产中文字幕在线播放 | 婷婷久久久 | 亚洲免费a | 色综合天天综合网天天狠天天 | 在线看片a | 亚洲黄色网址 | 久久久在线视频 | 久久国产精品免费视频 | 日本男人的天堂 | 欧美在线一区二区 | 伊人国产精品 | 黄色福利视频 | 国产精品二 | 五月天婷婷丁香 | 国产一区二区免费看 | 免费黄色网址在线观看 | 国产麻豆一区二区 | 日本韩国欧美中文字幕 | 欧美一区二区在线视频 | 亚洲av毛片成人精品 | 免费黄色一级片 | 性视频在线 | 日韩久久av | 免费看av的网址 | 日韩专区在线观看 | 免费黄色片视频 | 国产精品久久久久久无人区 | 福利片国产 | 老司机午夜影院 | 一级大片免费看 |