Java Reference
In-Depth Information
of the transaction management functionality that was available when using
SQL
Maps directly is still available in our
DAO
implementation. Listing 10.9 contains
the
SQLMapConfig.xml
we used for this example.
Listing 10.9
Sample SQLMapConfig.xml file
<?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="SqlMapConfig.properties" />
<settings
errorTracingEnabled="true"
cacheModelsEnabled="true"
enhancementEnabled="true"
lazyLoadingEnabled="true"
maxRequests="32"
maxSessions="10"
maxTransactions="5"
useStatementNamespaces="true"
/>
<transactionManager type="JDBC" >
<dataSource type="SIMPLE">
<property name="JDBC.Driver" value="${driver}"/>
<property name="JDBC.ConnectionURL"
value="${connectionUrl}"/>
<property name="JDBC.Username" value="${username}"/>
<property name="JDBC.Password" value="${password}"/>
</dataSource>
</transactionManager>
<sqlMap
resource=
"com/mycompany/system/dao/sqlmap/Account.xml" />
</sqlMapConfig>
All of the settings for this file are covered in detail in chapter 4, so we won't
rehash them here.
10.4.4
Loading the maps
In addition to defining transaction management, all of the maps defined in our
SQL
Map configuration file are loaded as well. For this example, that is simply a
sample
Account.xml
file that defines all of the mapped statements for our
DAO
class, as shown in listing 10.10.








