gpt4 book ai didi

java - 使用 Hibernate 连接到 SQL Server

转载 作者:行者123 更新时间:2023-11-30 01:38:54 28 4
gpt4 key购买 nike

如何在Netbeans 6.7.1中使用Hibernate连接Sql Server数据库?请指教。

该方言对我来说已禁用。

最佳答案

对于 SQL Server 2000 和 2005,您应该使用 SQLServerDialect (这应该优先于 SybaseDialect ,即 deprecated )。

我无法验证 NetBeans Hibernate 向导如何与 SQL Server 配合使用,但是,根据 this tutorial :

When you create a Hibernate configuration file using a wizard you specify the database connection by choosing from a list of database connection registered with the IDE. When generating the configuration file the IDE automatically adds the connection details and dialect information based on the selected database connection.

所以,我的问题是:您是否为 SQL Server 数据库注册了数据库连接?如果没有,请转到服务,为您的 SQL Server JDBC 驱动程序添加新驱动程序(右键单击驱动程序节点)并添加< em>新建连接(右键单击数据库节点)以及数据库的正确 URL。

关于java - 使用 Hibernate 连接到 SQL Server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1741633/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com