Обсуждение: JDBC driver reports column size of -1 !?

Поиск
Список
Период
Сортировка

JDBC driver reports column size of -1 !?

От
"M. A. Sridhar"
Дата:
Hi folks,

I have a code fragment that looks something like this:

        DatabaseMetaData mtd  = connection.getMetaData();
        ResultSet columns = mtd.getColumns (null, "%", tableName, "%");
        for (int i = 0; columns.next(); i++) {
            String columnName = columns.getString ("COLUMN_NAME");
            int dataSize = columns.getInt ("COLUMN_SIZE");
             // .... other stuff here....
        }

The dataSize parameter gets the value -1 for numeric columns, although it is
correctly reported for characters and varchars. I'm beginning to believe this
is a driver bug, because the same code returns positive sizes when run
against an Oracle database. Even DbVisualizer (from http://www.minq.se/)
shows a negative column size. Can anyone help?

FYI, I'm using the 7.2 JDBC2 driver. (I can't use the 7.3 driver because of
the objsubid bug that was recently discussed on the list.)

Thanks in advance.

=====
------
M. A. Sridhar
m_a_sridhar@yahoo.com

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: JDBC driver reports column size of -1 !?

От
Barry Lind
Дата:
Can you try building the latest code from CVS and trying it?

The code in current CVS has the fix to the objsubid bug you are
referring to, and I beleive the -1 column size problem is a known bug
fixed in 7.3.

thanks,
--Barry



M. A. Sridhar wrote:
> Hi folks,
>
> I have a code fragment that looks something like this:
>
>         DatabaseMetaData mtd  = connection.getMetaData();
>         ResultSet columns = mtd.getColumns (null, "%", tableName, "%");
>         for (int i = 0; columns.next(); i++) {
>             String columnName = columns.getString ("COLUMN_NAME");
>             int dataSize = columns.getInt ("COLUMN_SIZE");
>              // .... other stuff here....
>         }
>
> The dataSize parameter gets the value -1 for numeric columns, although it is
> correctly reported for characters and varchars. I'm beginning to believe this
> is a driver bug, because the same code returns positive sizes when run
> against an Oracle database. Even DbVisualizer (from http://www.minq.se/)
> shows a negative column size. Can anyone help?
>
> FYI, I'm using the 7.2 JDBC2 driver. (I can't use the 7.3 driver because of
> the objsubid bug that was recently discussed on the list.)
>
> Thanks in advance.
>
> =====
> ------
> M. A. Sridhar
> m_a_sridhar@yahoo.com
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>