Hi,
I'm using PostgreSQL 8.1.2 in a FreeBSD 5.3. Using with JAVA servlet
application and driver postgresql-8.1-405.jdbc2ee.jar.
I make the query in Java so the DB returns a table something like (I
passed the query manually to the DB to be sure it was OK):
id | name | domain | ...
17 | minplan | minplan.gov.ar | ...
8 | msal | msal.gov.ar | ...
10 | trabajo | trabajo.gov.ar | ...
(3 rows)
Now in Java I get a code like this:
try {
ResultSet rs= con.select(query);
while (rs.next()) {
// I get the results.
id= rs.getInt("id");
out.println(id); // prints 0 in every row!!
name= rs.getString("name"); // ok
domain= rs.getString("domain"); // ok
...
Now if I change getInt("id") for the other overload getInt(1), it works
fine!
(it prints the correct id for every column)
Thanks in advance,
Tom;