<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>
解决方案 »
- 关于Spring初始化Bean找不到相关类的问题
- 请问rmi怎样实现,具体流程是什么?
- 在struts2 的if 标签中使用静态方法遇到的问题。
- Action jsp页面传中文??
- Spring+Hibernate+Structs错误,Servlet action is currently unavailable
- 各位达人:struts1.2 DynaValidatorForm的bug!大家都过来看看!
- XMLBean能够向XML数据文档中插入记录吗?
- java 获取系统odbc数据源
- 我写了个EJB,测试时提示我的BEAN没注册到JNDI中.我要怎么办?
- 求救!!我的Weblogic8.1装上并配置号了,启动examples domain的服务后,http://localhost:7001/访问不了!!信息如下
- 深圳软通动力怎么样?
- 如何用Java类和网址通讯,并向网址传递负责数据类型(MAP、List等)。
<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>
这样行吗