Advertisement
Guest User

Untitled

a guest
Apr 13th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
  4. xmlns:tx="http://www.springframework.org/schema/tx"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
  7. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
  8.  
  9. <bean id="dataSource" class=" org.apache.commons.dbcp.BasicDataSource "
  10. destroy-method="close">
  11. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  12. <property name="url" value="jdbc:mysql://localhost:3306/TestDB" />
  13. <property name="username" value="pankaj" />
  14. <property name="password" value="pankaj123" />
  15. </bean>
  16.  
  17. <!-- Hibernate 3 XML SessionFactory Bean definition-->
  18. <!-- <bean id="hibernate3SessionFactory"
  19. class=" org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
  20. <property name="dataSource" ref="dataSource" />
  21. <property name="mappingResources">
  22. <list>
  23. <value>person.hbm.xml</value>
  24. </list>
  25. </property>
  26. <property name="hibernateProperties">
  27. <value>
  28. hibernate.dialect=org.hibernate.dialect.MySQLDialect
  29. </value>
  30. </property>
  31. </bean> -->
  32.  
  33. <!-- Hibernate 3 Annotation SessionFactory Bean definition-->
  34. <bean id="hibernate3AnnotatedSessionFactory"
  35. class=" org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean ">
  36. <property name="dataSource" ref="dataSource" />
  37. <property name="annotatedClasses">
  38. <list>
  39. <value>com.journaldev.model.Person</value>
  40. </list>
  41. </property>
  42. <property name="hibernateProperties">
  43. <props>
  44. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  45. <prop key="hibernate.current_session_context_class">thread</prop>
  46. <prop key="hibernate.show_sql">false</prop>
  47. </props>
  48. </property>
  49. </bean>
  50.  
  51. <bean id="personDAO" class=" com.journaldev.dao.PersonDAOImpl ">
  52. <property name="sessionFactory" ref="hibernate3AnnotatedSessionFactory" />
  53. </bean>
  54. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement