首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

容易的hibernate示例(第一个)

2012-09-18 
简单的hibernate示例(第一个)一下代码,是我简单写的hibernate的示例,很简单,算是对hibernate的的回忆,很简

简单的hibernate示例(第一个)

一下代码,是我简单写的hibernate的示例,很简单,算是对hibernate的的回忆,很简单

pojo类,user,代码如下:

<!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory name="foo"><property name="show_sql">true</property><property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate_first</property><property name="hibernate.connection.username">root</property><property name="hibernate.connection.password">891220</property><property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property><!-- 设置关联资源 --><mapping resource="com/pzoom/xiaochen/pojo/User.hbm.xml"/></session-factory></hibernate-configuration>


呵呵,很简单的代码,大家看看,仅作参考


热点排行