Interbase数据库+EJB无法输入中文?(200分)

硕鼠

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用的是JBuilder9,WebLogic7,Interbase6.5。
建立CMP实体Bean。
在测试程序中我可以显示数据库中的中文,
但是无法将新的中文字段更新至数据库中。每次显示的都是"????",
每一个问号就代表一个汉字。
我参考了 http://www.delphibbs.com/delphibbs/dispq.asp?lid=2103321
但还是解决不了。是不是一定要用BMP实体Bean?我不会用,请各位大侠教我。谢谢。
 
应该和实体bean无关的
还有你要看看你的数据库里默认的字符集是什么 你就把你的字符转换成什么
一般来说都是iso-8859-1的
从db里取数据sbData=new String(sbData.getBytes("GBK"),"iso-8859-1");
向db里插入数据sbData=new String(sbData.getBytes("iso-8859-1"),"GBK");
 
数据库的字符集如何调整?
 
我用了
str = new String(str.getBytes("ISO-8859-1"),"GB2312");
但是无效,我得到的还是?????
我用了
str = new String(str.getBytes("GB2312"),"ISO-8859-1");
插入
我得到的错误信息是:
weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
[interbase.interclient.SQLException: [interclient][interbase] arithmetic exception, numeric overflow, or string truncation
 
你的数据库装在那里呀 是nt还是linux上
还有你最好用GBK的字符集
你把数据更新的数据库中如果显示????
你看看把数据打印出来看看还乱码吗?
从db里取数据sbData=new String(sbData.getBytes("GBK"),"iso-8859-1");
向db里插入数据sbData=new String(sbData.getBytes("iso-8859-1"),"GBK");
 
接受答案了.
 
顶部