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