Get the App
SLTechnology News&Howtos  ›  Development  › 

How to talk about the two commonly used DAO in IBATIS.net

Shulou Source: shulou.com Published: 2022-06-02 22:33:34 10月03日 Update

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" / >

Tags: Way configuration file common use statement that is content general data database more help different good code interest boy partner bottom layer article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia macOS Shulou Information Linux