ssh项目的数据库配置

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
 <!-- 数据库连接的取得 -->
 <bean id="dataSource"
  class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName">
   <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
  </property>
  <property name="url">
   <value>jdbc:sqlserver://172.16.2.202:1433;DatabaseName=db_personManager</value>
  </property>
  <property name="username">
   <value>sa</value>
  </property>
  <property name="password">
   <value>xhsd_wh</value>
  </property>

 </bean>
 <!-- Spring支持Hibernate框架的配置,得到SessionFactory-->
 <bean id="localSessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref bean="dataSource" />
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">
     org.hibernate.dialect.SQLServerDialect
    </prop>
   </props>
  </property>
  <property name="mappingResources">
   <list>
    <value>com/wy/form/ManagerForm.hbm.xml</value>
    <value>com/wy/form/DepartmentForm.hbm.xml</value>
    <value>com/wy/form/InviteJopForm.hbm.xml</value> 
    <value>com/wy/form/EmployeeForm.hbm.xml</value>
    <value>com/wy/form/PayForm.hbm.xml</value>
    <value>com/wy/form/TrainForm.hbm.xml</value>
    <value>com/wy/form/CjForm.hbm.xml</value>
   </list>
  </property>
 </bean>
 
 <bean id="objectDao" class="com.wy.dao.ObjectDao">
  <property name="sessionFactory">
   <ref bean="localSessionFactory" />
  </property>
 </bean>

 <bean name="/manager" class="com.wy.action.ManagerAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
 <bean name="/department" class="com.wy.action.DepartmentAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
 <bean name="/inviteJob" class="com.wy.action.InviteJobAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
 <bean name="/employee" class="com.wy.action.EmployeeAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
 <bean name="/pay" class="com.wy.action.PayAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
     <bean name="/train" class="com.wy.action.TrainAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
  <bean name="/cj" class="com.wy.action.CjAction"
  singleton="false">
  <property name="objectDao">
   <ref bean="objectDao" />
  </property>
 </bean>
 
</beans>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值