`

Ibatis configuration

    博客分类:
  • SQL
阅读更多
1. db.properties
 driver=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/test
 username=root
 password=root


2. SqlMapConfig.xml
 <?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"      
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>
	<properties
		resource="conf/db.properties" />
	<settings cacheModelsEnabled="true" enhancementEnabled="true"
		lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"
		maxTransactions="5" useStatementNamespaces="false" />

	<transactionManager type="JDBC">
		<dataSource type="SIMPLE">
			<property name="JDBC.Driver" value="${driver}" />
			<property name="JDBC.ConnectionURL" value="${url}" />
			<property name="JDBC.Username" value="${username}" />
			<property name="JDBC.Password" value="${password}" />
		</dataSource>
	</transactionManager>

	<sqlMap resource="conf/sqlmaps/employee.xml" />
	<sqlMap resource="conf/sqlmaps/site.xml" />
	
</sqlMapConfig>

分享到:
评论

相关推荐

    autocoder下载

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

    为 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下应用。结果发现总是报错Ambiguous match found 经过参考资料,重新整理了ibatis的资料,原因如下: iBatis中使用了Castle.DynamicProxy 1.5 而Castle.DynamicProxy ...

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

    │ │ configuration.html │ │ cpd.html │ │ cpd.xml │ │ dependencies.html │ │ dependency-info.html │ │ distribution-management.html │ │ dynamic-sql.html │ │ findbugs.html │ │ getting-...

    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

    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 ...

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

    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: id-type: assign_id update-strategy: not_empty mapper-locations: classpath*:/mapper/*.xml ./configure \ --pr

    springmybatis

    1.Configuration.xml 是 mybatis 用来建立 sessionFactory 用的,里面主要包含了数据库连接相关东西,还有 java 类所对应的别名,比如 &lt;typeAlias alias="User" type="com.yihaomen.mybatis.model.User"/&gt; 这个别名...

    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-Reference_zh_CN(Spring中文参考手册)

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

    spring chm文档

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

    MyBatis Generator

    mybatis也能方向生成代码,能方向生成实体类(po)、mapper接口和Mapper接口映射文件,能减少...4、右击generatorConfig.xml 点击Generate MyBatis/iBATIS Artifacts 生成对应接口、接口映射文件、实体类 5、查看结果

    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 2.0 开发参考手册

    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. 对视图的支持:...

    Spring API

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

Global site tag (gtag.js) - Google Analytics