Not so obvious when you've stared at it for a while, at least that's what I found. It suddenly jumped out at me though, thankfully.
executeStatement("SELECT A, B, C, D " +
"E, F " +
"FROM FOO " +
"WHERE A > 10")
How many columns do I get in the result set and what's the value in column D? If I execute resultSet.getObject("D") I actually get an invalid column name exception. Looking at the result set metadata I see 5 columns, called A B C E and F. Where's D gone? The value returned by resultSet.getObject("E") is actually the value of column D.
It's obvious though when you realise I missed the comma off the end of the list on the first line, doh! The database then renamed D as E, as it's supposed to, in the result set. Hard to spot when the code is formatted like this though. Especially hard when you don't think of such things and check everything else, well nearly everything else, first.
Posted by Alex at May 28, 2003 10:09 PM