虚位以待(AD)
虚位以待(AD)
首页 > 数据库 > Oracle数据库 > oracle数据库中clob字段的修改

oracle数据库中clob字段的修改
类别:Oracle数据库   作者:码皇   来源:互联网   点击:

oracle数据库中clob字段的修改Java代码 www 2cto com String sqlsel2 = "select jsonbody from db_ps_listcatalog where" + " listtype =& 39;sh11& 39; for update";
oracle数据库中clob字段的修改   Java代码    www.2cto.com    //String sqlsel2 = "select jsonbody from db_ps_listcatalog where" +   //          "  listtype ='sh11' for update";   //      String col="jsonbody";      public  boolean updateClob(String sql,String col,String buf){           boolean flag=false;             Statement stem=null;             Connection conn=null;             ResultSet rs=null;             Writer wr = null;             try{                    conn= dp.getConnection();                    conn.setAutoCommit(false);                     stem=conn.createStatement();                    rs = stem.executeQuery(sql);                     if (rs.next()) {                         CLOB clob = (CLOB) rs.getClob(col);                         java.lang.reflect.Method methodToInvoke = clob.getClass().getMethod(                                   "getCharacterOutputStream", (Class[]) null);                        wr = (Writer) methodToInvoke.invoke(clob, (Object[]) null);                        BufferedWriter bw = new BufferedWriter(wr);                        bw.write(buf);                        bw.flush();                        bw.close();                        conn.commit();                         conn.close();                     }                     flag=true;           } catch (Exception ex){                 try {                    conn.rollback();                } catch (SQLException e) {                    e.printStackTrace();                }           }           return flag;       }  
 
相关热词搜索: oracle 数据库中 clob