Re: ResultSetMetaData.getTableName() == null

From: Philip Yarra <philip(at)utiba(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Alex Stienstra <alex(dot)stienstra(at)zonnet(dot)nl>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData.getTableName() == null
Date: 2006-09-22 05:19:59
Message-ID: 4513727F.10107@utiba.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver Jowett wrote:
> We don't know whether aliases have been used or not so we can't do this.

Just had a look at the source for getTableName:

public String getTableName(int column) throws SQLException
{
return "";
}

I can cast rsmd to PGResultSetMetaData and call getBaseTableName, and it
does what I expect - in my example, gets the table name... so is there
some reason why getTableName couldn't be re-written as:

public String getTableName(int column) throws SQLException
{
return getBaseTableName(column);
}

Sorry if this is re-hashing old ground - I read the thread you mentioned
before, but that seemed to be more about getting column names where
they're aliased in the query using an AS clause. I'm assuming there's a
lot of background that led to the implementation we have currently...
any hints gratefully accepted.

Regards, Philip.

--
Philip Yarra
Senior Software Engineer, Utiba Pty Ltd
philip(at)utiba(dot)com

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-09-22 05:40:18 Re: ResultSetMetaData.getTableName() == null
Previous Message Oliver Jowett 2006-09-22 03:56:18 Re: ResultSetMetaData.getTableName() == null