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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

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