Re: Wrong column names in ResultSetMetaData

Поиск
Список
Период
Сортировка
От Mike Martin
Тема Re: Wrong column names in ResultSetMetaData
Дата
Msg-id celqa5$i2c$1@news.hub.org
обсуждение исходный текст
Ответ на Re: Wrong column names in ResultSetMetaData  ("Mike Martin" <mmartin@vieo.com>)
Ответы Re: Wrong column names in ResultSetMetaData
Re: Wrong column names in ResultSetMetaData
Список pgsql-jdbc
Oliver Jowett wrote:
> Mike Martin wrote:
> > For programmatic purposes the column name concept is pretty
> > well defined by the docs on ResultSet.
>
> Can you point me to these docs? I can't see this requirement from a
> glance through the 1.4 javadoc, but the JDBC javadoc is pretty useless..

From the ResultSet Javadoc:

    "The column name option is designed to be used when column
    names are used in the SQL query that generated the result set.
    For columns that are NOT explicitly named in the query, it
    is best to use column numbers."

The only way to "name" a SQL query column is with AS.  There's
corroboration in DatabaseMetaData:

public boolean supportsColumnAliasing() throws SQLException

    Retrieves whether this database supports column aliasing.
    If so, the SQL AS clause can be used to provide names for
    computed columns or to provide alias names for columns as
    required.

In both cases, "names" and not "labels".

I too wish the docs were more definitive on this.  Googling on
the topic reveals that there has been confusion on it for some
time.  Anyone know someone at Sun who could confirm the true
intent?

Mike



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Unknown Response Type 1
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Wrong column names in ResultSetMetaData