`
yangdc
  • 浏览: 86779 次
  • 来自: ...
文章分类
社区版块
存档分类
最新评论

Data type 0x38 is unknown.

阅读更多

get this error when use JDBC driver to connect sql server 2005:

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.

find reason from microsoft :

Error Description - Microsft Bug - see comments below

SYMPTOMS

Consider the following scenario. You load the Microsoft SQL Server 2000 Driver for JDBC in an application. Then, you load the Microsoft SQL Server 2005 JDBC Driver in the same application. In this scenario, when you try to connect to a SQL Server 2005 database by using a SQL Server 2005 JDBC Driver URL, the connection is established by using the Microsoft SQL Server 2000 Driver for JDBC. If you subsequently run a query, you receive the following error message:

[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.

If you establish a connection to a SQL Server 2000 database, you may not receive any error message, and the fact that the wrong driver is being used may be unnoticed. You experience this problem when the SQL Server 2000 Driver for JDBC is loaded before the Microsoft SQL Server 2005 JDBC Driver is loaded in the application.

Back to the top

CAUSE

This problem occurs because faulty name resolution occurs in the SQL Server 2000 JDBC driver. The SQL Server 2000 JDBC driver accepts connection URLs from the SQL Server 2005 JDBC Driver. The SQL Server 2005 JDBC Driver connection string URLs start with the following string:

jdbc:sqlserver://ConnectionString

The SQL Server 2000 Driver for JDBC should only accept connection string URLs that start with the following string:

jdbc:microsoft:sqlserver://ConnectionString

However, the SQL Server 2000 Driver for JDBC also accepts connections that have the following format:

jdbc:sqlserver://ConnectionString

The exception occurs because the SQL Server 2000 Driver for JDBC is not designed to connect to a SQL Server 2005 database.

Back to the top

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next SQL Server 2000 Driver for JDBC service pack that contains this hotfix.

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 (http://support.microsoft.com/contactus/?ws=support)

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question

 

简言之,这是sql server 的一个bug,其原因是你的class_path中先有了sql server 2000的dirver 后来又加入了sql server2005的dirver,在连接2005 时会出现此问题。

目前有一个补丁提供,但貌似该补丁不能完全解决问题。

 

两个快速解决问题的方法是:

1.检查class path的设置,去掉sql server 2000的driver。

2.修改jdbc连接串的设置,将 SelectMethod=cursor

                                            改为
                                        SelectedMethod=cursor

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics