Skip site navigation (1) Skip section navigation (2)

Re: Exception while doing ResultSetMetadata.getColumnName() after select setval()

From: Kris Jurka <books(at)ejurka(dot)com>
To: Stephane Bailliez <sbailliez(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Exception while doing ResultSetMetadata.getColumnName() after select setval()
Date: 2007-09-18 00:10:46
Message-ID: Pine.BSO.4.64.0709172009410.10954@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Tue, 18 Sep 2007, Stephane Bailliez wrote:

> jdbc driver: postgresql-8.1-410.jdbc3.jar
> Sun jdk 1.6.0_01 windows xp
> postgresql 8.1.5 on windows xp and postgresql 8.1.9 on ubuntu
>
>
>            ResultSetMetaData md = rs.getMetaData();
>            int cols = md.getColumnCount();
>            for (int i = 0; i < cols; i++) {
>              String name = md.getColumnName(i); // XXX Exception here
>              print(name + "\t");

In JDBC columns go from 1 -> count, not 0 -> count-1.

Kris Jurka

In response to

Responses

pgsql-jdbc by date

Next:From: Stephane BailliezDate: 2007-09-18 11:03:08
Subject: Re: Exception while doing ResultSetMetadata.getColumnName() after select setval()
Previous:From: Stephane BailliezDate: 2007-09-17 22:30:57
Subject: Exception while doing ResultSetMetadata.getColumnName() after select setval()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group