lundi 13 avril 2015

SQLite driver : Getting probelm with getBinaryStream whene Blob is null

I'm getting a problem with getBinaryStream method whene the blob columns has null values on db, here is my code :



Image img=null;
if(rs.getBinaryStream("ad_photo") != null)
img = new Image(rs.getBinaryStream("ad_photo"));
else
img = new Image("proson.png" );
addadh_adherent_photo.setImage(img);
addadh_adherent_photo_label.setText("photo définie");


and i am getting this exception :



java.lang.NullPointerException


whene the row on db has not a null value of the blob columns all is fine but the problem is whene the row has null value. how can i fix this problem ?


Aucun commentaire:

Enregistrer un commentaire