<div class="note"> Appfues의 디폴트 데이터베이스는 PostgreSQL이다. MySQL을 사용하기 위해서는 몇가지 사항을 변경해주어야 한다. 그 사항을 다루기 위한 글이다.
여기서 사용된 Appfuse-light는 appfuse-light-spring-ibatis-1.8-beta 이다. </div>
build.xml파일 수정#
다음처럼 테이블 생성 sql문을 create-mysql.sql으로 변경한다.
<target name="createdb" description="Create database tables">
|
테이블 생성 SQL문 수정#
src\main\java\org\appfuse\dao\ibatis 밑의 create-postgresql.sql 파일을 create-mysql.sql 이라고 복사해서 이름을 변경한다. 내용을 다음처럼 변경한다.
drop table IF EXISTS app_user;
|
Incrementer 구현체 변경#
applicationContext-ibatis.xml 파일에서 다음처럼 Incrementer 구현체를 PostgreSQLSequenceMaxValueIncrementer 에서 MySQLMaxValueIncrementer로 변경한다.
<!--
|
여기서 주의할것은 incrementerName의 값은 sequence용 테이블의 이름이어야 한다는 것이다. 앞서 create table app_user_sequence (id int not null) type=MYISAM; 라는 sql문을 사용해서 sequence용 테이블을 생성했으니 테이블명이 다르다면 해당 테이블명으로 채워야 한다.
pom.xml 파일 수정#
MySQL 용 JDBC드라이버를 다운로드하도록 다음과 같은 항목을 적절한 곳에 추가한다. postgresql 항목 뒤에 추가하는게 좋을듯 하다. 그리고 버전값은 http://dev.mysql.com/downloads/connector/j/5.0.html
<dependency>
|
Add new attachment
Only authorized users are allowed to upload new attachments.
G’day (anonymous guest)
My Prefs