Re: Missing fields in getColumns() result

Поиск
Список
Период
Сортировка
От Christian Schröder
Тема Re: Missing fields in getColumns() result
Дата
Msg-id 4781CED2.2030305@deriva.de
обсуждение исходный текст
Ответ на Re: Missing fields in getColumns() result  (Kris Jurka <books@ejurka.com>)
Ответы Re: Missing fields in getColumns() result
Список pgsql-jdbc
Kris Jurka wrote:
> I don't like splitting the code into columns + values and I don't like
> splitting the query into two parts as inconsistencies may occur in the
> face of concurrent updates.  What about moving the existing
> implementation of getColumns to getColumns(int jdbcVersion), making it
> do different things based on the version provided and having
> getColumns() in Jdbc2/3 just provide the version to the new code.
The possible inconsistencies are indeed a problem!

I see three possible solutions:

   1. Implement it as you suggested.
      The only disadvantage of this approach is that the
      AbstractJdbc2DatabaseMetaData would have to contain also the jdbc3
      code. I personally would not expect to find the jdbc3
      implementation in the jdbc2 class, but if that's ok to you I won't
      complain about it.
   2. Duplicate everything from the AbstractJdbc2DatabaseMetaData class
      to AbstractJdbc3DatabaseMetaData and add the additional code here.
      Doesn't seem an option to me. In my experience code duplication
      should always be avoided.
   3. Further split up the code (which you probably would like even less
      *g*).
      The database query could be constructed in one or more separate
      functions which would be overridden in the
      AbstractJdbc3DatabaseMetaData class. Sounds rather complicated,
      but would keep the jdbc2 and jdbc3 implementations clearly separated.

It's up to you which approach you prefer. If you tell me which one you
want to have then I could implement it and send you a patch.

Regards,
    Christian

--
Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2                  http://www.deriva.de
D-37079 Göttingen

Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer



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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Patch for Statement.getGeneratedKeys()
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Missing fields in getColumns() result