Advertisement
Zwierzak24

Untitled

May 9th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.18 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"
  4.     xmlns:context="http://www.springframework.org/schema/context"
  5.     xmlns:mvc="http://www.springframework.org/schema/mvc"
  6.     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7.         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
  8.         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
  9.  
  10.  
  11.     <mvc:annotation-driven enable-matrix-variables="true"/>
  12.    
  13.     <context:component-scan base-package="com.packt.musicstore" />
  14.    
  15.     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  16.         <property name="prefix" value="/WEB-INF/views/" />
  17.         <property name="suffix" value=".jsp" />
  18.     </bean>
  19.    
  20.      <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  21.         <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  22.         <property name="url" value="jdbc:mysql://localhost:3306/root" />
  23.         <property name="username" value="root"/>
  24.         <property name="password" value="Legia" />
  25.     </bean>
  26.  
  27.     <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" >
  28.         <property name="dataSource" ref="dataSource"></property>
  29.         <property name="hibernateProperties" >
  30.             <props>
  31.                 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  32.                 <prop key="hibernate.hbm2ddl.auto">update</prop>
  33.                 <prop key="hibernate.show_sql">true</prop>
  34.                 <prop key="hibernate.format_sql">true</prop>
  35.             </props>
  36.         </property>
  37.         <property name="packagesToScan">
  38.             <list>
  39.                 <value>com.musicstore</value>
  40.             </list>
  41.         </property>
  42.     </bean>
  43.  
  44.     <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  45.         <property name="sessionFactory" ref="sessionFactory" />
  46.     </bean>
  47.    
  48.  
  49. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement