differences between ms sql microsoft's jdbc drivers and jTDS's driver

浪尽此生 提交于 2019-12-30 05:45:28

问题


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/


回答1:


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.




回答2:


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:

Why change drivers?

Recent releases of Hibernate, which Bitbucket Server uses to simplify its persistence layer, have introduced a requirement that the JDBC drivers and connection pools used be JDBC4-compliant. JDBC4 was introduced with Java 6.

The jTDS driver used by releases prior to Bitbucket Server 2.1 is a JDBC3 driver, compatible with Java 1.3, and therefore cannot be used with newer versions of Hibernate. While jTDS 1.3.0 and 1.3.1 claim to implement JDBC4, and JDBC4.1, they actually don't. The new methods have been "implemented", but their implementations are all throw new AbstractMethodError(), which means they can't actually be used. (See an example here, on GitHub.)

Since jTDS 1.3.1 does not provide a functioning JDBC4 implementation, the decision was made to replace jTDS with Microsoft's own SQL Server driver. Microsoft's driver is actively maintained, where jTDS hasn't been updated since 2014 (and prior to the small round of updates done in 2014 it hadn't been updated for multiple years). Microsoft offers a full JDBC4.2 (Java 8) driver and supports all the features of SQL Server, including SQL Server 2016.




回答3:


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.




回答4:


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

  • work around any technical limitations in the software

There are more restrictions within the license such as:

  • transfer the software or this agreement to any third party
  • use the software for commercial software hosting services

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.

<dependency>
    <groupId>net.sourceforge.jtds</groupId
    <artifactId>jtds</artifactId>
    <version>1.3.1</version>
</dependency>

For my choice, use jTDS, it is more permissive and least likely to get you into trouble, and; it's a better driver.




回答5:


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.



来源:https://stackoverflow.com/questions/4393766/differences-between-ms-sql-microsofts-jdbc-drivers-and-jtdss-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!