how to config when use hibernate+sqlserver2005
来源:互联网 发布:面向对象高级编程 编辑:程序博客网 时间:2024/05/19 02:18
1. there is sql server 2005 express edition which is free, user can download from: http://msdn.microsoft.com/zh-cn/express/bb410792.aspx 2. download jdbc driver from micorsoft, choose the proper driver version from the following website:http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=JDBC&DisplayLang=en3. download hibernate3 from http://hibernate.org4. add the jdbc driver and all the hibernate related jar files (not only hibernate3.jar) to the build path5. configue the for sql server port, by defualt, the connection by TCP/IP to database server is forbidden, In database configuration Manager, you should first enable it and also, for the connection, config the port, for IPAll connection, set the port to 1433;If not set the port, when connection, there will be exception like: connection refuesed, TCP/IP connection failed.the step: SQL Server Configuration Manager--> SQL Server 2005 Network configuration --> Network Protocol --> TCP/IP, 6. In the hibernate configuration file, configure like the following code:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property> <property name="hibernate.connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=hibernate</property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password">sa</property> <property name="hibernate.connection.pool.size">20</property> <property name="hibernate.connection.show_sql">true</property> <property name="jdbc.fetch_size">50</property> <property name="jdbc.batch_size">25</property> <property name="jdbc.use_scrollable_resultset">false</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <mapping resource="home/stronger/hibernate/CoreCitizen.hbm.xml"/> </session-factory> </hibernate-configuration>
- how to config when use hibernate+sqlserver2005
- How to config firefox's preference when use webdriver
- When and how to use a ThreadLocal
- How to config languages when build BSP
- how to config and use apt-get
- How to use .profile when logon by CDE under AIX
- How to aviod new line when use RadAjaxManager
- How to use Deep Learning when you have Limited Data
- How to use Hibernate - XML Configuration
- How to maintain user.config settings when upgrading
- How to use App.Config in WPF applications
- When to use DMU?
- When to use AtomicReference?
- SD-How to get delivery plant when you use va01 to create a new order
- Angular JS: How/when to use ng-click to call a route?
- How to use Hibernate annotations @ManyToOne and @OneToMany for associations
- When to use assert() and when to use try catch?
- When to use Class.isInstance() & when to use instanceof operator
- ASM的学习笔记
- flex中socket的使用
- new和malloc操作符的区别
- 关于我对Mozilla的研究
- 自动化测试框架设计指南
- how to config when use hibernate+sqlserver2005
- Java调用C语言DLL文件方法
- c语言学习(自我感想)
- Java构造方法中的多态
- 个人博客转移
- Windows网络编程经验总结
- 遭遇beep.sys/Backdoor.Win32.Agent,DOVA/Backdoor.Win32.Hupigon,myRAT.rmvb/Trojan.Win32.Delf等2
- Jacob处理Word文档的方法
- 博客已经荒废久已,近日开始除草