Originally posted by Ronnie Phelps:
Thank you!...I dont know why I didn't think of that myself.
First, your question. There is no field name, but nothing stops you from accessing the value by index - resultSet.getInt(1) should do fine.
Second, the semantics of the SELECT COUNT(field) query. When you use COUNT(*), you count
all selected records in the table. When you use COUNT(field), you only count those selected records
where field is not NULL. If this field is (part of) the primary key, or if it has a not-NULL constraint for another reason, you are OK. If you don't have suitable non-NULL fields or don't want to make fairly obscure assumptions in your code, refer to the result by index instead of name.
- Peter
[This message has been edited by Peter den Haan (edited June 27, 2001).]