Re: Select NULL column in Java
Posted in 1997
LEWRIGHT.DORR@heb.com wrote: :How do I select columns that may be NULL? Is there such a thing as the :NULL indicator host variable in Java as there is in "C"? : :Thanks, ...Dorr In JDBC there is a method to test for null. Sun has realy bungled this one though. You have to use a getXXX method to read a column value into a variable before you can test for null. Therefore it's called wasNull (not isNull). You also are supposed to use the getXXX method only once for each row and do it in a right to left order as in the select statement. Realy utterly stupid, but said to be so due to limitations of some underlying drivers. It only goes to show how bad some implementors of such drivers are, and it's sad that Sun is willing to go along with such crap. (They have an explanation for it in the documentation, but it isn't particularly persuasive.) However this is the way it is, and you better live by the rules in case you ever come across one of these bungled drivers. (If I did find one with these problems I would immediately look for an alternative supplier though.) This is all documented well in the JDBC driver documentation from Sun, so this is realy all an RTFM question. Check out http://splash.javasoft.com/jdbc/ for the documentation. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org