随笔-153  评论-235  文章-19  trackbacks-0
      开发项目,今天又难到问题。junit测试写数据到oracle时,出现:ORA-01461: can bind a LONG value only for insert into a LONG column错误,郁闷,试了几次发现,中文才会有这个问题,而且jsp页面里输入的中文又不会报这个错(前端是struts)。像mysql的话,很有可能是数据库字符编码问题,就怀疑是否为字符编码问题(这种思维不知道会不会很傻),因为项目所有编码都是utf-8, 看了下oracle是zhs16GBK。然后就建一个gbk的项目来测试,结果还是出现此问题。后来就换用旧系统的classes12.jar驱动测试下,^_^, 不会了,太好了。看了下classes12.jar的版本是9.0.2.0.0的而且又是classes12.jar不爽,后来看到一个帖子,说:用9的和10.2的没有此问题,我回去看下之前出问题的版本是10.1.0.2.0,郁闷,用的数据库是10.2.0.1.0。马上换成10.2.0.1.0的版本。当初不注意,今天花了我几个小时。我一直以为jdbc是数据库对应的。

对应的jdbc在oracle安装目录可以找到oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar

问题总算解决,^_^
posted on 2007-10-20 21:08 流浪汗 阅读(25191) 评论(14)  编辑  收藏 所属分类: oracle

评论:
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-09-04 15:56 | 卡蓝
很好,按楼主的做法,问题解决了。
万分感谢!!!  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-12-07 20:51 | Super叮当
我也碰到了这种问题,按楼主的方法解决问题了 , 谢谢!  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-12-17 14:51 | 肖志伟
太感谢你了  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-02-10 09:21 | Maicoln
解决问题后,万分感谢!  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-03-31 16:25 | annoymous
Good job! You're a goddamn genius!  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-04-14 11:49 | 12
感谢  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-05-04 16:02 | charry_2008
oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar
我的oracle9.2没有这个安装路径,oracle\product\9.2.0\jdbc下只有classes12.jar这个文件,但是weblogic中用的默认ojdbc14.jar
在插入数据超过666个字符就抛出ora-01461这个错误  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-05-04 17:20 | 流浪汗
@charry_2008
我那问题是中文乱码问题,而你没有,那可能字段是真正的不够长了。可能要看下字段设置。  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2011-09-01 17:27 | EldDeng
我也是这个问题,我用的是ojdbc14.jar,但还是报这个错,看了你这个我试了classes12.jar,成功, 换了个ojdbc14.jar,也好的,原来的ojdbc14.jar应该被破坏了
太谢谢了!!  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2011-10-17 18:17 | 磊磊
也许是lib下的包没有导入  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column[未登录] 2012-06-29 18:05 | 丫丫
怎么处理
ORA-01461: can bind a LONG value only for insert into a LONG column
我在jsp输入汉字就报错  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column[未登录] 2012-06-29 18:07 | 丫丫
ORA-01461: can bind a LONG value only for insert into a LONG column
我在jsp输入汉字就报错
我用的classes12.jar  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column 2013-02-05 15:52 | my12us
楼主的方法固然能解决问题但是工程量太大了,我直接找了其他机子的oracle10.20.0的jdbc驱动包把10.1.0.2.0的全换掉了 问题也解决了  回复  更多评论
  
# re: ORA-01461: can bind a LONG value only for insert into a LONG column[未登录] 2013-07-18 15:36 | 强强
谢谢哈,我也解决啦。。。  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: