[Microsoft][SQLServer 2000 Driver for JDBC]Underlying input stream returned zero

errors[Microsoft][SQLServer 2000 Driver for JDBC]Underlying input stream returned zero bytes

有字段类型设置成text. 并且该字段保存了NULL或者""(空字符),在jdbc中使用 getString("c_name");的时候就会出现此异常。 所以最好在该列设置默认值。保证有值。

或者

if(cpa_advance==null||cpa_advance.equals("")||cpa_advance=="")
   {
    cpa_advance = "我是空值~哈哈哈哈哈哈";
   }if(cpa_disadvance==null||cpa_disadvance.equals("")||cpa_disadvance=="")
   {
    cpa_disadvance = "我是空值~哈哈哈哈哈哈";
   }if(cpa_wgls==null||cpa_wgls.equals("")||cpa_wgls=="")
   {
    cpa_wgls = "我是空值~哈哈哈哈哈哈";
   }if(cpa_sspz==null||cpa_sspz.equals("")||cpa_sspz=="")
   {
    cpa_sspz = "我是空值~哈哈哈哈哈哈";
   }if(cpa_aqfd==null||cpa_aqfd.equals("")||cpa_aqfd=="")
   {
    cpa_aqfd = "我是空值~哈哈哈哈哈哈";
   }

 

-------------------------------------------------

or:

public static String strNotNull(String str)
{
         if("".equalse(str) || str = ""){
           
str = "我是空值~哈哈哈哈哈哈";
          
}
return str;

 }

你可能感兴趣的:([Microsoft][SQLServer 2000 Driver for JDBC]Underlying input stream returned zero)