日期:2014-05-20  浏览次数:20730 次

html脚本存入oracle 数据库 报错!!急
String s="<div id=\"header\"><div class=\"nav1\"><div class=\"leftnav\"><img src=\"images/left_nav.jpg\" border=\"0\" /></div><div class=\"centernav\"><div class=\"time\"><script language=\"javascript\">var now=new Date();document.write(now.getFullYear()+\"年\"+(now.getMonth()+1)+\"月\"+now.getDate()+\"日\"+\"&nbsp;\");document.write(\"&nbsp;\"+\"星期\"+\"日一二三四五六\".charAt(new Date().getDay()));</script></div><div id=\"marquee\"><marquee class=\"dong\" scrollamount=\"2\">院有重点,科有特色,人有专长 Please enjoy the pain which is unable to avoid. 院有重点,科有特色,人有专长 Only has compared to the others early, diligently diligently, canfeel the successful taste. 院有重点,科有特色,人有专长 The study certainly is not the life complete. But, sincecontinually life part of - studies also is unable to conquer, what butalso can make?</marquee></div></div><div class=\"rightnav\"><img src=\"images/right_nav.jpg\" border=\"0\" /></div></div><!--logo--><div class=\"logo\"> <img src=\"images/logo_header.jpg\" border=\"0\" width=\"1000\" height=\"165\"/> </div><!--导航--><div class=\"nav\"><ul><li class=\"one\"><a href=\"#\">首&nbsp;&nbsp;&nbsp;&nbsp;页</a></li><li class=\"two\"><img src=\"images/shux.jpg\" border=\"0\" /></li><li class=\"one\"><a href=\"#\">医院新闻</a></li><li class=\"two\"><img src=\"images/shux.jpg\" border=\"0\" /></li><li class=\"one\"><a href=\"#\">科室动态</a></li><li class=\"two\"><img src=\"images/shux.jpg\" border=\"0\" /></li><li class=\"one\"><a href=\"#\">专题报道</a></li><li class=\"two\"><img src=\"images/shux.jpg\" border=\"0\" /></li><li class=\"one\"><a href=\"#\">医院论坛</a></li><li class=\"two\"><img src=\"images/shux.jpg\" border=\"0\" /></li><li class=\"one\"><a href=\"#\">共享资源</a></li></ul></div></div>";

将次字符串存入oracle 数据库中总是报个错:
  nested exception is java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 赋值变量的长度无效
为什么存不进去???

第二个问题,想将html代码存入数据库,并在页面进行展示,有什么好的方案??

各位大虾帮帮忙吧,急等 ing 。。。

------解决方案--------------------
ORACLE STRING 有个上限的 
你可以用 blob 或者clob类型
------解决方案--------------------
当字符串内容大于1000~2000时就出现异常情况。 

------解决方案--------------------
刚上面 有个地方错了 ORACLE 我估计你存STRING 是用VARCHAR吧 他上限是4000个字符
------解决方案--------------------
持久层用的啥? HIBERNATE ? 如果是的话 映射类型改成TEXT
------解决方案--------------------
那你好好检查字段类型 ~~ 以及 列明 是不是哪里出现小错误了 ~~