commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernard, Shawn" <>
Subject RE: Problem with Result Set returning null instead of Empty String
Date Wed, 25 Jan 2006 12:43:23 GMT
I know this doesn't really answer your question, but if you switch your trim() calls to StringUtils.trim()
then you avoid a possible NullPointerException since the StringUtils version is nullsafe.


-----Original Message-----
From: Chetan []
Sent: Wednesday, January 25, 2006 4:50 AM
Subject: Problem with Result Set returning null instead of Empty String


I have a web application running on Tomcat 4.0. In it i have implemented by
own Connection Pool. Now im trying to use the DBCP connection broker to
handle message pools. I have managed in doing so but ther's just one

Earlier in my code, whenever i was doing a resultSet.getString('some column
name'), the return value would be an empty string ('') in case the column in
the database was null. However, after using DBCP, similar statements return
null and since in a lot of places, i have done operations such as trim() etc
on these returned Strings, i am getting null pointer exceptions all over the

Is there any way by which i could make the DBCP connection broker return an
empty string instead of a null so that i dont need to make changes in
numerous places in my application to handle the null pointer case ?

Thanks and Regards,

Chetan Arora

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message