SQL Server的休眠配置 [英] hibernate configuration for sql server
本文介绍了SQL Server的休眠配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我在使用sql server进行休眠配置时遇到问题.我不知道连接字符串到底是什么?所以下面是我的"hibernate.cfg.xml".请看一下并给我一些解决方案
Hello everybody, i have a problem with hibernate configuration with sql server. I don''t know what is exactly the connection string is? So below is my "hibernate.cfg.xml". Please take a look at it and give me some solutions
<session-factory name="HelloHibernate">
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.url">
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=dbhellohibernate;username=sa;password=admin
</property>
<!-- Mapping file -->
<mapping resource="nguyenle/hello/Message.hbm.xml"/>
</session-factory>
但是,当运行测试程序时,我出现此错误:其中一些是无法打开连接"
请帮助我,因为我只是hibernate的新手.
But when run the test program i have this error: some of them are "could not open a connection"
Please help me, because i''m just a novice with hibernate
推荐答案
您使用哪个版本的MS SQL?以及哪个操作系统?
对于Win 7 SP1(64位),建议使用MS SQL 2008 R2 -其他版本不起作用.
其他建议:
用户名和密码正确吗?
您可以从本地主机获得ping响应吗?
which version of MS SQL do you use? and which OS?
With Win 7 SP1(64bit) it''s recommended to use MS SQL 2008 R2 - the other version doesn''t work.
other suggestions:
Are Username and PW correct?
can you get a ping response from localhost?
这篇关于SQL Server的休眠配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文