java - null point exception if not having value in array -
client:
for(int j=0;j<prod10.length;j++){ string ret_val =""; bean.setprod10(prod10[j]); ret_val=build.saversupplier(bean); }
dao:
if(rs.next()){ string sum=rs.getstring("max(patient_no)+1"); string q7="insert new8(ok, reference)" + " values('"+sum+"','"+purid10+"')"; preparedstatement p7 = con.preparestatement(q7); int s7 = p7.executeupdate(); }
if put value in array using prod10 set length , array of data stored in database if not put value in array null point exception occur,this should not have happen should have this
i presume prod10
array null
. have null check before loop.
if(null != prod10) { for(int j=0;j<prod10.length;j++){ string ret_val =""; bean.setprod10(prod10[j]); ret_val=build.saversupplier(bean); } }
Comments
Post a Comment