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">

<hibernate-configuration>

    <session-factory>

        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>

或者

     <property name="connection.url">jdbc:mysql://localhost:3306/数据库名</property>
        <property name="connection.username">sa</property>
        <property name="connection.password">123</property>
        <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
        <property name="show_sql">true</property>
<property name="current_session_context_class">thread</property>
        <mapping resource="org/hibernate/tutorial/domain/Event.hbm.xml"/> 

    </session-factory> </hibernate-configuration >
posted @ 2012-08-24 23:03  西瓜霜  阅读(161)  评论(0编辑  收藏  举报