<bdo id='kgk2G'></bdo><ul id='kgk2G'></ul>

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

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

      <tfoot id='kgk2G'></tfoot>
      <legend id='kgk2G'><style id='kgk2G'><dir id='kgk2G'><q id='kgk2G'></q></dir></style></legend>
      1. JDBC 瘦驱动程序的 NLS_LANG 设置?

        NLS_LANG setting for JDBC thin driver?(JDBC 瘦驱动程序的 NLS_LANG 设置?)
        <legend id='46SU1'><style id='46SU1'><dir id='46SU1'><q id='46SU1'></q></dir></style></legend>

        • <bdo id='46SU1'></bdo><ul id='46SU1'></ul>
          1. <tfoot id='46SU1'></tfoot>

                    <tbody id='46SU1'></tbody>

                  <small id='46SU1'></small><noframes id='46SU1'>

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

                  本文介绍了JDBC 瘦驱动程序的 NLS_LANG 设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用的是精简版 Oracle JDBC 驱动程序 10.2.0 (ojdbc14.jar).我想手动配置它的 NLS_LANG 设置.有办法吗?

                  目前,它从 VM 变量 user.language(通过设置当前语言环境或从系统环境启动时自动设置)获取此设置.

                  当用户将应用程序语言环境切换到 Oracle JDBC 驱动程序(例如 mk_MK)不支持的语言环境时,这是一个问题.在这种情况下,下次我获取连接时会出现以下异常:

                  <前>ORA-00604: 递归 SQL 级别 1 发生错误ORA-12705: 无法访问 NLS 数据文件或指定的环境无效

                  我可以在获取连接之前即时更改区域设置,然后来回切换回用户选择的区域设置,但这似乎不优雅且效率低下.

                  解决方案

                  NLS_LANG 设置派生自 java.util.Locale .因此,您需要在连接前进行类似的调用:

                  Locale.setDefault(Locale.<您的语言环境>);

                  I am using the thin Oracle JDBC driver ver 10.2.0 (ojdbc14.jar). I would like to configure its NLS_LANG setting manually. Is there a way?

                  Currently it fetches this setting from the VM variable user.language (which is set automatically by setting the current locale, or on startup from the system environment).

                  This is a problem when the users switch the application locale to a one that is unsupported by the Oracle JDBC driver (e.g. mk_MK). In this case, the next time I fetch a connection I get the following exception:

                  ORA-00604: error occurred at recursive SQL level 1
                  ORA-12705: Cannot access NLS data files or invalid environment specified
                  

                  I can change the locale on the fly just before I fetch the connection and switch back to the user's selected one back and forth, but this seems unelegant and unefficient.

                  解决方案

                  The NLS_LANG settings are derived from the java.util.Locale . Therefore, you will need to make a call similar to this before connecting:

                  Locale.setDefault(Locale.<your locale here>);
                  

                  这篇关于JDBC 瘦驱动程序的 NLS_LANG 设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  SELECT INTO using Oracle(使用 Oracle SELECT INTO)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)
                    <tbody id='zq4pm'></tbody>
                    <bdo id='zq4pm'></bdo><ul id='zq4pm'></ul>
                    • <tfoot id='zq4pm'></tfoot>

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

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

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