Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [JDBC] Missing fields in getColumns() result

From: Christian Schröder <cs(at)deriva.de>
Date: Mon Jan 07 2008 - 02:03:46 EST


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



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               
http://archives.postgresql.org
Received on Mon Jan 7 02:06:16 2008

This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:42:06 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library