`

Ibatis configuration 2

    博客分类:
  • SQL
阅读更多
now getting SqlMapClient:
SqlAppConfig.java
 /**
 * 
 */
package com.dingfei.config;

import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

/**
 * @author Jeffy
 * 
 */
public class SqlAppConfig {
	private static final SqlMapClient sqlMap;
	static {
		try {
			String resource = "conf/SqlMapConfig.xml";
			Reader reader = Resources.getResourceAsReader(resource);
			sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
			reader.close();
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(
					"Error initializing MyAppSqlConfig class. Cause: " + e);
		}
	}

	public static SqlMapClient getSqlMapInstance() {
		return sqlMap;
	}
}
分享到:
评论

相关推荐

    为 Ibatis 2.3.4 构建增强的 Apache Ibator 实体类生成工具

    This abates some of the initial nuisance of setting up objects and configuration files to interact with database tables. Ibator seeks to make a major impact on the large percentage of database ...

    IBatis.NET 1.9.2 1.6.2 应用于.NET4.0,解决Ambiguous match found

    将IBatis.NET 1.92 1.6.2版本的库在.NET 4.0下应用。...2 采用VS2010旗舰版的IDE环境生成解决方案 本次修改时参考了“笨无知”的一篇博文,再次表示感谢。 阳光萨满(wocy) 2011.08.19 susuaman@gmail.com

    autocoder下载

    详细说明:自动根据数据库脚本生成java的POJO,DAO,DAOIMPL,IBATIS配置文件,spring配置文件-Database scripts automatically generate java POJO, DAO, DAOIMPL, IBATIS configuration file, spring configuration ...

    前端-后端java的Util类的工具类

    │ │ │ frame-sourcefiles-org.apache.ibatis.logging.log4j2.html │ │ │ frame-sourcefiles-org.apache.ibatis.logging.nologging.html │ │ │ frame-sourcefiles-org.apache.ibatis.logging.slf4j.html │ ...

    MyBatis-Generate

    This lessens the initial nuisance of setting up objects and configuration files to interact with database tables. MBG seeks to make a major impact on the large percentage of database operations that ...

    sun公司提供的jsp网站demo

    Jar package source code, there is not much configuration is simple the spring + Ibatis + struts project

    Qt 全流程实战企业级项目 - 云对象存储浏览器(24章)

    步骤2: 添加WebEngine模块在QtCreaor的项目资源管理器中,找到项日文件夹中的,oro文件。右键单未该文件并选择“编辑”。在打开的,0文件中,找到"“OT+=widaets”这并在其下方添加加以下代码: mybatis-plus: ...

    springmybatis

    2. Configuration.xml 里面 的是包含要映射的类的xml配置文件。 3. 在User.xml 文件里面 主要是定义各种SQL 语句,以及这些语句的参数,以及要返回的类型等. 开始测试 在test_src 源码目录下建立com.yihaomen.test...

    asm5.0.jar

    nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not ...

    mybatis-generator-1.3.3

    This lessens the initial nuisance of setting up objects and configuration files to interact with database tables. MBG seeks to make a major impact on the large percentage of database operations that ...

    spring chm文档

    12.5.1. iBATIS 1.x和2.x的概览与区别 12.5.2. iBATIS SQL Maps 1.x 12.5.3. iBATIS SQL Maps 2.x 12.6. JPA 12.6.1. 在Spring环境中建立JPA 12.6.2. JpaTemplate 和 JpaDaoSupport 12.6.3. 基于原生的JPA实现...

    Spring-Reference_zh_CN(Spring中文参考手册)

    12.5.1. iBATIS 1.x和2.x的概览与区别 12.5.2. iBATIS SQL Maps 1.x 12.5.2.1. 创建SqlMap 12.5.2.2. 使用 SqlMapTemplate 和 SqlMapDaoSupport 12.5.3. iBATIS SQL Maps 2.x 12.5.3.1. 创建SqlMapClient 12.5.3.2....

    Spring 2.0 开发参考手册

    12.5.1. iBATIS 1.x和2.x的概览与区别 12.5.2. iBATIS SQL Maps 1.x 12.5.3. iBATIS SQL Maps 2.x 12.6. JPA 12.6.1. 在Spring环境中建立JPA 12.6.2. JpaTemplate 和 JpaDaoSupport 12.6.3. 基于原生的JPA实现...

    MyBatis Generator

    2、创建generatorConfig.xml文件,安装好mybatis 就能创建generatorConfig.xml 3、配置generatorConfig.xml配置文件,详细如下 [html] view plain copy <?xml version="1.0" encoding="UTF-8" ?> <!...

    mybatis-config.xml文件配置问题

    Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 99; columnNumber: 17; 元素类型为 “configuration” 的内容...

    Spring API

    13.11. 惯例优先原则(convention over configuration) 13.11.1. 对控制器的支持:ControllerClassNameHandlerMapping 13.11.2. 对模型的支持:ModelMap(ModelAndView) 13.11.3. 对视图的支持:...

    Spring中文帮助文档

    13.11. 惯例优先原则(convention over configuration) 13.11.1. 对控制器的支持:ControllerClassNameHandlerMapping 13.11.2. 对模型的支持:ModelMap(ModelAndView) 13.11.3. 对视图的支持:...

Global site tag (gtag.js) - Google Analytics