SW과정 Spring 13일차 - 0811

JongseokLee·2021년 8월 11일
0
post-thumbnail

SW과정 Spring 13일차 - 0811

Java Resources

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">

	<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
	
	<!-- Enables the Spring MVC @Controller programming model -->
	<annotation-driven />

	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
	<resources mapping="/resources/**" location="/resources/" />

	<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
	<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<beans:property name="prefix" value="/WEB-INF/views/" />
		<beans:property name="suffix" value=".jsp" />
	</beans:bean>
	
	<beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<beans:property name="maxUploadSize" value="100000000"/>
	</beans:bean>
	
	<context:component-scan base-package="com.ksa.fullstack" />
	
	
	
</beans:beans>
<?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.ksa.fullstack.bbs.dao.BBSDao">
	<insert id="write" parameterType="article" >
		insert into bbs values(bbs_seq.nextval,#{id},#{title},#{content},sysdate)
	</insert>
	
	<select id="list" resultType="article">
		select articleNum, id, title
		from bbs
		order by articleNum desc
	</select>
	
	<select id="content" parameterType="int" resultType="article">
		select *
		from bbs
		where articleNum=#{articleNum}
	</select>
	
	<select id="login" parameterType="String" resultType="String">
		select pass
		from login
		where id=#{id}		
	</select>
	
	<delete id="delete" parameterType="String">
		delete
		from bbs
		where articleNum=#{articleNum}
	</delete>
	
	<select id="getUpdateArticle" parameterType="String" resultType="article">
		select articleNum, title, content
		from bbs
		where articleNum=#{articleNum}
	</select>
	
	<update id="updateArticle" parameterType="article">
		update bbs
		set title=#{title}, content=#{content}
		where articleNum=#{articleNum}
	</update>
	
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
	<settings>
		<setting name="cacheEnabled" value="true"/>
		<setting name="lazyLoadingEnabled" value="false"/>
		<setting name="multipleResultSetsEnabled" value="true"/>
		<setting name="useColumnLabel" value="true"/>
		<setting name="useGeneratedKeys" value="false"/>
		<setting name="defaultExecutorType" value="SIMPLE"/>
		<setting name="defaultStatementTimeout" value="25000"/>
<!-- 전통적인 데이터베이스 칼럼명 형태인 A_COLUMN을 CamelCase형태의 -->
<!-- 자바 프로퍼티명 형태인 aColumn으로 자동으로 매핑하도록 함 -->
		<setting name="mapUnderscoreToCamelCase" value="false"/>
		<setting name="jdbcTypeForNull" value="VARCHAR" />
	</settings>
	
	<typeAliases>
		<typeAlias type="com.ksa.fullstack.bbs.dto.BBSDto"  alias="article"/>
	</typeAliases>
</configuration>
profile
DataEngineer Lee.

0개의 댓글