The incoming tabular data stream (TDS) remote proc

2019-09-11 19:41发布

问题:

Trying to connect to sqlserver DB and retrieve info and later insert to it. On the server getting this error when trying to make a JDBC call with select.

java.sql.SQLException: [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.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)

On my local machine everything is working fine. Not sure what needs to be done. Please need help on this.

The classpath on server contains path to the below jars in this order.

msutil.jar
mssqlserver.jar
msbase.jar
sqljdbc4.jar

回答1:

You have multiple Microsoft JDBC drivers on your classpath, and as a result you are connecting with the ancient MS SQL Server 2000 JDBC driver. Remove the old ones (ie msutil.jar, mssqlserver.jar and msbase.jar), and only leave sqljdbc4.jar. Also check if there is a newer version available than the one you are currently using.