如何使用动态SQL语句获取和更改DB2 z / OS数据库的编码模式 [英] How to get and change encoding schema for a DB2 z/OS database using dynamic SQL statement

查看:409
本文介绍了如何使用动态SQL语句获取和更改DB2 z / OS数据库的编码模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已为我设置了DB2 for z / OS数据库。现在我想知道数据库的编码方案,如果数据库是其他类型的编码,将其更改为Unicode。

A DB2 for z/OS database has been setup for me. Now I want to know the encoding scheme of the database and change it to Unicode if the database is other type of encoding.

我该如何做?我可以在Java应用程序中使用动态SQL语句吗?

How can I do this? Can I do this using dynamic SQL statements in my Java application?

谢谢!

推荐答案

当您使用CCSID UNICODE子句创建表(和数据库和表)时,需要指定编码方案为UNICODE。

You need to specify that the encoding scheme is UNICODE when you are creating your table (and database and tablepsace) by using the CCSID UNICODE clause.

根据到文档:


默认情况下,表的编码方案与其表空间的编码方案相同。默认情况下,表空间的编码方案与其数据库的编码方案相同。您可以使用CREATE TABLESPACE或CREATE TABLE语句中的CCSID子句覆盖编码方案。但是,表空间中的所有表必须具有相同的CCSID。

By default, the encoding scheme of a table is the same as the encoding scheme of its table space. Also by default, the encoding scheme of the table space is the same as the encoding scheme of its database. You can override the encoding scheme with the CCSID clause in the CREATE TABLESPACE or CREATE TABLE statement. However, all tables within a table space must have the same CCSID.

有关更多信息,请参阅创建Unicode表格 DB2 for z / os文档

For more, see Creating a Unicode Table in the DB2 for z/os documentation.

您可以通过Java / JDBC创建表,但我怀疑您将能够以这种方式创建数据库和表空间。我不会推荐它,我会找到你最接近的z / os DBA,让那个人来帮助你。

You are able to create tables via Java/JDBC, but I doubt that you will be able to create databases and tablespaces that way. I wouldn't recommend it anyway, I would find your closest z/os DBA and get that person to help you.

这篇关于如何使用动态SQL语句获取和更改DB2 z / OS数据库的编码模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆