Skip to content

Instantly share code, notes, and snippets.

@enujo
enujo / [mySQL] Create Code
Last active January 6, 2017 08:00
spring mvc insert
-- 테이블 생성
CREATE TABLE board (
board_no INT(10) NOT NULL COMMENT '글 번호',
board_title VARCHAR(50) NOT NULL COMMENT '제목',
board_content TEXT NOT NULL COMMENT '내용',
board_user VARCHAR(50) NOT NULL COMMENT '사용자',
board_pw VARCHAR(20) NOT NULL COMMENT '비밀번호',
board_date DATE NOT NULL COMMENT '작성날짜',
PRIMARY KEY (board_no)
)DEFAULT CHARSET=euckr
@enujo
enujo / Board.java
Created January 6, 2017 05:48
spring mvc insert
package com.tistory.luahius.service;
public class Board {
private int boardNo;
private String boardPw;
private String boardTitle;
private String boardContent;
private String boardUser;
private String boardDate;
@enujo
enujo / boardAdd.jsp
Created January 6, 2017 05:56
spring mvc insert
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BOARD ADD</title>
</head>
<body>
@enujo
enujo / BoardController.java
Last active January 6, 2017 06:41
spring mvc insert
package com.tistory.luahius.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.tistory.luahius.service.Board;
import com.tistory.luahius.service.Boardservice;
@enujo
enujo / BoardService.java
Created January 6, 2017 06:54
spring mvc insert
package com.tistory.luahius.service;
public interface BoardService {
int addBoard(Board board);
}
@enujo
enujo / BoardServiceImpl.java
Created January 6, 2017 06:57
spring mvc insert
package com.tistory.luahius.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class BoardServiceImpl implements BoardService{
@Autowired
private BoardDao boardDao;
@enujo
enujo / BoardDao.java
Created January 6, 2017 06:57
spring mvc insert
package com.tistory.luahius.service;
public interface BoardDao {
int insertBoard(Board board);
}
@enujo
enujo / BoardDaoImpl.java
Created January 6, 2017 06:58
spring mvc insert
package com.tistory.luahius.service;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class BoardDaoImpl implements BoardDao{
@Autowired
@enujo
enujo / servlet-context.xml
Created January 6, 2017 07:08
spring mvc insert
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
@enujo
enujo / BoardMapper.xml
Created January 6, 2017 07:11
spring mvc insert
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tistory.luahius.BoardMapper">
<insert id="boardAdd" parameterType="com.tistory.luahius.service.Board">
INSERT INTO board(
board_pw,
board_title,
board_content,
board_user,