<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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-2.5.xsd">
<!-- ????? -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://127.0.0.1/MyBlog</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>5252</value>
</property>
</bean>
<!-- ??SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.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">false</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/lxh/blog/model/User.hbm.xml</value>
<value>org/lxh/blog/model/Article.hbm.xml</value>
<value>org/lxh/blog/model/BlogInfo.hbm.xml</value>
<value>org/lxh/blog/model/Critique.hbm.xml</value>
<value>org/lxh/blog/model/Dianjiliang.hbm.xml</value>
</list>
</property>
</bean>
<!-- ??hibernateTemplate -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
ssh mysql java