爱问知识人 爱问教育 医院库

应用Spring操作oracle中clob类型字段有哪些?

首页

应用Spring操作oracle中clob类型字段有哪些?

应用Spring操作oracle中clob类型字段有哪些?

提交回答

全部答案

    2017-07-26 17:19:59
  •   
    1、 插入clob字段
    private LobHandler lobHandler = new DefaultLobHandler();;
    CommonsDbcpNativeJdbcExtractor nativeJdbcExtractor = = new CommonsDbcpNativeJdbcExtractor();
    String sql = "insert into gg (test1,colb1) values ('',?)";
    final String str = ""
    //Clob的值
    OracleLobHandler handler = new OracleLobHandler();
    handler。
      setNativeJdbcExtractor(this。nativeJdbcExtractor); this。lobHandler = (LobHandler) handler; jdbcTemplate。execute(sql, new AbstractLobCreatingPreparedStatementCallback(this。
      lobHandler){ protected void setValues(PreparedStatement ps, LobCreator lobCreator) throws SQLException, DataAccessException { lobCreator。
      setClobAsString(ps, 1 , str ); //设置详细的CLOB字段的内容 } } 2、 修改clob字段 public void modifyXML(String sql,final String xml){ CommonsDbcpNativeJdbcExtractor nativeJdbcExtractor = new CommonsDbcpNativeJdbcExtractor(); final OracleLobHandler handler = new OracleLobHandler(); handler。
      setNativeJdbcExtractor(nativeJdbcExtractor); RmProjectHelper。getCommonBsInstance()。doUpdate(sql, new PreparedStatementSetter(){ public void setValues(PreparedStatement ps) throws SQLException { handler。
      getLobCreator()。setClobAsString(ps, 1, xml); } }); }。

    M***

    2017-07-26 17:19:59

类似问题

换一换
  • 系统软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):