hibernate连接mysql示范

来源:互联网 发布:阿布 网络攻击小组 编辑:程序博客网 时间:2024/06/07 22:53

hibernate配置文件 hibernate.cfg.xml


<?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>  <property name="show_sql">true</property>  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>  <property name="connection.url">jdbc:mysql://192.168.25.152/test</property>  <property name="connection.username">这里写用户名</property>  <property name="connection.password">密码</property>  <mapping resource="user.hbm.xml"/>  </session-factory>  </hibernate-configuration>  

http://blog.csdn.net/rcfalcon/article/details/5684546

原创粉丝点击