java 使用hibernate访问sqlserver如何配置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">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

    <session-factory>
        <property name="show_sql">true</property>
        
       
        <property name="connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=BookInfo</property>
        <property name="connection.username">sa</property>
        <property name="connection.password">123</property>
        <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
        
        <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
        
    
    </session-factory>

</hibernate-configuration>

你可能感兴趣的:(Hibernate,sqlserver)