Java/jdbc
2020. 1. 21.
일괄 삭제 하기
public boolean deleteCustUsers(String ids[]) { String sql = " DELETE FROM CUSTUSER " + " WHERE ID=? "; Connection conn = null; PreparedStatement psmt = null; int count[] = new int[ids.length]; try { conn = getConnection(); conn.setAutoCommit(false); //넣다가 잘못될수있기떄문에 꺼준다 psmt = conn.prepareStatement(sql); for(int i = 0; i< ids.length; i++) { psmt.setString(1, ids[i]); psmt.addBatch();//누적 축적 } cou..