文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>获得SqlMapClient 通用类

获得SqlMapClient 通用类

时间:2010-07-14  来源:mozhx

import java.io.IOException;
import java.io.Reader;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
public class IbatisUtil {
 public static SqlMapClient getSqlMapClient(){
//  String resource ="com/ibatis/sample/SqlMapConfig.xml";
//  Reader reader;
//  reader = Resources.getResourceAsReader(resource);
//  XmlSqlMapClientBuilder xmlBuilder =
//  new XmlSqlMapClientBuilder();
//  SqlMapClient sqlMap = xmlBuilder.buildSqlMap(reader);
  
  Reader reader = null ;   
        try {   
            reader = Resources.getResourceAsReader("SqlMapConfig.xml");   
            SqlMapClient sqlmap = SqlMapClientBuilder.buildSqlMapClient(reader);   
            return sqlmap;
         
        } catch (IOException e) {   
            // TODO Auto-generated catch block   
            e.printStackTrace();   
        } 
        return null;
 }
}
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载