Java中Underlying input stream returned zero bytes
异常 Underlying input stream returned zero bytes 解决办法
系统环境
jdk1.5
hibernate 3.0
sql server 2000
ms jdbc driver
将一个varchar类型的字段改为text后,就出现
[Microsoft][SQLServer 2000 Driver for JDBC]Underlying input stream returned zero bytes 的异常了。
从网上搜集资料来看,由于jdbc的bug,所以不能将一个"NULL"值和一个""(empty)存储在text类型的字段中。
解决办法:可以在表结构中设置字段的默认值为" "(one char)。
微软表示下一个版本将修正这个bug。
参考:
http://www.javaworld.com.tw/jute/post/view?bid=21&id=126312&sty=1&tpg=1&age=0
http://support.microsoft.com/default.aspx?scid=kb;EN-US;894559
相关文档:
最近一两个月以来一直在看java 代码, 看了一些开源的实现, 也看了一些产品中的代码,从这些代码中,学习了一些开源框架的应用(如ActiveMQ,cxf),也学习了这些框架的实现,同时也注意去理解每个类 以及接口的设计,以及设计模式的应用, 关注了一下,每个类,接口的规模,基本上有一些也会非常大,有几千行,有一些 ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......