On Fri, 17 Feb 2006, "Tomás A. Rossi" wrote:
> ResultSet rs= con.select(query);
> while (rs.next()) {
> id= rs.getInt("id");
> out.println(id); // prints 0 in every row!!
> name= rs.getString("name"); // ok
> ...
>
> Now if I change getInt("id") for the other overload getInt(1), it works fine!
> (it prints the correct id for every column)
>
I'm not sure what's going wrong here. What do you get if you add some
additional debugging code along the lines of the following:
ResultSetMetaData rsmd = rs.getMetaData();
for (int i=1; i<=rsmd.getColumnCount(); i++) {
System.out.println("["+rsmd.getColumnName()+"]");
}
Kris Jurka