使用 JDBC 驱动程序连接到 Oracle 数据库。怎么设置charSet?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4321992/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
connect to Oracle db with JDBC driver. How set charSet?
提问by user471011
I need connect to Oracle database use jdbc driver. I look on structure URL string to connect and not see, where i xan set charSet to connect. Help me please.
我需要使用 jdbc 驱动程序连接到 Oracle 数据库。我查看了要连接的结构 URL 字符串,但没有看到,我在其中设置了 charSet 以进行连接。请帮帮我。
回答by Justin Cave
You shouldn't need to set the character set. Java uses Unicode internally and the data from the database should be converted from the database character set to UTF-16 by the JDBC driver.
您不需要设置字符集。Java 内部使用 Unicode,来自数据库的数据应由 JDBC 驱动程序从数据库字符集转换为 UTF-16。