简体   繁体   English

特殊驱动程序连接到sql server 2008 express

[英]special driver to connect to sql server 2008 express

I'm a java newbie, want to test out some hibernate goodies! 我是一个java新手,想测试一些hibernate好东西!

I have netbeans installed, and I included the Hibernate libraries. 我安装了netbeans,并且我包含了Hibernate库。

I then created a new package named Model. 然后我创建了一个名为Model的新包。

I will drop my Class and xml config files in there. 我将删除我的Class和xml配置文件。

Do I need a special library to connect to sql server? 我需要一个特殊的库来连接到SQL Server吗? (windows machine) (windows机器)

Yes, you'll need a JDBC library that talks to Microsoft SQL Server. 是的,您需要一个与Microsoft SQL Server对话的JDBC库。 jTDS used to be my first choice but the Microsoft JDBC driver has come a long way and I'd recommend using that. jTDS曾经是我的第一选择,但Microsoft JDBC驱动程序已经走了很长的路,我建议使用它。 You can download it from this site . 您可以从此站点下载它。

You'll also need to follow these instructions to get the two talking to each other as SQL Server express doesn't listen to TCP by default and uses Windows Authentication Mode. 您还需要按照这些说明使两者相互通信,因为SQL Server Express默认不监听TCP并使用Windows身份验证模式。

Have a look at these two URLs for examples of your hibernate.cfg: An explanatory Blog Entry and a JavaRanch Question . 有关hibernate.cfg的示例,请查看这两个URL: 解释性博客条目JavaRanch问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM