public void addMoretopic(final List<Subtopic> list) throws Exception {
{
String sql = "insert into " + super.TABLE_ZNZJ_SUBJECT
+ " values(znzj_subject_seq.nextval,?,?,?,?,?,?,?,?,?)";
this.getJdbcTemplate().batchUpdate(sql,
new BatchPreparedStatementSetter() { public int getBatchSize() {
return list.size();
} public void setValues(PreparedStatement ps, int i)
throws SQLException {
Subtopic sb = list.get(i);
ps.setString(1, sb.getSubjectTitle());
ps.setString(2, DoMhtChar.dotuChar(sb
.getSubjectContent()));
ps.setString(3, DoMhtChar.dotuChar(sb
.getSubjectAnswer()));
ps.setString(4, DoMhtChar.dotuChar(sb
.getSubjectPicture()));
ps.setInt(5, sb.getGrade().getGradeID());
ps.setInt(6, sb.getExsubj().getExamSubjectID());
ps.setInt(7, sb.getStype().getSubtypeId());
ps.setTimestamp(8, new Timestamp(sb
.getSubjectCtime().getTime()));
ps.setString(9, DoMhtChar.dotuChar(sb
.getAnswerpic()));
}
});
}
我想问的是,上面这个PreparedStatement ps,这个ps需要关闭吗,需要的话,怎么关闭?
我在程序中直接ps.close();
报错:
Caused by: java.sql.SQLException: 索引中丢失  IN 或 OUT 参数:: 1