Sybase报Invalid packet type 0x22错误
来源:互联网 发布:用手机练歌哪个软件好 编辑:程序博客网 时间:2024/06/13 23:28
今天使用Sybase(15.7 Developer版)查询DB时,遇到了很诡异的错误,错误异常如下:
<-- java.sql.SQLException: TDS Protocol error: Invalid packet type 0x22at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2284)at net.sourceforge.jtds.jdbc.TdsCore.isDataInResultSet(TdsCore.java:792)at net.sourceforge.jtds.jdbc.JtdsResultSet.<init>(JtdsResultSet.java:146)at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424)at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)at com.trs.infra.persistent.BaseObjs.loadCurrentData(BaseObjs.java:1321)at com.trs.infra.persistent.BaseObjs.open(BaseObjs.java:1437)at com.trs.ekp.stat.obtain.StatResultObtainMgr.queryStatResults(StatResultObtainMgr.java:194)at com.trs.ekp.stat.domain.ExpertLevelMgrTest.testGetAllExpertLevels(ExpertLevelMgrTest.java:51)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at junit.framework.TestCase.runTest(TestCase.java:154)at junit.framework.TestCase.runBare(TestCase.java:127)at junit.framework.TestResult$1.protect(TestResult.java:106)at junit.framework.TestResult.runProtected(TestResult.java:124)at junit.framework.TestResult.run(TestResult.java:109)at junit.framework.TestCase.run(TestCase.java:118)at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)Caused by: net.sourceforge.jtds.jdbc.ProtocolException: Invalid packet type 0x22at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2271)... 24 more
经过定位,最终发现是指定的表中的字段个数太多(我这个表中有575个字段),把sql语句修改成select 字段1,字段2 …… from 表
问题不再重现。
select * 时,底层虽然也会提取所有字段,但是会报这个错误,如果我们把所有字段列在select后面,则不会报错,可以正确提取出字段。sql语句变为:select Field1,Field2,Feild3…… from TableName.
后来又测试了下,发现对如果是对decimal字段类型进行排序时,也会报这个错。
- Sybase报Invalid packet type 0x22错误
- format_aodv: invalid AODV packet type
- 编译报错void is an invalid type for the variable……错误解决
- invalid use of incomplete type 报
- Sybase存储过程报transaction mode错误
- invalid constant type: 15 错误解决
- unordermap 错误 invalid use of incomplete type
- 【错误解决方法】void[] is an invalid type
- invalid constant type: 15 错误解决
- 解决XML中报“cvc-complex-type.2.4.a: Invalid content was found starting with element ”错误
- tomcat8.0 启动报错 java.io.StreamCorruptedException: invalid type code: 3F
- tomcat报BAD packet signature 18245错误的原因
- 微信支付,报invalid out_trade_no错误
- BCB contains invalid OMF record,type 0x21(possibly COFF)错误
- 解决:keil报错invalid redeclaration of type name "s32"
- mdk报错invalid redeclaration of type name "s32"
- 解决:keil报错invalid redeclaration of type name "s32"
- Excel Old format or invalid type library 错误原因
- C# ToString格式大全
- Launcher 参考博客
- Windows下的Memcache安装
- http://acm.fzu.edu.cn/problem.php?pid=1698 最大乘积
- 新添加edmx文件后,无法生成 “*.csdl”、“*.ssdl”或“*.msl”文件
- Sybase报Invalid packet type 0x22错误
- contentmode备忘
- UltraEdit View As菜单显示为:语言 1, 语言 2 ...
- 使用onclick跳转到其他页面/跳转到指定url
- 【CSDN2012年度博客之星评选活动】,来投我一票吧
- 多线程计算pi效率对比分析
- ITM 安装实践 - linux
- 越真实越感人,对自己真实了,你才会感动你自己!
- JS 继承又一法