Re: ResultSetMetaData.getTableName() == null - Mailing list pgsql-jdbc

From Philip Yarra
Subject Re: ResultSetMetaData.getTableName() == null
Date
Msg-id 4513727F.10107@utiba.com
Whole thread Raw
In response to Re: ResultSetMetaData.getTableName() == null  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: ResultSetMetaData.getTableName() == null  (Oliver Jowett <oliver@opencloud.com>)
List 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@utiba.com

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: ResultSetMetaData.getTableName() == null
Next
From: Oliver Jowett
Date:
Subject: Re: ResultSetMetaData.getTableName() == null