2010-12-01 1 views

答えて

7

を彼の春のクラスについての短い説明を与えることができます。

This codeはどのように使用されるかを示します。

importEmployeesメソッドをよく見てください。すべてがクリアになるはずです。

+0

感謝:) –

0

次のようにbatchUpdateメがJdbcTemplate batchUpdateメソッドを使用して行うことができます..あなたそんなに男:)今明らか

public int[] batchUpdate(final List<Actor> actors) { 
int[] updateCounts = jdbcTemplate.batchUpdate("update t_actor set first_name = ?, " + 
"last_name = ? where id = ?", 
new BatchPreparedStatementSetter() { 
public void setValues(PreparedStatement ps, int i) throws SQLException { 
ps.setString(1, actors.get(i).getFirstName()); 
ps.setString(2, actors.get(i).getLastName()); 
ps.setLong(3, actors.get(i).getId().longValue()); 
} 
public int getBatchSize() { 
return actors.size(); 
} 
}); 
return updateCounts; 
} 
関連する問題