Re: Patch: Some more state codes

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Patch: Some more state codes
Дата
Msg-id alpine.BSO.2.00.1109091019350.4040@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Patch: Some more state codes  ("Johann 'Myrkraverk' Oskarsson" <johann@2ndquadrant.com>)
Ответы Re: Patch: Some more state codes  (dmp <danap@ttc-cmc.net>)
Re: Patch: Some more state codes  (Maciek Sakrejda <msakrejda@truviso.com>)
Список pgsql-jdbc

On Wed, 7 Sep 2011, Johann 'Myrkraverk' Oskarsson wrote:

> Well, for application use imagine this scenario (from an actual
> application of mine):
>
>  try {
>      CREATE TABLE t ...
>  } catch ( SQLException e ) {
>      if ( e.getSQLState().equals( PSQLState.DUPLICATE_TABLE ) )
>          ; // do something or ignore when the table exists already
>      ...
>  }
>
>
> Now, if you don't want applications to use PSQLState and rely on the
> numerical values then there is not much need, no.
>

I guess I was not expecting users trying to write portable JDBC code to
write code that referred to PG specific classes.  Do other people do this?

> The UNDEFINED_OBJECT constant is a little trickier.  I use it to patch
> the driver for the Atomikos XA testsuite.  I've already submitted that
> patch but do understand your reluctance to accept it since its
> validity is not immediately apparent.

I've got to admit that I haven't really looked into that one, but if you
are patching the driver to fix that, then there's no reason that patch
couldn't touch PSQLState as well.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Issue getColumns(): Nonstandard use of \\ in a string literal
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: 9.1 driver status