Re: ResultsetMetaData.getColumnName bug? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: ResultsetMetaData.getColumnName bug?
Date
Msg-id Pine.BSO.4.64.0712081100390.36@leary.csoft.net
Whole thread Raw
In response to ResultsetMetaData.getColumnName bug?  ("Roy Smith" <roy.smith@primetext.com>)
List pgsql-jdbc

On Sat, 8 Dec 2007, Roy Smith wrote:

> It looks like getColumnName() is incorrectly returning the column label.
> They are normally the same, but I have a query "select add as Address" and
> resultsetmetadata.getColumnName(1) is retuning "Address" instead of "add".
>

This has been discussed before (see archives), but the simplest
explanation is that rs.getXXX(rsmd.getColumnName(1)) should work and
won't if we return the base column name.  To get the result you want use
((PGResultSetMetaData)rsmd).getBaseColumnName().

Kris Jurka

pgsql-jdbc by date:

Previous
From: "Roy Smith"
Date:
Subject: ResultsetMetaData.getColumnName bug?
Next
From: sulfinu@gmail.com
Date:
Subject: Re: JDBC driver patch for non-ASCII users