Re: AbstractJdbc2Array - another patch

Поиск
Список
Период
Сортировка
От Marek Lewczuk
Тема Re: AbstractJdbc2Array - another patch
Дата
Msg-id 474BDD0F.6050609@lewczuk.com
обсуждение исходный текст
Ответ на Re: AbstractJdbc2Array - another patch  (Kris Jurka <books@ejurka.com>)
Ответы Re: AbstractJdbc2Array - another patch  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
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

Вложения

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: How to add data with ResultSet object?
Следующее
От: "cncinfo@126.com"
Дата:
Сообщение: cursor "curs" already in use ?