Ibatis. Net Study Notes (2)

Source: Internet
Author: User
Tags ibm db2
Use ibatis. Net in vs. net2003 to add sqlmap. XSD, Sqlmapconfig. XSD , Providers. XSD files to c: \ Program Files \ Microsoft Visual Studio. NET 2003 \ common7 \ packages \ schemas \ XML
In this way, when you edit the ibatis. Net configuration file, a reminder appears, making it easier to use. As follows:

Sqlmap. config configuration file example (this file is placed in the same directory as Web. config) <? XML version = "1.0" encoding = "UTF-8" ?>  
< Sqlmapconfig Xmlns = "Http://ibatis.apache.org/dataMapper"  
Xmlns: xsi = "Http://www.w3.org/2001/XMLSchema-instance"   >

<! -- Optional -->
< Properties Resource = "Properties. config" />

< Settings >
< Setting Usestatementnamespaces = "False" />
< Setting Cachemodelsenabled = "True" />
< Setting Validatesqlmap = "False" />
</ Settings >

<! -- Not required if providers. config is located in default location -->
< Providers Embedded = "Resources. providers. config, ibatisnet. test" />

< Database >
< Provider Name = "Sqlserver1.1" />
< Datasource Name = "Npetshop"  
Connectionstring = "User ID =$ {username };
Password =$ {password };
Data Source =$ {datasource };
Database =$ {database };" />
</ Database >

< Alias >
< Typealias Alias = "Account" Type = "Ibatisnet. Test. domain. Account, ibatisnet. test" />
< Typealias Alias = "Yesnobool"
Type = "Ibatisnet. Test. domain. yesnobooltypehandlercallback, ibatisnet. test" />
</ Alias >

< Typehandlers >
< Typehandler Type = "Bool" Dbtype = "Varchar" Callback = "Yesnobool" />
</ Typehandlers >

< Sqlmaps >
< Sqlmap Resource = "$ {Root} maps/account. xml" />
< Sqlmap Resource = "$ {Root} maps/category. xml" />
< Sqlmap Resource = "$ {Root} maps/product. xml" />
</ Sqlmaps >  
</ Sqlmapconfig >

Ibatis. NET provides multiple database access providers, as shown below:

    • Sqlserver1.0-Microsoft SQL Server 7.0/2000 provider available with. NET Framework 1.0
    • Sqlserver1.1-Microsoft SQL Server 7.0/2000 provider available with. NET Framework 1.1
    • Oledb1.1-oledb provider available with. NET Framework 1.1
    • Odbc1.1-ODBC provider available with. NET Framework 1.1
    • Oracle9.2-Oracle provider v9.2.0.401
    • Oracle10.1-Oracle provider v10.1.0.301
    • Oracleclient1.0-MS Oracle provider v1.0.5 available with. NET Framework 1.1
    • Bytefx-bytefx MySQL provider v0.7.6.15073
    • Mysql-MySQL provider v1.0.4.20163
    • Sqlite3-SQLite. net provider v0.21.1869.20.4
    • Firebird1.7-Firebird SQL. net provider v1.7.0.33200
    • Postgresql0.7-npgsql provider v0.7.0.0
    • Idb2.10-IBM DB2 iseries provider v10.0.0.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.