encountered SQLException [数据大小超出此类型的最大值: 6326]; 
你插入数据的某一行的某一列的数据大小超过数据库的限制!

解决方案 »

  1.   

    varchar2 的长度大小是有限制的,我记得好像是到不了4000
    如果太长的话,建议用blob
      

  2.   

    换类型吧 varchar2 不支持 6326 这么长的
      

  3.   

    您用没有用hibernater 前几天我也出现过这样的问题
    如果用的话,pojo 中的类型还是String .hbm中的类型是text 数据库为Clob
    这样就好用了
      

  4.   

    要是觉得分不够,可以加分噢,XDJM们帮帮忙啊
      

  5.   

    你确定是BLOB字段问题嘛?
    这里有你类似的问题,看看吧
    http://topic.csdn.net/t/20061024/14/5105197.html
      

  6.   

    貌似要用empty_clob,搜一下吧,或者先看看这个
    http://www.cnblogs.com/ungshow/archive/2008/10/16/1312675.html
      

  7.   


    public String insert(MetaEvent objMetaEvent){
    String str="";
    DBTool  db=null;
    Connection  con=null;
    PreparedStatement  ps=null;
    ResultSet rs=null;
    try{
    db=new DBTool();
    con=db.connection();
    con.setAutoCommit(false);
    //获取下一个序列值
    Long lId=0L;
    String s ="select S_Event_ID.NEXTVAL from dual";
    ps = con.prepareStatement(s);
    rs = ps.executeQuery();
    if(rs.next())
    {
    lId=rs.getLong(1);
    }
    s="insert into T_EventBackup(id,pid,ForeignId,eventHead,eventHeadYear,eventHeadNum,secrecyLevel_code,eventType_Id,EVENTLEVEL_CODE," +
    "reportDepartment,eventCaption,eventTime,eventAddress,BriefMatter,reportPerson,onDutyPerson_id," +
    "signPerson_id,attachmentName,attachmentPath)"+" values("+lId+",?,?,?,?,?,?,?,?,?,?" +
    ",to_date(?,'YYYY-MM-DD HH24-mi-ss'),?,empty_clob(),?,?,?,?,?)"; ps=con.prepareStatement(s);
    int i=1;
    ps.setLong(i++, objMetaEvent.getPid());
    ps.setLong(i++, objMetaEvent.getId());
    ps.setString(i++, objMetaEvent.getEventHead());
    ps.setLong(i++, objMetaEvent.getEventHeadYear());
    ps.setLong(i++, objMetaEvent.getEventHeadNum());
    ps.setString(i++, objMetaEvent.getSecrecyLevel_code());
    ps.setLong(i++, objMetaEvent.getEventType_Id());
    ps.setString(i++, objMetaEvent.getEventLevel_code());

    ps.setString(i++, objMetaEvent.getReportDepartment());
    ps.setString(i++, objMetaEvent.getEventCaption());
    ps.setString(i++, objMetaEvent.getEventTime());
    ps.setString(i++, objMetaEvent.getEventAddress());

    ps.setString(i++, objMetaEvent.getReportPerson());
    ps.setLong(i++, objMetaEvent.getOnDutyPerson_id());
    ps.setLong(i++, objMetaEvent.getSignPerson_id());
    ps.setString(i++, objMetaEvent.getAttachmentName());
    ps.setString(i++, objMetaEvent.getAttachmentPath());

    ps.executeUpdate();
    //插入clob字段
    rs.close();
    rs=null;
    ps.close();
    ps=null;
    s="SELECT BriefMatter FROM T_EventBackup WHERE id="+lId+"FOR UPDATE";
    ps=con.prepareStatement(s);
    rs=ps.executeQuery();
    if(rs.next()){
    Clob clobColumn=null;
    clobColumn=rs.getClob(1);
    DbClob.fillClob((CLOB)clobColumn, objMetaEvent.getBriefMatter());
    con.commit();//执行
    }

    }catch(Exception e){
    str=e.getMessage();
    }finally{
    try{if(rs!=null){rs.close();rs=null;}}catch(Exception e){str=e.getMessage();}
    try{if(ps!=null){ps.close();ps=null;}}catch(Exception e){str=e.getMessage();}
    try{if(con!=null){con.close();con=null;}}catch(Exception e){str=e.getMessage();}
    }
    return str;
    }给你个例子
    先获得,下个序列号,设置提交为手动提交,con.setAutoCommit(false);
    插入其他非clob或者blob字段,他们(clob和Blob)用empty_clob()
    然后在获得该(clob和Blob)字段,重新填充。
      

  8.   


     static public void fillClob (CLOB clob, String data) throws Exception
    {
    if (data == null) 
    {      
    data = "";    
    }
    if (clob != null) 
    {
    Writer wr = clob.getCharacterOutputStream();
    wr.write(data);
    wr.flush();
    wr.close();
    }
    }
    DbClob.fillClob((CLOB)clobColumn, objMetaEvent.getBriefMatter());