in reply to (OT) Am I weasel or just right?

Maybe you should introduce your java developer to rtrim(). His code probably looks something like this ...
// I assume test_val will never be ' ' ResultSet r = select.executeQuery ("SELECT test_val FROM test");
And test_val is a space when he expected a NULL. He could use rtrim() like so ...
// My code turns ' ' to NULL now ResultSet r = select.executeQuery ("SELECT rtrim(test_val) FROM test") +;
Please excuse my Java.
Plankton: 1% Evil, 99% Hot Gas.