X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E78B79DC82F for ; Fri, 17 Feb 2006 11:28:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56869-07 for ; Fri, 17 Feb 2006 11:29:01 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 6D74E9DCA6B for ; Fri, 17 Feb 2006 11:28:54 -0400 (AST) Received: from relay2.mecon.ar (relay2.mecon.gov.ar [168.101.16.11]) by svr4.postgresql.org (Postfix) with ESMTP id A64255AF088 for ; Fri, 17 Feb 2006 15:28:58 +0000 (GMT) Received: from racing.mecon.ar (racing.mecon.gov.ar [168.101.133.15]) by relay2.mecon.ar (8.12.11/8.12.11) with ESMTP id k1HFSoxQ089514 for ; Fri, 17 Feb 2006 12:28:50 -0300 (ART) (envelope-from tomas@mecon.gov.ar) Received: from racing.mecon.ar (meyosp.mecon.gov.ar [10.11.0.149]) by racing.mecon.ar (8.12.8p2/8.12.8) with ESMTP id k1HFSnq2065939 for ; Fri, 17 Feb 2006 12:28:49 -0300 (ART) (envelope-from tomas@mecon.gov.ar) Received: from [10.11.1.31] (Jupiter.mecon.gov.ar [10.11.1.31]) by racing.mecon.ar (8.12.8p2/8.12.8) with ESMTP id k1HFSnXU065923 for ; Fri, 17 Feb 2006 12:28:49 -0300 (ART) (envelope-from tomas@mecon.gov.ar) Message-ID: <43F5EBC9.30600@mecon.gov.ar> Date: Fri, 17 Feb 2006 12:29:13 -0300 From: =?ISO-8859-1?Q?=22Tom=E1s_A=2E_Rossi=22?= User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: es-es, es MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: ResultSet.getInt problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200602/125 X-Sequence-Number: 14722 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;