Setting up maven dependency for SQL Server (为 SQL Server 设置 Maven 依赖项)
问题描述
我正在开发一个 portlet,我可以在其中 Hibernate 访问 SQL Server 数据库.我为它设置了 maven 依赖项,并尝试以我知道 MySql 拥有它的相同方式找出 SQL Server 连接器.
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.
如果我搜索 SQL Server 连接器,我的 Google 搜索仍然只提供 Mysql.什么是正确的 maven 依赖 值?
Still my Google-search gives only Mysql if I search for SQL Server connector. What is the right maven dependency value?
推荐答案
从 Olaf 和 将其添加到您的本地 Maven 存储库 ;
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 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为 SQL Server 设置 Maven 依赖项


- 更改自动增量起始编号? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01