相关疑难解决方法(0)

使用NamedParameterJdbcTemplate插入Clob

我通常使用lobHandler + JdbcTemplate + PreparedStatementSetter三元组将我的Clob插入到数据库中,正如我在http://www.java2s.com/Code/Java/Spring/InsertClobData.htm上看到的那样

我的问题是如何使用NamedParameterJdbcTemplate执行此操作?它没有接受神秘的PreparedStatementSetter接口作为参数的方法.

java database spring clob

6
推荐指数
1
解决办法
1万
查看次数

将CLOB插入Oracle数据库

我的问题是:ORA-01704: string literal too long在使用CLOBs 插入(或在查询中执行任何操作)时,如何解决错误?

我想要这样的查询:

INSERT ALL
   INTO mytable VALUES ('clob1')
   INTO mytable VALUES ('clob2') --some of these clobs are more than 4000 characters...
   INTO mytable VALUES ('clob3')
SELECT * FROM dual;
Run Code Online (Sandbox Code Playgroud)

当我尝试使用实际值时,虽然我ORA-01704: string literal too long回来了.这很明显,但是如何插入clobs(或者使用clob执行任何语句)?

我试过看过这个问题,但我认为它没有我想要的东西.我拥有的clob在a中List<String>,我遍历它们来做出声明.我的代码如下:

private void insertQueries(String tempTableName) throws FileNotFoundException, DataException, SQLException, IOException {
String preQuery = "  into " + tempTableName + " values ('";
String postQuery = "')" + StringHelper.newline;
StringBuilder inserts …
Run Code Online (Sandbox Code Playgroud)

java oracle jdbc insert clob

4
推荐指数
1
解决办法
4万
查看次数

标签 统计

clob ×2

java ×2

database ×1

insert ×1

jdbc ×1

oracle ×1

spring ×1