Advertisement
lord-ivan

dataSource-config.xml

Feb 5th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.82 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="
  6. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  7. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
  8.  
  9. <!-- This file is like access to the database u put your connetionStrings
  10.         here (database configuration) -->
  11. <bean id="dataSource"
  12.         class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  13.         <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  14.         <property name="url" value="jdbc:mysql://localhost:3306/JavaDB" />
  15.         <property name="username" value="lord-ivan" />
  16.         <property name="password" value="Ir0ngo@t" />
  17.     </bean>
  18.  
  19.     <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  20.         <property name="jpaVendorAdapter">
  21.             <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  22.  
  23.                 <property name="showSql" value="true" />
  24.                 <property name="generateDdl" value="true" />
  25.                 <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
  26.             </bean>
  27.         </property>
  28.  
  29.         <property name="dataSource" ref="dataSource" />
  30.     </bean>
  31.  
  32.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  33.  
  34.         <property name="dataSource" ref="dataSource" />
  35.         <property name="entityManagerFactory" ref="entityManagerFactory" />
  36.     </bean>
  37.  
  38.     <tx:annotation-driven transaction-manager="transactionManager" />
  39.  
  40.     <bean
  41.         class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  42.  
  43. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement