Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()

Поиск
Список
Период
Сортировка
От Patrice Le Gurun
Тема Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()
Дата
Msg-id 200105311548.f4VFmNE16132@postgresql.org
обсуждение исходный текст
Ответ на Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()  (Pete Jewell <pete@example.compulink.co.uk>)
Список pgsql-jdbc
Pete Jewell <pete@example.compulink.co.uk> writes:

> That's odd - I thought pgsql was case insensitive when it came to
> table and column names?  Ie,
>
> SELECT ID FROM TESTDB;
>
> and
>
> select id from testdb;
>
> are functionally equivalent?

Not really with the JDBC driver. You have to put column and table names into
double quotes if you have those names with uppercase. Ie, with a table TestDB
with a column named IdTest, you must sent the request :
    SELECT * FROM "TestDb" WHERE "IdTest" = 3
to Statement.execute() if you want to read the row. If you forget the quotes,
you'll have an SQLException which said something like "Table testdb does not
exist."

--
Patrice Le Gurun
mailto:patrice.le-gurun@wanadoo.fr
"GNU/Linux lets you drink more beer !"

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

Предыдущее
От: Pete Jewell
Дата:
Сообщение: Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()
Следующее
От: Joseph Shraibman
Дата:
Сообщение: Re: [GENERAL] Does ASSERTION constraint work ?