Contrast and Contrast introducing a Java jar package connected to different versions of SQL server2000,2005,2008 like manner

Due to the need, and this time the company has been dealing with a bunch of the old system, the system how old it? Anyway, older than me.

This process also stepped pit numerous connections SQL server database is one. Since before contact are relatively new thing, various software versions for both relatively new, which makes me very little attention to these versions ancestor eight generations. Well, since it has been filled in the hole, fill the hole put the specific operation of the record, so as not to forget themselves, but also to give you a small partner to be a reference.

1, Java connection SQL server2000.
(1) Connection

sqlserver.jdbc.driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver
sqlserver.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=test
sqlserver.jdbc.username=sa
sqlserver.jdbc.password=sa

(2) to be introduced into the jar package
three jar package: msbase.jar, mssqlserver.jar, msutil.jar
I put my bag on the three jar of Baidu network disk inside, there is little need partners can download, extract code: pj78

2, Java connection SQL server2005 and above.
(1) Connection

spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://localhost:1433;DatabaseName=test
spring.datasource.username=sa
spring.datasource.password=sa

(2) jar for an incoming packet.
Sqljdbc4.jar introduced in the project, click on the download , extract the code r3ma. (Some say the Internet is the 2005 version introduces sqljdbc.jar, 2008 and later versions introduced sqljdbc4.jar, but I connect 2005 and 2008 versions of the database, are introduced sqljdbc4.jar, can be used, I do not know why.)

Another point is jdk version compatibility issues, generally higher version of jdk able to connect to previous versions of SQL server database, but the high version of the database but must use a higher version of jdk.
I tried two ways: First sqlserver2008 must be able to connect with jdk1.7 and above; the second is jdk1.8 compatible with all versions of sqlserver2000,2005,2008 and so on.
It may be a bit crap. Notes on the record here, if an error is found a small partner, welcome criticism * ____ *.

Guess you like

Origin blog.csdn.net/tanwenfang/article/details/90543739