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