hibernate.cfg.xml连接Sql2000参考代码

来源:互联网 发布:邮箱域名注册 编辑:程序博客网 时间:2024/06/06 07:50
  1. <!DOCTYPE hibernate-configuration PUBLIC
  2.     "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  3.     "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  4. <hibernate-configuration>
  5.     <session-factory>
  6.         <property name="hibernate.connection.url">
  7.         <!-- sql连接的注意!localhost:1433;DataBaseName=数据库名; -->
  8.             jdbc:microsoft:sqlserver://localhost:1433;DataBaseName=journal;
  9.         </property>
  10.         <property name="hibernate.connection.driver_class">
  11.             com.microsoft.jdbc.sqlserver.SQLServerDriver
  12.         </property>
  13.         <property name="hibernate.connection.username">sa</property>
  14.         <property name="hibernate.connection.password">123</property>
  15.         <property name="hibernate.dialect">
  16.             org.hibernate.dialect.SQLServerDialect
  17.         </property>
  18.         <property name="hibernate.show_sql">true</property>
  19.         <!-- 映射实体配置文件 -->
  20.         <mapping resource="com/journal/bean/Jbean.hbm.xml" />
  21.     </session-factory>
  22. </hibernate-configuration>
原创粉丝点击