JDBC - Oracle ArrayIndexOutOfBoundsException

前端 未结 7 2171
北荒
北荒 2020-12-03 04:03

I\'m getting an Exception while trying to insert a row in oracle table. I\'m using ojdbc5.jar for oracle 11 this is the sql i\'m trying

INSERT INTO rule_def         


        
7条回答
  •  -上瘾入骨i
    2020-12-03 04:11

    When you don't have access to the oracle.jdbc.PreparedStatement class (and are forced to use java.sql.PreparedStatement, which does not support the methods #setXXXAtName()), the proposed solution to use named parameters is not an option.

    I've used the PreparedStatement and GeneratedKeyHolder approach for the mandatory values to be passed (luckily less than 7), and used the generated primary key returned to issue a simple SQL update for the remaining values.

提交回复
热议问题