标签:
配置hibernate
1.新建web Project
2.新建DB Browser
3.右击项目Myeclipse->Add hibernate capabilities
4.next next
5.选择DB Driver
6.点击完成
生成过后的Hibernate
<?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">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="connection.url">
jdbc:sqlserver://127.0.0.1:1433;databaseName=test
</property>
<property name="connection.username">sa</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="myeclipse.connection.profile">test</property>
<property name="show_sql">true</property>
<mapping resource="com/Table/Administrator.hbm.xml" />
<mapping resource="com/Table/Advisor.hbm.xml" />
<mapping resource="com/Table/AdvisorTest.hbm.xml" />
<mapping resource="com/Table/St.hbm.xml" />
<mapping resource="com/Table/Trainee.hbm.xml" />
<mapping resource="com/Table/TraineeTest.hbm.xml" />
</session-factory>
</hibernate-configuration>
标签:
原文地址:http://www.cnblogs.com/articlepang/p/4565337.html