日期:2014-05-16 浏览次数:21126 次
准备:建表
用MySQL在名为STMS数据库中建表person

在MyEclipse中建连接数据库的连接名为MySQL_localhost,在Driver JARS中导入MySQL的驱动程序mysql-connector-java-5.1.6-bin.jar

一.新建名为MySQLHibernate的Web Project
File—new—project—MyEclipse—Java Enterprice Projects—Web Project(Optional Maven Support)
在Project Name中输入MySQLHibernate---点击Finsh完成

1
xmlversion='1.0'encoding='UTF-8'?>
2
DOCTYPEhibernate-configurationPUBLIC
3
4
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
5
7
<hibernate-configuration>
8
9
<session-factory>
10
11
<propertyname="connection.username">rootproperty>
12
14
<propertyname="connection.url">
15
jdbc:mysql://localhost:3306/STMS?useUnicode=true&characterEncoding=GBK
16
property>
17
19
<propertyname="dialect">
20
org.hibernate.dialect.MySQLDialect
21
property>
22
24
<propertyname="myeclipse.connection.profile">
25
MySql_localhost
26
property>
27
29
<propertyname="connection.password">rootproperty
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。