Advertisement
Guest User

Untitled

a guest
Jun 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. application-context.xml:
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xsi:schemaLocation="
  7. http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-4.0.xsd">
  11.  
  12. <!-- Base package for checking the annotated classes -->
  13. <context:component-scan base-package="net.sk"></context:component-
  14. scan>
  15.  
  16. <!-- Configure JDBC Connection-->
  17. <bean id="dataSource"
  18. class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  19. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  20. <property name="url"
  21. value="jdbc:mysql://localhost:3306/springmvctutorial" />
  22. <property name="username" value="root" />
  23. <property name="password" value="sh@123" />
  24. </bean>
  25.  
  26. <!-- Configure Hibernate 4 Session Facotry -->
  27. <bean id="sessionFactory"
  28. class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  29.  
  30. <property name="dataSource">
  31. <ref bean="dataSource" />
  32. </property>
  33.  
  34. <property name="hibernateProperties">
  35. <props>
  36. <prop
  37. key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  38. <prop key="hibernate.show_sql">true</prop>
  39. </props>
  40. </property>
  41. </bean>
  42. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement