How to talk about the two commonly used DAO in IBATIS.net
This article introduces you how to talk about the two commonly used DAO in IBATIS.net, the content is very detailed, interested friends can refer to, hope to be helpful to you.
In iBATIS. We can choose the DAO type flexibly, that is, we can choose different database operation modes at the bottom. There are general methods, configuration files, Hibernet methods, and so on:
1. Conventional methods
Similar to our previous ADO.net development, sql statements are written in cs code to make calls:
First, initialize through the configuration file:
DomDaoManagerBuilder builder = new DomDaoManagerBuilder (); builder.Configure ("dao" + "_" + ConfigurationManager.AppSettings ["database"] + "_" + ConfigurationManager.AppSettings ["providerType"] + ".config"); daoManager = DaoManager.GetInstance ("SimpleDao")
The corresponding configuration files are as follows:
< context id= "SimpleDao" default= "true" > < properties resource= ".. / database.config" / >