/** * * @(#) SqlMapFactory.java * created date : 2008. 01. 23 * * (c) Copyright by Hyundai HDS Inc., * All rights reserved. http://www.hyundaihds.co.kr */ package ibatis.dao; import java.io.Reader; import com.ibatis.common.resources.Resources; import com.ibatis.sqlmap.client.SqlMapClient; import com.ibatis.sqlmap.client.SqlMapClientBuilder; /** * * @author Youbok, Choi * @version 1.0 * */ public class SqlMapFactory { private static SqlMapClient sqlMap; static { try { String resource = "ibatis/dao/sqlmapdao/sql/sql-map-config.xml"; Reader reader = Resources.getResourceAsReader(resource); sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); } catch(Exception e) { e.printStackTrace(); throw new RuntimeException("Error while initializing SqlMapClient : " + e); } } public static SqlMapClient getInstance() { return sqlMap; } }