2
私はこのコードサポートされていない機能の例外fetchDmlReturnParamsは
String sql = "insert into colortable (string, color, cid) values (?,?,?)";
PreparedStatement ps = conn.prepareStatement(sql,keyProperties.toArray(new String[0]));
ps.executeBatch();
final ResultSet rst = ps.getGeneratedKeys();
while (rst.next()) {
final BigDecimal bigDecimal = rst.getBigDecimal(1);
if (bigDecimal != null) {
ids.add(bigDecimal.intValueExact());
}
}
を持っています。
Caused by: java.sql.SQLException: Unsupported feature
at oracle.jdbc.driver.OracleStatement.fetchDmlReturnParams(OracleStatement.java:4959) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OracleReturnResultSet.next(OracleReturnResultSet.java:63) ~[ojdbc6.jar:11.2.0.4.0]
問題がojdbcドライバのこの部分にあることがわかりました。関数this.statement.fetchDmlReturnParams(特に
if (!this.statement.returnParamsFetched) {
this.statement.fetchDmlReturnParams();
this.statement.setupReturnParamAccessors();
}
)。は実装されていません。
今私の質問は、特にreturnParamFetchedをtrueに設定することができますこの関数を呼び出すことを避けるためにですか?