JDBC driver reports column size of -1 !? - Mailing list pgsql-jdbc

From M. A. Sridhar
Subject JDBC driver reports column size of -1 !?
Date
Msg-id 20030106010707.22371.qmail@web40403.mail.yahoo.com
Whole thread Raw
Responses Re: JDBC driver reports column size of -1 !?  (Barry Lind <blind@xythos.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Jim Downing
Date:
Subject: Idle in Transaction
Next
From: Dave Cramer
Date:
Subject: Re: Idle in Transaction