First, SQL MAP XML configuration file SQL MAP uses different setup properties, including DataSource's detailed configuration information, SQL MAP, and other optional properties, such as thread management, etc.
The following is an example of a SQL Map configuration file: sqlmapconfig.xml Xml version = "1.0" encoding = "UTF-8"?>
property name = "JDBC.Password" value = "$ {password}" />
SQL MAP configuration files and each mapping file can be used to represent values org.hsqldb.jdbcdriver.
For example:
This element is useful in development, testing and deployment. It makes it easy to reconfigure applications in multiple different environments and use automatic build tools such as Ant.
The Java property file can be imported through class paths, or by valid URL import.
For example:
1. MaxExecute also executes a maximum number of SQL Statement, which is greater than the thread of this value will block until another thread exits. Different DBMs have different limits. Example: maxexecute = "256" Default: 512
Under normal circumstances, this value is greater than 10, and the value is larger than the value set by the maxsessions and the maxTransactions. Typically, reduced maximum number of access can improve the efficiency of execution.
2. MAXSESSIONS refers to the number of session (or clients) in active status within a given time. This value is generally greater than or equal to the parameter value of the maxTransactions, and is less than the parameter value of maxRequests: maxsessions = "64" default: 128
3. MaxTransaction simultaneously enters the maximum number of threads of SQLMAPClient.StartTransaction (). Threads greater than this value will block until another thread exits. Different DBMs have different limits. This value should always be less than or equal to MAXSESSIONS, and more than maxRequests. Normally, reduce this value can improve the efficiency of the execution. Example: MaxTransaction = "16" Default: 32
4. Cachemodelsenabled is enabled or disables all Cache Models for SQLMapClient. Useful when debugging the program. Example: cachemodelsenabled = "true" Default: TRUE
5. LazyLoadInableD is enabled or disables all Lazy Loading for SQLMapClient. Useful when debugging the program. Example: lazyloadinagenabled = "true" Default: TRUE
6. enhancementEnabledThis setting enables runtime bytecode enhancement to facilitate optimized JavaBean property access as well as enhanced lazy loading example enhancementEnabled = "true" Default:. False (disabled)
7. UsestatementNamespaces This option This option is enabled, you must use full-qualified names to reference mapped statements, this full name consists of Sqlmap's name and Statement's name. For example: QueryForObject ("SQLMapName.StatementName");
Example: USSTATEMENTNAMESPACES = "false" Default: false (Disabled)
(3)
(4)
In the framework already includes three transaction management: JDBC, JTA, and External 1. JDBC allows you to control your transactions with a CONNECTION's commit () and rollback () methods.
2. JTA This transaction management uses a JTA's global transaction to include SQL MAP's Activities as part of a WiDER Scope transaction, which may contain other databases or transactions. This configuration requires a UserTransaction property to set local User Transaction through JNDI Resource.
3. External allows you to manage your own business. You can still configure a data source, but transactions will not be submitted or rolled in the framework life cycle. This means that you have to use your own program to control your transaction. This setting is very useful for non-transactional databases.
(5)
1. SimpleDataSourceFactorySimpleDataSourceFactory provides a basic implementation for Pihua DataSource for use in the case where there is no container to provide data sources.
2. DBCPDataSourceFactoryDbcpdataSourceFactory implements the connection pool service using the DataSourceAPI of Jakarta DBCP (Database Connection Pool). Suitable for WEB containers do not provide DataSource services, or perform a separate application. The parameters of the parameters that must be configured in DBCPDataSourceFactory are as follows:
JNDIDASOSOURCEFAACTORY The properties must be configured as follows:
(6)