Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Beginner
Apr 27, 2000

Avoid Java Null Pointer Exceptions with SQL-J

Direct access of a NULL in a column does not cause any problems in SQL-J. If you use that value as a parameter in a Java method or as a method receiver, you will get a Java Null Pointer Exception. The conditional expression is useful for avoiding Java-caused null pointer exceptions:
 
SELECT empSurname.toUpperCase()
FROM Actors
-- If empSurname has any nulls, you'll get a null pointer exception 
SELECT (empSurname IS NULL) ?
(empFirstname||'*') :
empSurname.toUpperCase()
FROM Actors 
Manoj K.
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date