spring_6일차_MVC_CRUD

youuu·2022년 10월 24일
0

SPRING

목록 보기
7/33

⭐인터페이스 강점


표준화된 인터페이스를 사용.
개발자불편 / 운영자가 편함. >> 개발후 누구라도 사용 할 수 있다.



🚩 Content Select (게시물 조회)


📂 WEB-INF views

📋 HomeController.java

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<link href="resources/css/board.css" rel="stylesheet" type="text/css">



📋 BController.java 🔎 content_view

객체 자체를 보냄. request를 model에 보냄
model.addAttribute("request", request);
"request" : 이름 request :객체

package com.oracle.oMVCBoard.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.oracle.oMVCBoard.command.BCommand;
import com.oracle.oMVCBoard.command.BContentCommand;
import com.oracle.oMVCBoard.command.BListCommand;

@Controller
public class BController {
	private static final Logger logger = LoggerFactory.getLogger(BController.class);
	
	BCommand command = null;
	
	@RequestMapping("list")
	public String list(Model model) {
		logger.info("list start....");
		
		// 실제 MAPPING 할것 적기
		command = new BListCommand();
		command.execute(model);
		return "list";
	}
	
	@RequestMapping("/content_view")
	public String content_view(HttpServletRequest request, Model model) {
		System.out.println("content_view()");
		
		model.addAttribute("request", request); // "request" : 이름  request:객체
		command = new BContentCommand();
		command.execute(model);
		
		return "content_view";
	}
}



📋 BContentCommand.java

asMap 을 쓰면 model을 map으로 보내줌
request란 이름으로 넘겨줬으므로 request로 부름

  • (HttpServletRequest) map.get("request");에서 HttpServletRequest으로 캐스팅해준이유 ❓
package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;
import com.oracle.oMVCBoard.dto.BDto;

public class BContentCommand implements BCommand {

	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap(); //asMap 을 쓰면 model을 map으로 보내줌
		HttpServletRequest request = (HttpServletRequest) map.get("request"); 
		String bId = request.getParameter("bId");
		
		BDao dao = new BDao();
		BDto board = dao.contentView(bId);
		
		model.addAttribute("mvc_board", board);
	}
}



📋 BDao.java 🔎 contentView

😬 오류가 나옴. java.sql.SQLException: 인덱스에서 누락된 IN 또는 OUT 매개변수:: 1
🧪 해결 : pstmt.setInt(1, Integer.parseInt(strId)); 이거랑 또 뭔가가 있었다.

package com.oracle.oMVCBoard.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

import com.oracle.oMVCBoard.dto.BDto;

public class BDao {
	DataSource dataSource;
	
	public BDao() {
		
		try {
			Context context = new InitialContext();
			dataSource = (DataSource) context.lookup("java:comp/env/jdbc/OracleDB");
		} catch (NamingException e) {
			System.out.println("생성자 dataSource --> " + e.getMessage());
			e.printStackTrace();
		}
	}
	
    // 게시물 리스트 조회
	public ArrayList<BDto> boardList() {
		ArrayList<BDto> bList = new ArrayList<BDto>();
		Connection connection = null;
		PreparedStatement preparedStatement = null;
		ResultSet rs = null;
		
		System.out.println("BDao boardList Start ... ");
		
		System.out.println("ArrayList<BDto> bList  ----------> " + bList);
		
		try {
			connection = dataSource.getConnection();
			String sql = "SELECT bId, bName, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent "
					   + "FROM mvc_board "
					   + "order by bGroup desc, bStep asc";
			preparedStatement = connection.prepareStatement(sql);
			
			System.out.println("BDao sql -->" + sql);
			
			rs = preparedStatement.executeQuery();
			
			//  
			while (rs.next()) {
				int bId 		= rs.getInt("bId");
				String bName 	= rs.getString("bName");
				String bTitle 	= rs.getString("bTitle");
				String bContent = rs.getString("bContent");
				Timestamp bDate	= rs.getTimestamp("bDate");
				int bHit 		= rs.getInt("bHit");
				int bGroup 		= rs.getInt("bGroup");
				int bStep 		= rs.getInt("bStep");
				int bIndent 	= rs.getInt("bIndent");
				
				BDto dto = new BDto (bId, bName, bTitle, bContent, 
									 bDate, bHit, bGroup, bStep, bIndent);
				
				bList.add(dto);
				System.out.println("bName  ==> " + bName);
			}
			
		} catch (Exception e) {
			System.out.println("list dataSource -->" + e.getMessage());
			e.printStackTrace();
		} finally {
			try {
				if(connection != null) 		  connection.close();
				if(preparedStatement != null) preparedStatement.close();
				if(rs != null) 		  		  rs.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		return bList;
	}
		
        // 게시물조회
		public BDto contentView(String strId) {
		BDto dto = null;
		Connection conn = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		
		System.out.println("BDao content_view Start ... ");
		
		try {
			conn = dataSource.getConnection();
			String sql = "SELECT * FROM mvc_board where bId = ?";
			pstmt = conn.prepareStatement(sql);
			pstmt.setInt(1, Integer.parseInt(strId));
//			pstmt.setString(1, "strId");
			rs = pstmt.executeQuery();
			
			if (rs.next()) {
				int bId 		= rs.getInt("bId");
				String bName 	= rs.getString("bName");
				String bTitle 	= rs.getString("bTitle");
				String bContent = rs.getString("bContent");
				Timestamp bDate	= rs.getTimestamp("bDate");
				int bHit 		= rs.getInt("bHit");
				int bGroup 		= rs.getInt("bGroup");
				int bStep 		= rs.getInt("bStep");
				int bIndent 	= rs.getInt("bIndent");
				
				dto = new BDto (bId, bName, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent);
	
				System.out.println("bId  ==> " + bId);
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
				if(rs != null)	  rs.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		return dto;
	}
}



📋 content_view.jsp

화면단

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="header.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="modify" method="post">
		<input type="hidden" name="bId" value="${mvc_board.bId}">
		<table border="1">
			<tr>
				<td>번호</td><td>${mvc_board.bId}</td>
			</tr>
			<tr>
				<td>히트</td><td>${mvc_board.bHit}</td>
			</tr>
			<tr>
				<td>이름</td><td><input type="text" name="bName" value="${mvc_board.bName}"></td>
			</tr>
			<tr>
				<td>제목</td>
				<td><input type="text" name="bTitle" value="${mvc_board.bTitle}"></td>
			</tr>
			<tr>
				<td>내용</td>
				<td><input type="text" name="bContent" value="${mvc_board.bContent}"></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="수정">&nbsp;&nbsp;
				<a href="list">목록보기</a>&nbsp;&nbsp;
				<a href="delete?bId=${mvc_board.bId}">삭제</a>&nbsp;&nbsp;
				<a href="reply_view?bId=${mvc_board.bId}">답변</a>&nbsp;&nbsp;
			</td>
		</table>
	</form>

</body>
</html>

💻 결과화면 :

BController에서 실행




🚩 조회수 증가


📋 content_view.jsp 🔎 upHit

content_view에서 아래 추가 upHit(strId);

// 게시물조회
	public BDto contentView(String strId) {
		upHit(strId);



📋 BDao.jsp 🔎 upHit

int rn = pstmt.executeUpdate();
// 그냥 받아놓은것. >> 받아놓으면 나중에 검증할때 편함. 변경시에 리턴값 주기 편함.

	private void upHit(String strId) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		
		System.out.println("BDao upHit Start ... ");
		
		try {
			conn = dataSource.getConnection();
			String sql = "update mvc_board set bHit=bHit+1 where bId = ?";
			pstmt = conn.prepareStatement(sql);
			pstmt.setInt(1, Integer.parseInt(strId));
			
			int rn = pstmt.executeUpdate(); // 그냥 받아놓은것. >> 받아놓으면 나중에 검증할때 편함. 변경시에 리턴값 주기 편함.
//			pstmt.executeUpdate(); // 이렇게 써도 됨.
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}

결과 : 조회수 증가 성공



🚩 Update 수정


같은 화면은 하나 더 만들 이유가 없다. 있는 화면 재활용하기

📋 BController.java 🔎 modify

컨트롤러에 추가.

	@RequestMapping(value = "/modify", method = RequestMethod.POST)
	public String modify(HttpServletRequest request, Model model) { //Model에 담아가야하기 때문에
		logger.info("modify Start....");
		model.addAttribute("request", request);
		command = new BModifyCommand();
		command.execute(model);
		
		return "redirect:list";
	}



📋 BModifyCommand.java

String bId = request.getParameter("bId"); 파라메터로 받을수도 있지만
🔺 Dto를 만들어 사용하는것이 권장.

  • 만들면 modify에 밑줄 뜬다. BDao에서 modify를 만들어줘야한다.
package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;
import com.oracle.oMVCBoard.dto.BDto;

public class BContentCommand implements BCommand {

	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap(); //asMap 을 쓰면 model을 map으로 보내줌
		HttpServletRequest request = (HttpServletRequest) map.get("request"); 
		String bId = request.getParameter("bId");
		
		BDao dao = new BDao();
		BDto board = dao.contentView(bId);
		
		model.addAttribute("mvc_board", board);
	}
}



📋 BDao.java 🔎 modify

void modify 만들기.

  • String bId, String bName, String bTitle, String bContent을 보냈다.
    ❗ 값 보내는 것은 PK + 수정할 내용들
	public void modify(String bId, String bName, String bTitle, String bContent) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		
		try {
			conn = dataSource.getConnection();
			
			String sql = "update mvc_board set bName=?, bTitle=?, bContent=? where bId=?";
			
			System.out.println("BDao modify sql ->" + sql);
			
			pstmt = conn.prepareStatement(sql);
			
			pstmt.setString(1, bName);
			pstmt.setString(2, bTitle);
			pstmt.setString(3, bContent);
			pstmt.setInt   (4, Integer.parseInt(bId));
				
			int	rn = pstmt.executeUpdate();
	
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}

💻 결과화면 :





🚩 Delete 삭제


이전것들 보고 해서 일단은 성공! 😬 안보고는 못해..


📋 BController.java 🔎 delete

컨트롤러에 추가. '@RequestMapping("/delete")'
return "redirect:list"; delete 후에 list로 이동

	@RequestMapping("/delete")
	public String delete(HttpServletRequest request, Model model) { //Model에 담아가야하기 때문에
		System.out.println("delete() Start....");
		model.addAttribute("request", request);
		command = new BDeleteCommand();
		command.execute(model);
		
		return "redirect:list";
	}



📋 BDeleteCommand.java

과제, -> 수업중 시간안에 완성해보기.

  • 1.BDeleteCommand Service 파일 생성
    1) model이용 , map 선언
    2) request 이용 -> bId 추출
    3) dao instance 선언
    4) delete method 이용하여 삭제
package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;
import com.oracle.oMVCBoard.dto.BDto;

public class BDeleteCommand implements BCommand {

	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap(); //asMap 을 쓰면 model을 map으로 보내줌
		HttpServletRequest request = (HttpServletRequest) map.get("request"); 
		String bId = request.getParameter("bId");
		
		BDao dao = new BDao();
		BDto board = dao.delete(bId);
		
		model.addAttribute("mvc_board", board);
	}
}



📋 BDao.java

delete를 해서 >> int rn = pstmt.executeUpdate();

	public BDto delete(String bId) {
		BDto dto = null;
		Connection conn = null;
		PreparedStatement pstmt = null;
		System.out.println("BDto delete Start ... ");
		
		try {
			conn = dataSource.getConnection();
			String sql = "delete from mvc_board where bId = ?";
					
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, bId);
			int rn = pstmt.executeUpdate();
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		return dto;
	}




🚩 Insert 글작성


📌📋 HomeController.java 🔎write_view

	@RequestMapping("/write_view")
	public String writeView(Model model) { //Model에 담아가야하기 때문에
		logger.info("write_view Start...");

		return "write_view";
	}



📋 write_view.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="header.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Content Write</title>
</head>
<body>
	<form action="write" method="post">
		<table width="500" border="1">
			<tr>
				<td>이름</td>
				<td><input type="text" name="bName" size="50"></td>
			</tr>
			<tr>
				<td>제목</td>
				<td><input type="text" name="bTitle" size="50"></td>
			</tr>
			<tr>
				<td>내용</td>
				<td><textarea name="bContent" rows="10"></textarea></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="입력">&nbsp;&nbsp;
					<a href="list">목록보기</a>
				</td>
		</table>
	</form>
</body>
</html>



📌📋 BController.java 🔎write

DB에서 insert가 된것은 확인이 되었는데 화면에서 오류났다.
😬 return "redirect:list"; 이부분이 빠져서이다. 내용은 넣었는데 이동이 안되어서 오류!

  • BWriteCommand 에 밑줄뜨면 >> 만들기. BWriteCommand.java
	@PostMapping(value = "/write")
	public String write(HttpServletRequest request, Model model) { 
		logger.info("write Start...");
		model.addAttribute("request", request);
		command = new BWriteCommand();
		command.execute(model);
		
		return "redirect:list";
	}



📋 BWriteCommand.java 📌 write

작성하면 write에 밑줄 -> DAO - write 작성

package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;

public class BWriteCommand implements BCommand {

	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap();
		HttpServletRequest request = (HttpServletRequest) map.get("request");
		
		String bName = request.getParameter("bName");
		String bTitle = request.getParameter("bTitle");
		String bContent = request.getParameter("bContent");
		
		BDao dao = new BDao();
		dao.write(bName, bTitle, bContent);
	}
}



📋 BDao.java 🔎 write

작성하면 write에 밑줄 -> write.java 작성

	public void write(String bName, String bTitle, String bContent) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		
		try {
			conn = dataSource.getConnection();
			
			String sql = "insert into mvc_board (bId, bName, bTitle, bContent, bHit, bGroup, bStep, bIndent, bDate) "
					   + "values (mvc_board_seq.nextval, ?, ?, ?, 0, mvc_board_seq.currval, 0,  0, sysdate)";
			
			System.out.println("BDao write sql ->" + sql);
			
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, bName);
			pstmt.setString(2, bTitle);
			pstmt.setString(3, bContent);
			int	rn = pstmt.executeUpdate();
	
		} catch (Exception e) {
			System.out.println("write dataSource -->" + e.getMessage());
			e.printStackTrace();
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}

#### 💻 결과화면 : ![](https://velog.velcdn.com/images/youna3332/post/3701dae6-da39-4255-96dd-40e33695c020/image.png) ![](https://velog.velcdn.com/images/youna3332/post/b77ef13e-32e4-4e7c-9038-a0e41dc9a448/image.png)




🚩 Reply 댓글작성


로직에선 조회 후 답글 달기로 진행.


### 📌📋 BController.java 🔎 reply_view > 쭉쭉 만들기. `BController` > `BReplyViewCommand` > `reply_view.jsp` > `BController`
	@RequestMapping("/reply_view")
	public String reply_view(HttpServletRequest request, Model model) { //Model에 담아가야하기 때문에
		System.out.println("reply_view Start....");
		model.addAttribute("request", request);
		command = new BReplyViewCommand();
		command.execute(model);
		
		return "reply_view";
	}



📋 BReplyViewCommand.java

쭉쭉 만들기. BController > BReplyViewCommand > reply_view.jsp > BController

package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;
import com.oracle.oMVCBoard.dto.BDto;

public class BReplyViewCommand implements BCommand {

	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap();
		HttpServletRequest request = (HttpServletRequest) map.get("request");
		
		String bId  = request.getParameter("bId");
		
		BDao dao = new BDao();
		BDto dto = dao.reply_view(bId);

		model.addAttribute("reply_view", dto);
	}
}



📋 reply_view.jsp

수정하면 안되는 값은 hidden으로 가져가기.
select * 해야하기 때문에 모든 칼럼이 필요하다.

&<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="header.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="reply" method="post">
		<input type="hidden" name="bId" value="${reply_view.bId}">
		<input type="hidden" name="bGroup" value="${reply_view.bGroup}">
		<input type="hidden" name="bStep" value="${reply_view.bStep}">
		<input type="hidden" name="bIndent" value="${reply_view.bIndent}">
		<table width="500" border="1">
			<tr>
				<td>번호</td><td>${reply_view.bId}</td>
			</tr>
			<tr>
				<td>히트</td><td>${reply_view.bHit}</td>
			</tr>
			<tr>
				<td>이름</td><td><input type="text" name="bName" value="${reply_view.bName}"></td>
			</tr>
			<tr>
				<td>제목</td>
				<td><input type="text" name="bTitle" value="[답변]"+"${reply_view.bTitle}"></td>
			</tr>
			<tr>
				<td>내용</td>
				<td><textarea rows="10" name="bContent">${reply_view.bContent}</textarea></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="답변저장">&nbsp;&nbsp;
				<a href="list">목록</a>
			</td>
		</table>
	</form>

</body>
</html>



📌📋 BController.java 🔎 reply

reply 입,출력. 댓글 작성시 + 1
수행후 redirect:list로 이동

  • BReplyCommand 작성
	@RequestMapping(value = "/reply", method = RequestMethod.POST)
	public String reply(HttpServletRequest request, Model model) { //Model에 담아가야하기 때문에
		logger.info("reply2 Start...");
		
		model.addAttribute("request", request);
		command = new BReplyCommand();
		command.execute(model);
		
		return "redirect:list";
	}



📋 BReplyCommand.java

  • 1.BReplyCommand Service 파일 생성
    • model이용 , map 선언
    • request 이용 -> bid, bName, bTitle, bContent ,bGroup, bStep, bIndent 추출
    • dao instance 선언
    • reply method 이용하여 댓글저장
    • dao.reply(bId, bName, bTitle, bContent, bGroup, bStep, bIndent);
package com.oracle.oMVCBoard.command;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.oracle.oMVCBoard.dao.BDao;

public class BReplyCommand implements BCommand {

//	

	
	@Override
	public void execute(Model model) {
		Map<String, Object> map = model.asMap();
		HttpServletRequest request = (HttpServletRequest) map.get("request");
		
		String bId = request.getParameter("bId");
		String bName = request.getParameter("bName");
		String bTitle = request.getParameter("bTitle");
		String bContent = request.getParameter("bContent");
		String bGroup = request.getParameter("bGroup");
		String bStep = request.getParameter("bStep");
		String bIndent = request.getParameter("bIndent");
		
		BDao dao = new BDao();
		dao.reply(bId, bName, bTitle, bContent, bGroup, bStep, bIndent);
	}
}



📋 BDao.java 🔎 reply

과제.
😬 계속 안됐는데 pstmt.executeUpdate(sql2); 를 담아가서 그랬다.

public void reply(String bId, String bName, String bTitle, String bContent, String bGroup, String bStep, String bIndent) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		
		try {
			conn = dataSource.getConnection();
			String sql = "insert into mvc_board (bId, bName, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent)  " 
				       + "values (mvc_board_seq.nextval, ?, ?, ?, sysdate, 0, ?, ?, ?)";
			
			String sql2 = "update mvc_board set bStep = bStep + 1 where bGroup=? and bStep > ?";		
			
				pstmt = conn.prepareStatement(sql2);
				pstmt.setInt(1, Integer.parseInt(bGroup));
				pstmt.setInt(2, Integer.parseInt(bStep));
				pstmt.executeUpdate();
				pstmt.close();

				pstmt = conn.prepareStatement(sql);
				pstmt.setString(1, bName);
				pstmt.setString(2, bTitle);
				pstmt.setString(3, bContent);
				pstmt.setInt(4, Integer.parseInt(bGroup));
				pstmt.setInt(5, Integer.parseInt(bStep)+1);
				pstmt.setInt(6, Integer.parseInt(bIndent)+1);
				
				pstmt.executeUpdate();
				
				System.out.println("bName  ==> " + bName);
		} catch (Exception e) {
			System.out.println("reply -->" + e.getMessage());
			e.printStackTrace();
		} finally  {
			try {
				if(conn != null)  conn.close();
				if(pstmt != null) pstmt.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}
profile
공부중인 주니어 개발자

0개의 댓글