티스토리 뷰

반응형

pom.xml

<!-- https://mvnrepository.com/artifact/com.h2database/h2 --> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.4.192</version> </dependency>

dataSource.xml

<!-- h2 database 선언 --> <jdbc:embedded-database id="dataSource" type="H2"> <jdbc:script location="classpath:egovframework/db/user.sql" /> <jdbc:script location="classpath:egovframework/db/menu.sql" /> <jdbc:script location="classpath:egovframework/db/menu_detail.sql" /> <jdbc:script location="classpath:egovframework/db/user_authority.sql" /> </jdbc:embedded-database>

h2 console 설정
http://www.h2database.com/html/quickstart.html#h2_console <-- h2 console 화면
interceptor 가 적용 중이라면 '/console/**' url pattern을 exclude 시켜줘야된다.

h2 database url : jdbc:h2:mem:dataSource

web.xml

<!-- h2 console --> <servlet> <servlet-name>H2Console</servlet-name> <servlet-class>org.h2.server.web.WebServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>H2Console</servlet-name> <url-pattern>/console/*</url-pattern> </servlet-mapping> <!-- h2 console end -->


반응형

'Web Development > Spring' 카테고리의 다른 글

log4j 설정  (0) 2016.10.27
Spring DataSource Query Logging  (0) 2016.10.27
Spring Transaction  (0) 2016.10.27
@PreConstruct, @PostConstruct  (0) 2016.10.27
Spring interceptor request.setAttribute 전달  (0) 2016.10.27