您的位置:首页 > 编程语言 > Java开发

对于java.sql.SQLException: Locale not recognized的处理

2014-09-12 11:27 686 查看
Your operating system platform default locale is apparently not supported by the Oracle JDBC driver. Change your operating system platform default locale to something more common. You can also do it on a per JVM runtime basis by adding the following VM arguments:

-Duser.language=en -Duser.country=US

This sets the JVM default locale to
en_US
(English / United States).

----------------------------------------------------------------------------------------

You pass different locale to your application

In the code, jdbc tries to establish connection with this locale

But the locale is not supported by the DBMS

So, you can do the following

Take backup of current locale

Locale backup = Locale.getDefault();


Set locale before acquiring connection

Locale.setDefault(Locale.US);


Acquire connection

Set the backup locale
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐