---
title: "Ibatis configuration"
author: "zerostar88"
date: "2009-06-21T21:41:51Z"
tags: []
slug: "ibatis-configuration"
draft: false
lastmod: "2009-06-21T21:41:51Z"
id: 412551
url: "https://jeffyding.iteye.com/blog/412551"
---

1. db.properties

```xml

 driver=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/test
 username=root
 password=root

```


2. SqlMapConfig.xml

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

```