【发布时间】:2017-05-05 17:08:26
【问题描述】:
我想在 oracle 数据库中的表中插入一个 blob。但我不知道其他列的数据类型。我想以 Object 类型传递其他列的值。
我知道我可以使用以下代码插入 blob 值。
jdbcTemplate.update(
"INSERT INTO LOB_ (BLOB_) VALUES (?)",
new Object[]{new SqlLobValue(inputStream)},
new int[]{Types.BLOB}
);
但我的问题是,我不知道其他列的类型。那么如何将类型数组中的类型指定为update(query, args, typeArgs)方法的第三个参数。
是否有任何值(如通配符)来告诉 jdbctemplate 跳过检查其他列的类型?
我想要这样的东西?
jdbcTemplate.update(
"INSERT INTO LOB_ (BLOB_, NAME, AGE) VALUES (?, ?, ?)",
new Object[]{new SqlLobValue(inputStream), "Some string", 34},
new int[]{Types.BLOB, ?, ?}
);
【问题讨论】:
标签: java sql oracle blob spring-jdbc