Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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

Share To

Development

© 2024 shulou.com SLNews company. All rights reserved.

12
Report