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

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

      <tfoot id='Qoihz'></tfoot>

      <legend id='Qoihz'><style id='Qoihz'><dir id='Qoihz'><q id='Qoihz'></q></dir></style></legend>

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

        如何獲取 SQL 連接的默認(rèn)模式?

        How to get the default schema of a SQL connection?(如何獲取 SQL 連接的默認(rèn)模式?)
          <tfoot id='vxbEw'></tfoot>
            <tbody id='vxbEw'></tbody>

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

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

              <legend id='vxbEw'><style id='vxbEw'><dir id='vxbEw'><q id='vxbEw'></q></dir></style></legend>

                  <bdo id='vxbEw'></bdo><ul id='vxbEw'></ul>
                  本文介紹了如何獲取 SQL 連接的默認(rèn)模式?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  從 java 代碼中 - 我已經(jīng)連接到數(shù)據(jù)庫 - 我需要找到連接的默認(rèn)模式.

                  From within a java code - where I already have a connection to a database - I need to find the default schema of the connection.

                  我有以下代碼,它為我提供了該連接的所有模式的列表.

                  I have the following code that gives me a list of all schemas of that connection.

                  rs  = transactionManager.getDataSource().getConnection().getMetaData().getSchemas();
                  while (rs.next()) {
                      log.debug("The schema is {} and the catalogue is {} ", rs.getString(1), rs.getString(2));
                  }
                  

                  但是,我不想要所有模式的列表.我需要此連接的默認(rèn)架構(gòu).

                  However, I don't want the list of all the schemas. I need the default schema of this connection.

                  請(qǐng)幫忙.

                  注意 1:我在 Windows7(開發(fā)盒)和 Linux Redhat(生產(chǎn)盒)上使用 H2 和 DB2

                  Note1: I am using H2 and DB2 on Windows7 (dev box) and Linux Redhat (production box)

                  注2:我最終得出結(jié)論,使用Java 中的Connections 對(duì)象無法使用相同的代碼找到H2 和DB2 的默認(rèn)模式.我用配置文件解決了這個(gè)問題.但是,如果有人可以分享解決方案,我可以回去重構(gòu)代碼.

                  Note2: I finally concluded that it was not possible to use the Connections object in Java to find the default schema of both H2 and DB2 using the same code. I fixed the problem with a configuration file. However, if someone can share a solution, I could go back and refactor the code.

                  推薦答案

                  請(qǐng)使用 connection.getMetaData().getURL() 方法,該方法返回類似字符串的方法

                  Please use connection.getMetaData().getURL() method which returns String like

                  jdbc:mysql://localhost:3306/?autoReconnect=true&useUnicode=true&characterEncoding=utf8
                  

                  我們可以輕松解析它并獲取架構(gòu)名稱.它適用于所有 JDBC 驅(qū)動(dòng)程序.

                  We can parse it easily and get the schema name. It works for all JDBC drivers.

                  這篇關(guān)于如何獲取 SQL 連接的默認(rèn)模式?的文章就介紹到這了,希望我們推薦的答案對(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?(如何檢測 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?)
                  <legend id='OuZry'><style id='OuZry'><dir id='OuZry'><q id='OuZry'></q></dir></style></legend>
                        <bdo id='OuZry'></bdo><ul id='OuZry'></ul>
                        <tfoot id='OuZry'></tfoot>

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

                            <tbody id='OuZry'></tbody>

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

                            主站蜘蛛池模板: 美日韩免费视频 | 欧美涩涩网 | 日韩精品一区二区三区视频播放 | 色婷婷综合久久久久中文一区二区 | 亚洲不卡av在线 | 国产精品入口久久 | 在线视频一区二区 | 欧美色图另类 | 久久88| 日韩欧美中文 | 欧美一区二区在线观看 | 91精品国产综合久久久亚洲 | 你懂的免费在线 | 色婷婷综合网 | 欧美日韩在线免费观看 | 欧美三区在线观看 | 国产日韩一区二区三免费高清 | 在线观看免费av网站 | 中文字幕一级 | 国产日韩精品一区 | 精品国产乱码久久久久久丨区2区 | 九九九视频在线观看 | 久久成人免费 | 正在播放国产精品 | 夜久久| 欧美一区永久视频免费观看 | 日韩a v在线免费观看 | 天天插天天操 | 夜夜爽99久久国产综合精品女不卡 | 亚洲最大av网站 | 黄网站免费观看 | h视频在线看 | 蜜桃一区二区三区 | 国产一区 日韩 | 视频一区欧美 | 亚洲美女一区 | 黄色大片免费看 | 色.com| 欧美一级片在线看 | www.se91| 免费看一区二区三区 |