近来做了一个小项目,用到了Struts1.x,Spring 2.5和Hibernate3,其中的一些配置文件较为典型,所以拿到这里来和大家分享。
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
- <hibernate-configuration>
- <session-factory>
- <!-- 配置JDBC连接
- <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
- <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/javapk</property>
- <property name="hibernate.connection.username">root</property>
- <property name="hibernate.connection.password">scorpio</property>
- -->
- <!-- 配置数据源连接 -->
- <property name="hibernate.connection.datasource">jdbc/javapk</property>
- <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
- <property name="hibernate.show_sql">true</property>
- <property name="hibernate.hbm2ddl.auto">update</property>
- <mapping resource="org/scorpio/dao/persistence/User.hbm.xml"/>
- <mapping resource="org/scorpio/dao/persistence/Manager.hbm.xml"/>
- </session-factory>
- </hibernate-configuration>