用汉字查询数据时,vertx-db2-client返回错误代码
喜欢上面的图片,
是否有一些选项可以控制编码? (在UTF8和GBK之间进行切换?)
我在io.vertx.db2client.db2connectoptions
中找到了default_charset
属性(值为utf8
),但是没有代码使用它。 有没有办法将自定义字符集传递给db2connectoptions实例?
我尝试在配置文件中直接设置charset
(connect
零件将被解析为sqlConnectoptions实例),但是看来客户端仍然使用
connect:
host: 192.168.0.100
port: 50000
database: test
charset: GBK
pipelined: true
user: test
password: test
pool:
name: test
shared: true
select的UTF8结果名称,来自sysibmadm.dbcfg的值,其中的名称('codepage','codeSet','serritority','country')
:
[
{
"NAME": "codepage",
"VALUE": "1386"
},
{
"NAME": "codeset",
"VALUE": "GBK"
},
{
"NAME": "country",
"VALUE": "86"
},
{
"NAME": "territory",
"VALUE": "CN"
}
]
Like picture above
Are there some options to control the encoding? (switch between UTF8 and GBK?)
I found a DEFAULT_CHARSET
property(the value is utf8
) in io.vertx.db2client.DB2ConnectOptions
, but no code use it.
Is there a way to pass custom charset to DB2ConnectOptions instance?
I tried to set charset
directly in config file(the connect
part will be parsed into a SqlConnectOptions instance), but it seems the client still use utf8
connect:
host: 192.168.0.100
port: 50000
database: test
charset: GBK
pipelined: true
user: test
password: test
pool:
name: test
shared: true
result of select name,value from sysibmadm.dbcfg where name in ('codepage','codeset','territory','country')
:
[
{
"NAME": "codepage",
"VALUE": "1386"
},
{
"NAME": "codeset",
"VALUE": "GBK"
},
{
"NAME": "country",
"VALUE": "86"
},
{
"NAME": "territory",
"VALUE": "CN"
}
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论