템플릿 받은다음 이클립스에서 파일 찾기 전체바꾸기로..
1번 2번 수행 ^^
1. www.ibatis.com --> ibatis.apache.org (dtd 수정)
2. sql map 및 ddl 변경 ( 테이블명 구분좀 쉽게 ^^ )
LETTCCMMNCLCODE LET_TC_CMMN_CLCODE
LETTCCMMNCODE LET_TC_CMMN_CODE
LETTCCMMNDETAILCODE LET_TC_CMMN_DETAIL_CODE
LETTNORGNZTINFO LET_TN_ORGNZ_TINFO
LETTNAUTHORGROUPINFO LET_TN_AUTHOR_GROUP_INFO
LETTNEMPLYRINFO LET_TN_EMPLYR_INFO
LETTNTMPLATINFO LET_TN_TMPLAT_INFO
LETTNBBSMASTEROPTN LET_TN_BBS_MASTER_OPTN
LETTNBBSMASTER LET_TN_BBS_MASTER
LETTNBBSUSE LET_TN_BBS_USE
LETTNBBS LET_TN_BBS
LETTNENTRPRSMBER LET_TN_ENTRPRS_MBER
LETTNFILEDETAIL LET_TN_FILED_ETAIL
LETTNFILE LET_TN_FILE
LETTNGNRLMBER LET_TN_GNRL_MBER
LETTNSCHDULINFO LET_TN_SCHDUL_INFO
COMVNUSERMASTER COMVN_USER_MASTER
* pom.xml에 아래 두개 추가 ( mariadb 사용하기위해서)
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.5.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
<version>1.16</version>
</dependency>
3. DB 설정
ㄱ. mysql -u root -p // 서버 로그인
ㄴ. CREATE DATABASE egov DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; // 데이터베이스 생성
ㄷ. CREATE USER 'egov'@'%' IDENTIFIED BY 'egov'; // 사용자생성
ㄹ. GRANT ALL PRIVILEGES ON egov.* TO 'egov'@'%'; // 권한부여
ㅁ. 프로젝트/src/main/resources/egovframework/egovProps/globals.properties
파일 열어서 DB접속 정보 수정
Globals.DbType = mariadb
Globals.UserName=egov
Globals.Password=egov
# mariadb
Globals.DriverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
Globals.Url=jdbc:log4jdbc:mariadb://127.0.0.1:3306/egov
#Hsql - local hssql 사용시에 적용 주석처리
#Globals.DriverClassName=net.sf.log4jdbc.DriverSpy
#Globals.Url=jdbc:log4jdbc:hsqldb:hsql://127.0.0.1/sampledb
ㅂ. /egovSimple/src/main/resources/egovframework/spring/com/context-datasource.xml 열고
dataSource 추가
<!-- mariadb -->
<bean id="dataSource-mariadb" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${Globals.DriverClassName}"/>
<property name="url" value="${Globals.Url}" />
<property name="username" value="${Globals.UserName}"/>
<property name="password" value="${Globals.Password}"/>
</bean>
<!-- hsql -->
<!-- <jdbc:embedded-database id="dataSource-hsql" type="HSQL">
<jdbc:script location= "classpath:/db/shtdb.sql"/>
</jdbc:embedded-database> --> 주석처리
ㅅ. /egovSimple/src/main/resources/log4jdbc.log4j2.properties 열고 (없으면 생성)
log4jdbc.drivers=org.mariadb.jdbc.Driver
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
log4jdbc.dump.sql.maxlinelength=0
추가
o. /egovSimple/src/main/resources/log4j2.xml 열고
<logger name="log4jdbc.log4j2" level="error" additivity="false">
<appender-ref ref="Console" />
</logger>
<Logger name="jdbc.sqlonly" level="off" />
<Logger name="jdbc.sqltiming" level="info" />
<Logger name="jdbc.audit" level="off" />
<Logger name="jdbc.resultset" level="off" />
<Logger name="jdbc.resultsettable" level="info" />
<Logger name="jdbc.connection" level="off" />
추가
ㅈ. sqlmap 생성
/egovSimple/src/main/resources/egovframework/sqlmap/config/mariadb 폴더만들고
mysql 폴더 파일 모두 복사해서 파일명 sql-map-config-mariadb-cop-smt.xml 식으로 mysql->mariadb로 변경
4. ㄱ. 테이블 생성
프로젝트/DATABASE/all_sht_ddl_mysql.sql
ㄴ. 샘플데이터 등록
프로젝트/DATABASE/all_sht_data_mysql.sql
5. config수정 ( 요청 로그 남기기 )
* 홈페이지 템플릿(Simple Homepage)
로그인계정(관리자) : admin 로그인암호 : 1