Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- application-context.xml:
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-4.0.xsd">
- <!-- Base package for checking the annotated classes -->
- <context:component-scan base-package="net.sk"></context:component-
- scan>
- <!-- Configure JDBC Connection-->
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url"
- value="jdbc:mysql://localhost:3306/springmvctutorial" />
- <property name="username" value="root" />
- <property name="password" value="sh@123" />
- </bean>
- <!-- Configure Hibernate 4 Session Facotry -->
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <property name="dataSource">
- <ref bean="dataSource" />
- </property>
- <property name="hibernateProperties">
- <props>
- <prop
- key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
- <prop key="hibernate.show_sql">true</prop>
- </props>
- </property>
- </bean>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement