Hibernate Configuration Connection sqlsever2008 database

Source: Internet
Author: User

<?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" > 

Follow Hibernate's properties configuration db instance file to see.

# # Microsoft Driver (not recommended!) #hibernate. Connection.driver_class com.microsoft.jdbc.sqlserver.sqlserverdriver#hibernate.connection.url jdbc: Microsoft:sqlserver://1e1;databasename=test; selectmethod=cursor## the New Microsoft Driver #hibernate. Connection.driver_class Com.microsoft.sqlserver.jdbc.sqlserverdriver#hibernate.connection.url Jdbc:sqlserver://localhost

The first way is not recommended. So I try to use the second way. The result was an error. The error is as follows, Error1.

Error1INFO:HHH000115:Hibernate Connection Pool size:20 (min=1) Exception in thread "main" Org.hibernate.exception.JDBCC Onnectionexception:error calling Driver#connect
The second way: according to the example, there is no database description ah. <property name= "Hibernate.connection.url" >jdbc:sqlserver://127.0.0.1:1433/hibernate</property>
The first way: The result is successful. Where does the problem really go??? <property name= "Hibernate.connection.url" >jdbc:sqlserver://127.0.0.1:1433;database=hibernate</property >

I want to ask what is the way hibernate recommends connecting the Sqlsever database?

Hibernate Configuration Connection sqlsever2008 database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.