-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PreparedStatement addBatch() / MyBatis foreach #185
Comments
PreparedStatement addBatch()
while(...) {
...
// addBatch에 담기
pstmt.addBatch();
// 파라미터 Clear
pstmt.clearParameters() ;
// 건수를 나눠서 건 단위로 커밋
if ( (i % 10000) == 0){
// Batch 실행
pstmt.executeBatch() ;
// Batch 초기화
pstmt.clearBatch();
// 커밋
con.commit() ;
}
}
|
MyBatis foreach
<update id="update" parameterType="java.util.List">
<foreach collection="list" item="dto" open="DECLARE BEGIN" separator=";" close="END;">
UPDATE [테이블명]
name = #{dto.name}
WHERE BLD_ID = #{dto.bldId}
AND OP_DT = #{dto.optDt}
AND OP_SEQ = #{dto.opSeq}
</foreach>
</update>
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PreparedStatement addBatch() / MyBatis foreach
관련 개념 #109
The text was updated successfully, but these errors were encountered: