ms sql microsoft jdbc 驱动程序和 jTDS 驱动程序之间的差异
每个驱动程序之间有什么区别?我的意思是,除了其中之一是开源的之外,
每一种的优点/缺点是什么?
您会推荐哪一款?
以下是 jTDS 自己对此主题的看法:http://jtds.sourceforge.net/
What are the differences between each driver? I mean, besides one of them being open-source
What are the pros / cons of each one?
Which one would you recommend?
here's jTDS own opinion on the subject: http://jtds.sourceforge.net/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
它们是不同的实现。 jTDS 驱动程序是类型 4,根据我的经验,它具有更好的性能。我已经在生产环境中使用 jTDS 驱动程序 5 年了,没有出现任何问题。
我建议使用 jTDS。
They are distinct implementations. The jTDS driver is a type 4 and in my experience has better performance. I have been using the jTDS driver in a production environment without any issues for 5 years.
I would recommend going with jTDS.
虽然多年来 jTDS 比有缺陷的 mssql 自己的驱动程序优越得多,但最近情况正在发生相反的变化。
这是来自 https:// /confluence.atlassian.com/bitbucketserver/transitioning-from-jtds-to-microsoft-s-jdbc-driver-776640388.html:
While for many years jTDS was much superior than buggy mssql's own driver, the things are changing to the opposite recently.
Here is qoute from https://confluence.atlassian.com/bitbucketserver/transitioning-from-jtds-to-microsoft-s-jdbc-driver-776640388.html:
一个相关的区别是,JTDS 驱动程序 (v1.3.1) 的 JDBC 4.0 实现至少需要 Java 7,而 Microsoft 驱动程序的 JDBC 4.0 实现可在 Java 6 中使用。
如果您想使用 Hibernate,这一点很重要4.3(依赖于 JDBC 4.0 API)并支持 Java 6。在这种情况下,JTDS 不是一个选项。
One relevant difference is, that the JDBC 4.0 Implementation of the JTDS-Driver (v1.3.1) requires at least Java 7, whereas the JDBC 4.0 Implementation of the Microsoft driver is available in Java 6.
This is important if you want to use Hibernate 4.3 (relying on JDBC 4.0 API) and support Java 6. In that case JTDS is not an option.
使用 jTDS 的关键原因是它使用较少的 GPL 许可证,而 Microsoft 的驱动程序使用他们自己的许可证,这对其有更多的限制。需要注意的一项限制是,您不得
许可证中还有更多限制,例如:
这可能会被解释为您不得在生产代码中使用它,但许可证中的早期点似乎允许这样做。
说了这么多,我不知道 SQL Server 本身的许可证是否会限制连接到它的第三方驱动程序(例如 jTDS)。
另一点是 jTDS 可以通过 Maven 获得,而 Microsoft 驱动程序则不能。
对于我的选择,使用 jTDS,它更宽松并且最不可能给您带来麻烦,并且;这是一个更好的司机。
The key reason FOR using jTDS is that it uses the lesser GPL license where Microsoft's driver uses their own license which has much more restrictions to it. One restriction of note is that you may not
There are more restrictions within the license such as:
Which could be interpreted that you may not use it in production code, however earlier points in the license seem to allow it.
Having said all of this, I don't know of the licenses within SQL Server itself which may or may not restrict third-party drivers such as jTDS connecting to it.
Another point is that jTDS is available via maven, the Microsoft driver is not.
For my choice, use jTDS, it is more permissive and least likely to get you into trouble, and; it's a better driver.
jTDS性能良好,但看起来jTDS不支持故障转移属性,如果SQL Server切换到辅助,则需要重新启动应用程序/服务器以选择新IP并重置连接。
jTDSperformance is good, but looks like the fail-over property is not supported by jTDS, if the SQL Server switches to secondary, needed to restart the application/server for picking the new ip and reseting the connection.
jTDS 1.3.1(最新发布的版本)存在 TLS 问题,这对某些人来说可能会改变游戏规则。问题可能是从 Java 8 开始的 - 我看到了这样的评论 - 但尚未得到验证。有一个“私人”未发布的修复程序 - 请参阅例如 https://community.microfocus.com/cyberres/idm/w/identity_mgr_tips/19661/enforcing-ssl-tlsv1-2-jdbc-connection-via-jtds- jdbc 驱动程序
这对我有用。
您可以在下面找到尝试使用原始 jTDS 1.3.1 和 TLS 连接到 MS SQL 时生成的异常:
jTDS 1.3.1 (the latest released version) has problem with the TLS, what can be a game-changer for some people. The problems might have started with Java 8 - I saw such comment - but it's not verified. There's a "private", not released fix - see e.g. https://community.microfocus.com/cyberres/idm/w/identity_mgr_tips/19661/enforcing-ssl-tlsv1-2-jdbc-connection-via-jtds-jdbc-driver
It worked for me.
Below you can find an exception generated while trying to connect to the MS SQL using the original jTDS 1.3.1 and TLS: