<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <context:annotation-config /><!-- required -->
    <context:component-scan base-package="org.jsf" /> <!-- required -->

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
  <value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="username">
         <value>username</value>
</property>
<property name="password">
<value>password</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@localhost:1521:manager</value>
</property>
</bean>

<bean class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" id="sqlMapClient">
     <property name="configLocation">
<value>classpath:ibatis_conf.xml</value>
</property>
<property name="dataSource" ref="dataSource"></property>
    </bean>           <bean id="empDao" class="org.jsf.dao.EmpDaoImpl">
<property name="sqlMapClient" ref="sqlMapClient"></property>
</bean></beans>

解决方案 »

  1.   


    <bean class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" id="sqlMapClient">
            <property name="configLocation">
                <value>classpath:ibatis_conf.xml</value>
            </property>
            <property name="dataSource" ref="dataSource"></property>
        </bean>
        <bean id="sqlMapClientTemplate"  class="org.springframework.orm.ibatis.SqlMapClientTemplate">
         <property name="sqlMapClient" ref="sqlMapClient"/>
        </bean>
               <bean id="empDao" class="org.jsf.dao.EmpDaoImpl">
            <property name="sqlMapClientTemplate" ref="sqlMapClientTemplate"></property>
    这样行吗
      

  2.   

    OMG 你也贴个异常信息呗~~
      

  3.   

    你datasource 的class属性值是不是不对呀!我每次都改了