JDBC Array Support, Take III

From: "Greg Zoller" <gzoller(at)hotmail(dot)com>
To: barry(at)xythos(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: JDBC Array Support, Take III
Date: 2001-08-13 20:16:27
Message-ID: F30E2sCRBHZXFZ0stgr00008ea1@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Greetings again.

Thanks for your feedback (and patience). Enclosed is my third
attempt at a patch to 7.1.2 to support Array.

[I think I've solved the mangled patch problem. Hotmail seems to
try to format the text file, so gzipping it should solve this
problem.]

In this patch I've incorporated Barry's feedback. Specifically:

1) OIDs are no longer hard-coded into Array.java. In order to
support this change I added a getOID(String) method to Field.java
which receives a PostgreSQL field type and returns a value from
java.sql.Types. I couldn't get away from using OIDs altogether
because the JDBC spec for Array specifies that some methods return
a ResultSet. This requires I construct Field objects,
which means I need OIDs. At least this approach doesn't hard
code these values. A Hashtable cache has been added to Field
so that an SQL lookup isn't necessary (following the model already
in Field.java).

2) Rewired the base formatting code in ResultSet.java to use 'to'
methods, which are then exposed as static methods in ResultSet.
These methods are used in Array to format the data without
duplications in the code.

3) Artifact call to first() in ResultSet.getArray() removed.

Patching as before: (gunzip first this time)

>cd <PGSQL_SRC_PATH>/src/interfaces/jdbc/org/postgresql
>patch -p1 < $PATH_TO_PATCH/patch
>cd <PGSQL_SRC_PATH>
>make

Let me know if I'm getting closer to something useful.

Take care.
Greg

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Attachment Content-Type Size
patch.gz application/octet-stream 6.1 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rene Pijlman 2001-08-13 20:28:34 Re: DatabaseMetaData
Previous Message Rene Pijlman 2001-08-13 20:08:41 Which JDK to build jdbc1 driver on Linux?

Browse pgsql-patches by date

  From Date Subject
Next Message Rene Pijlman 2001-08-13 20:38:48 Re: [PATCHES] JDBC Array Support, Take III
Previous Message Bruce Momjian 2001-08-13 19:53:53 Re: [PATCHES] PostGIS spatial extensions