首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

怎么将null值插入date类型字段

2012-10-08 
怎样将null值插入date类型字段stmtDBFInsert.setDate(25, obj[24] null ? (java.sql.Date)null : (java

怎样将null值插入date类型字段
stmtDBFInsert.setDate(25, obj[24] == null ? (java.sql.Date)null : (java.sql.Date) obj[24]);//ZCRQ
                stmtDBFInsert.setDouble(26, obj[25] == null ? 0 : Double.valueOf(obj[25].toString()));//ZCZB  ------
                stmtDBFInsert.setString(27, obj[26] == null ? "" : obj[26].toString());//CXGB
                stmtDBFInsert.setDouble(28, obj[27] == null ? 0 : Double.valueOf(obj[27].toString()));//XZSBTZZJ  ---
                stmtDBFInsert.setDouble(29, obj[28] == null ? 0 : Double.valueOf(obj[28].toString()));//XZSBTZBZJ----
                stmtDBFInsert.setDouble(30, obj[29] == null ? 0 : Double.valueOf(obj[29].toString()));//XZSBTZJY-----
                stmtDBFInsert.setDouble(31, obj[30] == null ? 0 : Double.valueOf(obj[30].toString()));//XZZCZB-----
                stmtDBFInsert.setString(32, obj[31] == null ? "" : obj[31].toString());//JGCP
                stmtDBFInsert.setString(33, obj[32] == null ? "" : obj[32].toString());//BZ

第一行ZCRQ 是将null值插入到date类型中去,有什么办法可以解决呢

热点排行