hibernate连接SQL server 2008

注意启动SQL SERVER的TCP/IP服务

<?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="hbm2ddl.auto">update</property>
        <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
        <property name="connection.url">jdbc:sqlserver://127.0.0.1:1433;database=gtdata</property>
        <property name="connection.username">sa</property>
        <property name="connection.password">123456</property>
        <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
        <property name="myeclipse.connection.profile">SQL server 2008</property>
    
    </session-factory>

</hibernate-configuration>

猜你喜欢

转载自xiongjiajia.iteye.com/blog/1881651