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

From: Barry Lind <blind(at)xythos(dot)com>
To: "M(dot) A(dot) Sridhar" <m_a_sridhar(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC driver reports column size of -1 !?
Date: 2003-01-08 01:52:43
Message-ID: 3E1B846B.8080109@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(at)yahoo(dot)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(at)postgresql(dot)org
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kovács Péter 2003-01-08 15:08:07 AW: [JDBC] Problem: commit doesn´t work
Previous Message Barry Lind 2003-01-08 01:34:48 Re: ArrayIndexOutOfBoundsException in Encoding.decodeUTF8()