隨筆-153  評(píng)論-235  文章-19  trackbacks-0
                開發(fā)項(xiàng)目,今天又難到問題。junit測(cè)試寫數(shù)據(jù)到oracle時(shí),出現(xiàn):ORA-01461: can bind a LONG value only for insert into a LONG column錯(cuò)誤,郁悶,試了幾次發(fā)現(xiàn),中文才會(huì)有這個(gè)問題,而且jsp頁面里輸入的中文又不會(huì)報(bào)這個(gè)錯(cuò)(前端是struts)。像mysql的話,很有可能是數(shù)據(jù)庫字符編碼問題,就懷疑是否為字符編碼問題(這種思維不知道會(huì)不會(huì)很傻),因?yàn)轫?xiàng)目所有編碼都是utf-8, 看了下oracle是zhs16GBK。然后就建一個(gè)gbk的項(xiàng)目來測(cè)試,結(jié)果還是出現(xiàn)此問題。后來就換用舊系統(tǒng)的classes12.jar驅(qū)動(dòng)測(cè)試下,^_^, 不會(huì)了,太好了。看了下classes12.jar的版本是9.0.2.0.0的而且又是classes12.jar不爽,后來看到一個(gè)帖子,說:用9的和10.2的沒有此問題,我回去看下之前出問題的版本是10.1.0.2.0,郁悶,用的數(shù)據(jù)庫是10.2.0.1.0。馬上換成10.2.0.1.0的版本。當(dāng)初不注意,今天花了我?guī)讉€(gè)小時(shí)。我一直以為jdbc是數(shù)據(jù)庫對(duì)應(yīng)的。

          對(duì)應(yīng)的jdbc在oracle安裝目錄可以找到oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar

          問題總算解決,^_^
          posted on 2007-10-20 21:08 流浪汗 閱讀(25279) 評(píng)論(14)  編輯  收藏 所屬分類: oracle

          評(píng)論:
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-09-04 15:56 | 卡藍(lán)
          很好,按樓主的做法,問題解決了。
          萬分感謝!!!  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-12-07 20:51 | Super叮當(dāng)
          我也碰到了這種問題,按樓主的方法解決問題了 , 謝謝!  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2008-12-17 14:51 | 肖志偉
          太感謝你了  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-02-10 09:21 | Maicoln
          解決問題后,萬分感謝!  回復(fù)  更多評(píng)論
            
          # 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!  回復(fù)  更多評(píng)論
            
          # 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沒有這個(gè)安裝路徑,oracle\product\9.2.0\jdbc下只有classes12.jar這個(gè)文件,但是weblogic中用的默認(rèn)ojdbc14.jar
          在插入數(shù)據(jù)超過666個(gè)字符就拋出ora-01461這個(gè)錯(cuò)誤  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2009-05-04 17:20 | 流浪汗
          @charry_2008
          我那問題是中文亂碼問題,而你沒有,那可能字段是真正的不夠長了。可能要看下字段設(shè)置。  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2011-09-01 17:27 | EldDeng
          我也是這個(gè)問題,我用的是ojdbc14.jar,但還是報(bào)這個(gè)錯(cuò),看了你這個(gè)我試了classes12.jar,成功, 換了個(gè)ojdbc14.jar,也好的,原來的ojdbc14.jar應(yīng)該被破壞了
          太謝謝了!!  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2011-10-17 18:17 | 磊磊
          也許是lib下的包沒有導(dǎo)入  回復(fù)  更多評(píng)論
            
          # 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輸入漢字就報(bào)錯(cuò)  回復(fù)  更多評(píng)論
            
          # 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輸入漢字就報(bào)錯(cuò)
          我用的classes12.jar  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column 2013-02-05 15:52 | my12us
          樓主的方法固然能解決問題但是工程量太大了,我直接找了其他機(jī)子的oracle10.20.0的jdbc驅(qū)動(dòng)包把10.1.0.2.0的全換掉了 問題也解決了  回復(fù)  更多評(píng)論
            
          # re: ORA-01461: can bind a LONG value only for insert into a LONG column[未登錄] 2013-07-18 15:36 | 強(qiáng)強(qiáng)
          謝謝哈,我也解決啦。。。  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 长泰县| 金平| 花莲县| 应城市| 沙坪坝区| 萨嘎县| 靖江市| 九江市| 奉化市| 萍乡市| 盐边县| 靖安县| 十堰市| 大冶市| 诸暨市| 康平县| 崇义县| 吕梁市| 三河市| 日土县| 濮阳市| 承德县| 岐山县| 靖江市| 平安县| 株洲县| 玉龙| 北票市| 邵东县| 嵩明县| 汽车| 浙江省| 广水市| 玉门市| 耿马| 大厂| 大姚县| 鹤庆县| 枣阳市| 安塞县| 平远县|