Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: AbstractJdbc2Array - another patch



Kris Jurka pisze:
Doesn't seem to work. The attached case fails in two different ways depending on whether compatible is set or not. The JDK methods you can use depends on where the code you are adding goes. In this case you're adding code to a JDBC2 class, so you are restricted to JDK1.2 code. JDBC3 -> 1.4, JDBC3g -> 1.5, JDBC4 -> 1.6.
It should work right now (I've tested it using your examples). As for java.lang.reflect package it was added in JDK1.1, so it should work for all supported Java versions.

Right now you use objects if either dims > 1 or useObjects. I'm suggesting that we should only use objects if useObjects. That way people who want to get int[][] returned can get that via setting compatible=8.2.
Well, my implementation works as you described, have a look at Boolean/boolean:
	if (dims > 1 || useObjects) // if more than one dimension or objects
            {
		// here I check if more than one dimension and if so
// I check for useObjects - if true, then Boolean[] if false then boolean[] ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(useObjects ? Boolean.class : boolean.class, dimsLength) : new Boolean[count]);
            }

            else // if one dimension primitive array
            {
                ret = pa = new boolean[count];
            }

In the attachment you can find appropriate patch. Please review it again. Btw, you didn't answer about ResultSetMetaData.getColumnTypeName() - does it mean, that we won't do anything with that in near future ?

Best wishes,
Marek

Attachment: AbstractJdbc2Array.patch.zip
Description: Zip compressed data



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group