Java Reference
In-Depth Information
<sqlMapConfig>
<properties resource="db.properties" />
B Global configuration options
<settings
useStatementNamespaces="false"
cacheModelsEnabled="true"
enhancementEnabled="true"
lazyLoadingEnabled="true"
maxRequests="32"
maxSessions="10"
maxTransactions="5"
/>
C Transaction manager
<transactionManager type="JDBC" >
<dataSource type="SIMPLE">
<property name="JDBC.Driver" value="${driver}"/>
<property name="JDBC.ConnectionURL" value="${url}"/>
<property name="JDBC.Username" value="${user}"/>
<property name="JDBC.Password" value="${pword}"/>
</dataSource>
</transactionManager>
SqlMap files D
References to
<sqlMap resource="org/apache/mapper2/ii15/SqlMap.xml" />
</sqlMapConfig>
b
In the next few sections, we will explore the options at in listing 3.1, as well as
describe the transaction manager . In the next three chapters (4, 5, and 6), we
will examine mapped statements that are defined in
C
D
. Then in chapter 7, we will
come back and talk about transactions in detail.
3.6.2
The <properties> element
The <properties> element allows you to provide a list of name/value pairs out-
side of the main configuration file that can be used to further generalize the con-
figuration. This is useful when deploying an application, because you can have the
shared configuration in one place but isolate values that vary depending on the
environment in a properties file.
There are two ways to specify the properties file to be used, each of which is an
attribute of the <properties> element. The choices are
resource —A resource (or file) on the classpath
url —A Uniform Resource Locator ( URL )
Search WWH ::




Custom Search