ResultSet.getInt problem

Поиск
Список
Период
Сортировка
От Tomás A. Rossi
Тема ResultSet.getInt problem
Дата
Msg-id 43F5EBC9.30600@mecon.gov.ar
обсуждение исходный текст
Ответы Re: ResultSet.getInt problem
Список pgsql-jdbc
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;


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Fabrice.Sznajderman@devoteam.com
Дата:
Сообщение: Re: In or Exists?
Следующее
От: "Scot P. Floess"
Дата:
Сообщение: unsubscribe