关于ORACLA字符转换问题

agame 2003-03-14 09:29:41
用JSP向ORACLA数据库中提交中文,数据库中显示的是????。数据库使用的文字编码是
american_america.us7ascii。
我以前有写一个字符转换函数:
public class asctostr {

public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
}
return "null";
}

}
是SQL SERVER用的。我想只要改一下 ISO8859-1 就能用来往ORACLE里提交中文了吧。请教高手,我应该如何改呢?
...全文
43 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
agame 2003-03-17
  • 打赏
  • 举报
回复
ORACLE的字体设置不能边,只能写程序来适应ORACLE,不能对ORACLE进行操作。
StevenWSF 2003-03-17
  • 打赏
  • 举报
回复
修改ORACLE的字体设置,
在安装的时候有提示
agame 2003-03-17
  • 打赏
  • 举报
回复
顶一顶。好几天都没人回答。各位看到的兄弟都帮我顶一下。顶者有分 :)
agame 2003-03-17
  • 打赏
  • 举报
回复
顶一下。
agame 2003-03-17
  • 打赏
  • 举报
回复
楼上的程序我刚才试了依旧是????,如果不是程序出错,难道我什么地方做错了吗?
zxhong 2003-03-17
  • 打赏
  • 举报
回复
public class asctostr {

public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859_1");
String temp=new String(temp_t,"GBK");
return temp;
}
catch(Exception e)
{
}
return "null";
}

}
agame 2003-03-17
  • 打赏
  • 举报
回复
nymxj(nymxj(争天)) 的方法不行啊,数据库中的数据仍是????,请教高手给出程序代码,可以在提交数据的时候转换成american_america.us7ascii码,页面读出数据的时候转换成ISO8859-1码。在下跪谢了。
lfxhyf7979 2003-03-17
  • 打赏
  • 举报
回复
顶一下了
nymxj 2003-03-17
  • 打赏
  • 举报
回复

byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t,"GBK");
agame 2003-03-17
  • 打赏
  • 举报
回复
顶一下。同志们帮帮忙吧。
agame 2003-03-14
  • 打赏
  • 举报
回复
各位高手帮帮在下,要多少分都没有问题。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧