JDBC Array Support, Take III
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
Attachments:
On Mon, 13 Aug 2001 16:16:27 -0400, you wrote:
Thanks for your feedback (and patience). Enclosed is my third
attempt at a patch to 7.1.2 to support Array.
Thank you. I'll be glad to give it some testing later this week.
[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.]
Yes, the patch format problem is gone. Unfortunately, patch
rejects some of the changes in jdbc2/ResultSet.java. I guess
that means this file has been changed in current CVS since you
took your snapshot.
Let me know if I'm getting closer to something useful.
Absolutely :-)
Regards,
Ren� Pijlman
This patch looks good to me.
--Barry
Greg Zoller wrote:
Show quoted text
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>
makeLet 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------------------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)patch.gz
Content-Type:
application/octet-stream
Content-Encoding:base64
------------------------------------------------------------------------
Part 1.3Content-Type:
text/plain
Content-Encoding:binary
Your patch has been added to the PostgreSQL unapplied patches list at:
http://candle.pha.pa.us/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
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>
makeLet 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, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Patch applied. I have attached a non-gzip version for review.
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>
makeLet 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, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026