ไม่ว่าจะสูงแค่ไหนก็ไปถึง











{September 7, 2007}   Hibernate Configuration Wizard with eclipse and SQL Server 2005

1. คลิกขวาที่โปรเจค เลือก Exadel Studio > Add Hibernate Capabilities … (ต้องลง Exadel Studio 4.0.4a ก่อน)
2. เลือก jar file ทั้งหมดที่มันเสนอมา
3. ตั้งชื่อ Hibernate Configuration File … ตัวอย่าง
/projectName/hibernate.cfg.xml
4. Connection Types ให้เลือก ตาม default ไปเลย
5. Hibernate Dialect: org.hibernate.dialect.SQLServerDialect
JDBC Connection Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC Connection URL: jdbc:sqlserver://[hostname]:1433;databaseName=[dbName]
6. แล้วก็ใส่ username กับ password แล้ว Test Connection ดู

ถ้า test แล้วมีปัญหา “com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.” ให้ไปที่ Configuration Tools > SQL Server Configuration Manager > SQL Server 2005 Network Configuration > Protocol for MSSQLSERVER แล้ว enable TCP/IP แล้วก็ restart service ทีนึง

Advertisement


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

et cetera
Follow

Get every new post delivered to your Inbox.