javax.servlet.ServletException: 违反协议 at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463) at org.apache.jsp.test$jsp._jspService(test$jsp.java:142) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
嘿嘿 刚才google了一下 找到了好东西The 9.2.0.1 and 9.2.0.2 versions of the Oracle Thin driver do not allow you to work with a BLOB in tables that also contain a long raw. When you retrieve a BLOB from the table and call blob.length(), you will get a SQL protocol violation. 2696397 This issue is fixed in version 9.2.0.3 and 10G.
看看下面这段: The Thin driver throws this exception when it reads something from the RDBMS that it did not expect. This means that the protocol engine in the Thin driver and the protocol engine in the RDBMS are out of synch. There is no way to recover from this error. The connection is dead. You should try to close it, but that will probably fail too. If you get a reproducible test case that generates this error, please file a TAR with Oracle Global Support. Be sure to specify the exact version numbers of the JDBC driver and the RDBMS, including any patches. 我觉得是数据库引擎对某条记录的处理方式和JDBC驱动程序对某条记录的处理方式不一致,而产生的错误。我建议你使用与数据库相符的驱动程序试试。
我想问下出现乱码的字段是什么类型的 char? varchar?....
to ll42002(灰舌) 我建议你使用与数据库相符的驱动程序试试。 ----------我只有是能够用的数据库驱动我都用过了,结果都是一样:The connection is dead. 可问题是:我不能让它死亡,因为我做的是计划任务数据采集,一旦连接死亡,整个计划任务都会被异常带着死亡。看上面的那段英文,那就是除了该数据库记录外,就没有别的方法了? 那为什么PL/SQL能够做到呢(PL/SQL能够读出某些让我的连接死亡的数据记录。)? 有谁知道吗?
to wcmj(望尘莫及) 我想问下出现乱码的字段是什么类型的 char? varchar?.... -----------全部是 varchar 类型
异常也不能捕捉?那太奇怪了!那你把代码给我看看
是不是最简单的jdbc也会有这个问题?
如果是这样,我觉得数据库那边肯定有问题!
你用的什么数据库?
你用SQL/PLUS select count(*) tablename 出来的记录如果是10000条,但是用PL/SQL执行同样的查询语句出来的记录却是9800条?
为了这个问题,我曾今下了决心,一条一条比对一个表(还好那张表只有1k多记录),发现有很多的乱码记录,挑中其中一条在PL/SQL中select它的ID,得到的结果却是:没有找到记录
所以我称这条记录存在不可读字符!但这也不是绝对,有些存在乱码字符的记录在PL/SQL中又能够读的出来,JDBC也一样,有些可以,有些不可以。并且,我发现,同样的记录在ORACLE8i中会保错的,在ORACLE9却不会被JDBC报错。
如果你以后有机会接触海量数据的数据库项目时,我想你一定会遇到这样的问题的,特别是在某某系统数据大集中时,数据库中的数据都是从各种数据库中导入的,这种问题会越多。
rs.getBytes()
或者
rs.getCharacterStream()
来读,我就不信读不出来
呵呵
目前,我只在ORACLE8中遇到。
那你where条件是什么呢?就是id,int形的吗?
-------
那执行到next()的时候是什么症状?
难道是没有响应吗?
你把全部的异常信息贴出来看看,用printStacktrace()打印
说实话我从没遇到这个异常
http://search.csdn.net/Expert/topic/2194/2194932.xml?temp=.1120111
http://search.csdn.net/Expert/topic/1463/1463011.xml?temp=.9360468
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463)
at org.apache.jsp.test$jsp._jspService(test$jsp.java:142)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
刚才google了一下
找到了好东西The 9.2.0.1 and 9.2.0.2 versions of the Oracle Thin driver do not allow you to work with a BLOB in tables that also contain a long raw. When you retrieve a BLOB from the table and call blob.length(), you will get a SQL protocol violation. 2696397 This issue is fixed in version 9.2.0.3 and 10G.
也就是说他的驱动同样是有问题的我现在不能上国外网,你可以用
jdbc oracle protocol violation
关键字再搜索一下,应该有收获的我觉得是驱动的bug吧。。
你可以升级一下驱动试试
谢谢你了阿
我看刚才搜到的信息是说oracle8i和9i的部分数据库驱动都有这个bug啊
你可以试试高版本的数据库和驱动
:(
The Thin driver throws this exception when it reads something from the RDBMS that it did not expect. This means that the protocol engine in the Thin driver and the protocol engine in the RDBMS are out of synch. There is no way to recover from this error. The connection is dead. You should try to close it, but that will probably fail too.
If you get a reproducible test case that generates this error, please file a TAR with Oracle Global Support. Be sure to specify the exact version numbers of the JDBC driver and the RDBMS, including any patches.
我觉得是数据库引擎对某条记录的处理方式和JDBC驱动程序对某条记录的处理方式不一致,而产生的错误。我建议你使用与数据库相符的驱动程序试试。
我建议你使用与数据库相符的驱动程序试试。
----------我只有是能够用的数据库驱动我都用过了,结果都是一样:The connection is dead.
可问题是:我不能让它死亡,因为我做的是计划任务数据采集,一旦连接死亡,整个计划任务都会被异常带着死亡。看上面的那段英文,那就是除了该数据库记录外,就没有别的方法了?
那为什么PL/SQL能够做到呢(PL/SQL能够读出某些让我的连接死亡的数据记录。)?
有谁知道吗?
我想问下出现乱码的字段是什么类型的 char? varchar?....
-----------全部是 varchar 类型
你换驱动和数据库版本试了没有?
如果高版本没有问题就可以肯定是bug了