Re: DatabaseMetaData.getTables returns lower-case column names

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: DatabaseMetaData.getTables returns lower-case column names
Дата
Msg-id 51964B4A.2080504@gmx.net
обсуждение исходный текст
Ответ на DatabaseMetaData.getTables returns lower-case column names  (Július Štroffek <julo@stroffek.cz>)
Список pgsql-jdbc
Július Štroffek wrote on 17.05.2013 17:06:
> I am using eclipselink with pgsql jdbc driver '9.2-1002 JDBC 4' and
> when eclipselink tries to get the list of available tables using the
> ${subject} function PostgreSQL JDBC will return the result having the
> column names lower case.
>
> The JDBC API clearly describes them as upper-case, see
>
http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getTables%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[]%29

I don't see any statement that claims the table or column names should be returned in upper case.

The driver should always return the names as _stored in the database_ which could mean lowercase, uppercase or mixed
casedepending on the DBMS. To find out _how_ the DBMS stores them you can use storesLowerCaseIdentifiers(),
storesMixedCaseIdentifiers()and storesUpperCaseIdentifiers() 

> Is there any reason why the names are returned as lower case?

Yes, because Postgres stores all (unquoted) identifiers in lowercase.



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

Предыдущее
От: Július Štroffek
Дата:
Сообщение: DatabaseMetaData.getTables returns lower-case column names
Следующее
От: Rui Zhu
Дата:
Сообщение: [PATCH] Driver.knownProperties key is "tcpKeepAlive", but URL parameter is created with "tcpkeepalive", which renders setTcpKeepAlive(boolean) uneffective