休眠:SQL Server .MDF文件的connection.url [英] Hibernate: connection.url for SQL Server .MDF File

查看:97
本文介绍了休眠:SQL Server .MDF文件的connection.url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为SQL Server .MDF文件休眠connection.url?我已经尝试过

How do I Hibernate connection.url for SQL Server .MDF File? I've tried

prop.setProperty("hibernate.connection.url", "jdbc:sqlserver://c:\\db.mdf");

但不起作用:(

谢谢!

推荐答案

属性hibernate.connection.url带有您必须提供的 JDBC URL ,该URL连接到数据库.在中了解有关此内容的更多信息.文档.

The property hibernate.connection.url takes the JDBC URL that you have to provide which connects to a database. Read more about it in the documentation.

例如:

hibernate.connection.url = jdbc:postgresql://localhost/mydatabase

MDF 文件是数据的内部表示形式在MS SQL Server中.您应该连接到SQL Server,而不是 MDF 文件.我还发现了一个问题,它确认了您不能在MS SQL Server外部使用MDF文件.

MDF file is an internal representation of data in MS SQL Server. You should be connecting to a SQL Server and not the MDF file. I have also found a question confirming that you can not use a MDF file out side the MS SQL Server.

这篇关于休眠:SQL Server .MDF文件的connection.url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆