Written by
django-style
on
on
20211204 TIL
20211204 TIL
//reply 글의 형태를 생성하는 메서드 private void replyShape(String strGroup, String strStep) { String query = "update board3 set bStep = bStep + 1 " +"where bGroup = ? and bStep > ?"; // 같은 그룹내에 존재하면서, 현재 존재하는 댓글의 스탭이 새롭게 생성되는 댓글의 스텝보다 큰 스텝에 한해서 // 스텝을 1 증가시킨다. try { conn = ds.getConnection(); pstmt = conn.prepareStatement(query); pstmt.setInt(1,Integer.parseInt(strGroup)); pstmt.setInt(2,Integer.parseInt(strStep)); pstmt.executeUpdate(); }catch(Exception e) { e.printStackTrace(); }finally { try { if(pstmt != null)pstmt.close(); if(conn != null)conn.close(); }catch(Exception e2) {} }
from http://cozzilzzil2.tistory.com/46 by ccl(A) rewrite - 2021-12-04 17:27:03