设置SQL Server的Maven依赖关系 [英] Setting up maven dependency for SQL Server
问题描述
我正在开发一个portlet,让Hibernate可以访问SQL Server数据库。我为它设置了 maven依赖关系,并试图找到SQL Server连接器,就像我知道MySql拥有它一样。
我的Google如果我搜索SQL Server连接器,-search只给出Mysql。什么是正确的 maven dependency 值?
从Olaf提供的链接下载驱动程序JAR和将其添加到您的本地Maven存储库中;
$ p $安装文件-Dfile = / code>
然后将它添加到您的项目中;
<依赖性>
< groupId> com.microsoft.sqlserver< / groupId>
< artifactId> sqljdbc4< / artifactId>
< version> 4.0< / version>
< /依赖关系>
I am developing a portlet where I have Hibernate access to SQL Server database. I set up maven dependencies for it and try to find out SQL Server connector on the same way I know MySql has it.
Still my Google-search gives only Mysql if I search for SQL Server connector. What is the right maven dependency value?
Download the driver JAR from the link provided by Olaf and add it to your local Maven repository with;
mvn install:install-file -Dfile=sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
Then add it to your project with;
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
这篇关于设置SQL Server的Maven依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!