简体   繁体   English

在DB2数据库中插入特殊字符

[英]Insert special characters in DB2 database

I am having database in DB2 that works fine with insertion of normal text with java . database in DB2中使用database in DB2通过使用java insertion普通文本可以正常工作。

But as some special characters occurs like Mise à jour des référentiels liés then problem comes in insertion of data. 但是,随着一些special characters出现像Mise à jour des référentiels liés那么问题在于插入数据。

Please tell what actually the problem is with insertion of such type of data and how can we do insertion of such data. 请说明插入此类数据的实际问题是什么,以及如何插入此类数据。

Thanks in advance 提前致谢

The problem (I think, since you haven't specified on you created your database) is that you haven't created a database that supports UTF-8. 问题(我认为,因为您尚未指定创建数据库)是因为您尚未创建支持UTF-8的数据库。

IBM DB2 UDB (Universal Database) supports UTF-8 and UCS-2. IBM DB2 UDB(通用数据库)支持UTF-8和UCS-2。

When creating a database, you can set CODESET to be of type UTF-8, as follows: 创建数据库时,可以将CODESET设置为UTF-8类型,如下所示:

CREATE DATABASE dbname USING CODESET UTF-8 

Alternatively, you can set CCSID on your table (or table column). 或者,您可以在表(或表列)上设置CCSID For UTF-8, the CCSID = 1208, while UCS-2, CCSID = 1200. 对于UTF-8,CCSID = 1208,而UCS-2,CCSID = 1200。

This IBM article shows you which data column each CCSID is associated to when assigning a table as Unicode. 这篇IBM文章向您展示了将表分配为Unicode时每个CCSID与哪个数据列相关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM