锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
浣滆呯殑璇濓細灝界鍙湁5涓慨鏀癸紝浣嗘垜榪樻槸瑙夊緱鍊煎緱涓烘鍙戝竷涓涓柊鐗堟湰銆?br />
榪?涓慨鏀規槸錛?br />
1銆佸湪org.apache.ibatis.Session涓鍔犱簡涓涓柊鏂規硶錛歷oid select(String statement, ResultHandler handler);
鍘熸潵鍙湁錛?br />
void select(String statement, Object parameter, ResultHandler handler);
void select(String statement, Object parameter, RowBounds rowBounds, ResultHandler handler);
2銆佷慨澶嶄簡ManagedConnection涓叧闂繛鎺ョ殑闂
3銆佷慨澶嶄簡schema migration涓紝璇彞鎻愪氦(statement commit)涓嶆紜殑闂
4銆佷慨澶嶄簡寤惰繜鍔犺澆宸茬粡棰勮鍙栧睘鎬ф椂鐨勯棶棰?br />
5銆佷慨澶嶄簡schema migration涓紝FileInputStream娌℃湁姝g‘鍏抽棴鐨勯棶棰?br />
<ibatorConfiguration>
<classPathEntry location="c:\javaLibs\MySql\mysql-connector-java-5.0.6-bin.jar" />
<ibatorContext id="SampleiBator" targetRuntime="Ibatis2Java5">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost/sample" userId="root" password="admin">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="com.sample"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.sample.xml"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<daoGenerator type="GENERIC-CI" targetPackage="com.sample.dao"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
</daoGenerator>
<table schema="sample" tableName="tab1" domainObjectName="JavaBean1">
<property name="useActualColumnNames" value="false" />
<generatedKey column="ID" sqlStatement="MySql" identity="true" />
</table>
</ibatorContext>
</ibatorConfiguration>
5銆侀厤緗枃浠剁敓鎴愬畬姣曞悗錛屽彸閿偣鍑昏繖涓枃浠訛紝閫夋嫨“Generate iBatis Artifact”錛岀劧鍚庝綘灝卞湪閰嶇疆鐨勬枃浠跺す涓嬫壘鍒拌嚜鍔ㄧ敓鎴愮殑鏂囦歡浜嗐?/p>
public interface DataSourceFactory {
public void initialize(Map map);
public DataSource getDataSource();
}