标签:ram ons 管理 数据连接 连接池 -- 2.0 ica upd
ssh工程下的子文件:
其中,application类中的代码如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!--数据库-配置数据连接池 -->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306ssh">
</property>
<property name="username" value="root"></property>
<property name="password" value="123456"></property>
<property name="maxActive" value="100"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean>
<!--sessionFactory配置与管理 -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/crm/bean/Cust.hbm.xml<alue>
<st>
</property>
</bean>
<!--配置DAO -->
<bean id="custDao" class="com.crm.impl.CustDaoImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 配置service -->
<bean id="custService" class="com.crm.service.impl.CustServiceImpl">
<property name="custDao" ref="custDao"></property>
</bean>
<!-- 配置SaveAction -->
<bean id="custSaveAction" class="com.crm.action.CustSaveAction">
<property name="service">
<ref bean="custService"/>
</property>
</bean>
<!--配置-查询listAction -->
<bean id="listCustAction" class="com.crm.action.CustListAction">
<property name="service" ref="custService"></property>
</bean>
<!--配置-删除deleteAction -->
<bean id="custRemoveAction" class="com.crm.action.CustRemoveAction">
<property name="service" ref="custService"></property>
</bean>
<!--配置-条件查询findCdtAction -->
<bean id="findCustByCdtAction" class="com.crm.action.FindCustByCdtAction">
<property name="findCdtService" ref="custService"></property>
</bean>
<!--配置-修改updateCustAction -->
<bean id="updateCustAction" class="com.crm.action.UpdateCustAction">
<property name="updateCustService" ref="custService"></property>
</bean>
<!--配置-修改预览updatePreviewCustAction -->
<bean id="updatePreviewCustAction" class="com.crm.action.UpdatePreviewCustAction">
<property name="updatePreviewCustService" ref="custService"></property>
</bean>
</beans>
用于配置各种action类,实现操作
struts类代码如下:
标签:ram ons 管理 数据连接 连接池 -- 2.0 ica upd
原文地址:http://www.cnblogs.com/hawkzheng/p/7106475.html