|
Joe, Only for strings! I hate doing: String something = resultset.getString (9); if (something.equals ("value")) dosomething; only to get a null pointer exception because that field happens to be retrieved by a LEFT JOIN and there's no corresponding record in the joined table and so getString returns a null instead of "". Its like, if something == null, then clearly it doesn't equal "value", so just give me False dammit :-) I know I could use: if ("value".equals (something)) dosomething; instead, but I dearly hate using string constants as objects like that :-) For all other object types I find nulls totally natural + the right way to go. Probably me showing my background tho, my background is really Delphi (OO) based instead of RPG so I'm used to nulls (RPG storing "nothingness" as a string of spaces really, really bugs me), and funnily enough in Delphi, Strings are not objects and you can't set them to null, they're primitive types just like int, although of course you can create an object container for them similar to the Java Integer type. Nigel Gay, Computer Patent Annuities. |---------+------------------------------> | | "Joe Pluta" | | | <joepluta@plutabrot| | | hers.com> | | | Sent by: | | | java400-l-bounces@m| | | idrange.com | | | | | | | | | 17/06/2005 03:04 PM| | | Please respond to | | | Java Programming on| | | and around the | | | iSeries / AS400 | | | | |---------+------------------------------> >--------------------------------------------------------------------------------------------------------------| | | | To: "'Java Programming on and around the iSeries / AS400'" <java400-l@xxxxxxxxxxxx> | | cc: | | Subject: RE: Date() | >--------------------------------------------------------------------------------------------------------------| > From: RPower@xxxxxxxxxx > > Sorry... guess old RPG habits are hard to ignore..... > I'll conform. I can change. Hehe. Null it is. I hate null indicators. I hate the extra space in the file. I hate the syntax of the %nullind BIF. I hate everything about them. Doesn't matter what I think, however <g>. They're the right way to identify that a field has not been entered. But it still takes an effort of will to actually use them. Does anybody else have this unnatural predisposition against null indicators, or is it just me? Joe -- This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. ******************************************************************************** The information in this message is confidential and may be legally privileged. It is intended solely for the addressee; access to this email by anyone else is unauthorised. If you are not the intended recipient: (1) you are kindly requested to return a copy of this message to the sender indicating that you have received it in error, and to destroy the received copy; and (2) any disclosure or distribution of this message, as well as any action taken or omitted to be taken in reliance on its content, is prohibited and may be unlawful. ********************************************************************************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.