ibatis使用com.microsoft.jdbc.sqlserver.SQLServerDriver驱动貌似有问题,反正我是没有配置成功,尝试了一下net.sourceforge.jtds.jdbc.Driver,可以正常使用了:
<?xml version=”1.0″ encoding=”UTF-8″ ?> <!DOCTYPE abatorConfiguration PUBLIC “-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN” “http://ibatis.apache.org/dtd/abator-config_1_0.dtd” > <abatorConfiguration> <abatorContext> <!– TODO: Add Database Connection Information –> <jdbcConnection driverClass=”net.sourceforge.jtds.jdbc.Driver” connectionURL=”jdbc:jtds:sqlserver://10.9.26.50:1433;SelectMethod=Cursor;DatabaseName=wdi” userId=”sa” [email protected]> <classPathEntry location=”E:\repository\net\sourceforge\jtds\jtds\1.2.5\jtds-1.2.5.jar” /> </jdbcConnection> <!–bean 存放目录 –> <javaModelGenerator targetPackage=”com.byd.bqs.model” targetProject=”BQS” /> <!–sqlmap 存放目录 –> <sqlMapGenerator targetPackage=”com.byd.bqs.sqlmap” targetProject=”BQS” /> <!–dao 存放目录 –> <daoGenerator type=”IBATIS” targetPackage=”com.byd.bqs.dao” targetProject=”BQS” /> <table tableName=”carInfor”> </table> </abatorContext> </abatorConfiguration>
?applicationContent.xml中bean的配置
<bean id=”dataSource2″destroy-method=”close”><property name=”driverClassName”><value>net.sourceforge.jtds.jdbc.Driver</value></property><property name=”url”><value>jdbc:jtds:sqlserver://10.9.26.50:1433;SelectMethod=Cursor;DatabaseName=wdi</value></property><property name=”username”><value>sa</value></property><property [email protected]><value></value></property></bean>
?zlmind个人博客 http://www.zlmind.com
?