用汉字查询数据时,vertx-db2-client返回错误代码

发布于 2025-01-24 01:26:34 字数 1031 浏览 3 评论 0原文

喜欢上面的图片,

是否有一些选项可以控制编码? (在UTF8和GBK之间进行切换?)

我在io.vertx.db2client.db2connectoptions中找到了default_charset属性(值为utf8),但是没有代码使用它。 有没有办法将自定义字符集传递给db2connectoptions实例?

我尝试在配置文件中直接设置charsetconnect零件将被解析为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"
}
]

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文