javasql-server-2012odbcjdbc-odbc

JDBC connection to MS SQL Server 2012 error


I have a server with Windows Server 2003 SP2 and third party application developed with Java SE version 5.0. This app connecting to external database server via configured ODBC source. In my ODBC sources I have configured source to external MS SQL server. As I can say it uses this driver: SQLSRV32.DLL Version: 2000.86.3959.00. When I configure this source and test conenction it says that connection is successfull.

Many years external DB server runned under MS SQL Server 2008 and all was OK. But now they migrated to MS SQL Server 2012 and my java app lost connection to it with exception like this:

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown.

How can I fix connection? Is there any driver I need to install for Windows or Java?


Solution

  • You are using an outdated and obsolete driver version. The error is a result of a bug in the SQLServer 2000 driver

    . To correct the issue you need to update the driver to a newer version. For more specific information on the cause and resolution of the error, see:

    Microsoft KB Article 915834

    To upgrade to later (2005+) drivers, you will be required update the jar files and the connection string used as described in the article. If you do not have access to the code to make a change, you will need to contact Microsoft and request an available hotfix that fixes the bug in the 2000 drivers as described in the KB and shown here:

    To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support

    It may also be possible to find a later 'patched' version of the driver .dll file. I was able to find an example of the download at this URL: Sqlsrv32.dll 2000.086.4412.00 which is a later version than the one you are using and may correct the issue. If that doesn't work search around for downloads later than this one, which as you can see is build #4412. If you download from a site other than Microsoft,make sure you do a virus scan of the file before using it.