Quantcast
Channel: BTSoru.com - Bilisim ve Yazilim Teknolojileri Soru/Cevap Platformu - latest questions
Viewing all articles
Browse latest Browse all 4270

MySQL return = NULL veya null ise hatayi yakalasi

$
0
0

Merhabalar,

uygulamamda bir MySQL sorgulamasi yapiyorum. Eger sorgulamadan gelen cevap dolu ise herhangi bir sorun yok, fakat MySQL tableleri bos ise (NULL) veya null return degerleri geri gelirse, ugrastigim uygulamam cöküyor.

Simdiye kadar uyguladigim yöntemler kisaca söyle;

String getValue = getValuesFromMySql(1);  // return degeri String + parameter int

if (getValue.equals("")  getValue = "0";
if (getValue.length() <= 0 ) getValue = "0";
if (getValue.isEmpty()) getValue = "0";

ve sonuc eger NULL veya null ise aldigim hata mesaji sürekli " java.lang.NullPointerException: ....." seklinde...

Uygulamami NULL veya null a karsi nasil bir önlem ile koruyabilirim?

Her türlü fikir icin simdiden tesekkürler.

Erkan Kaplan


Viewing all articles
Browse latest Browse all 4270

Trending Articles


Mide ağrısı için


Alessandra Torre - Karanlık Yalanlar


Şekilli süslü hazır floodlar


Flatcast Güneş ve Ay Flood Şekilleri


Gone Are the Days (2018) (ENG) (1080p)


Yildiz yükseltme


yc82


!!!!!!!!!! Amın !!!!!!!!!


Celp At Nalı (Sahih Tılsım)


SCCM 2012 Client Installation issue