X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 43D7ADBAF5 for ; Fri, 18 Nov 2005 14:38:15 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69191-08 for ; Fri, 18 Nov 2005 18:38:14 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id DF4A0DBAEF for ; Fri, 18 Nov 2005 14:38:10 -0400 (AST) Received: (qmail 21396 invoked by uid 1112); 18 Nov 2005 18:41:01 -0000 Date: Fri, 18 Nov 2005 13:41:01 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: pedro farinha cc: pgsql-jdbc@postgresql.org Subject: Re: Again the JSCreator and Metadata issues In-Reply-To: <1132193745.6622.9.camel@localhost.localdomain> Message-ID: References: <1132193745.6622.9.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/114 X-Sequence-Number: 14212 On Thu, 17 Nov 2005, pedro farinha wrote: > I am testing the new JSC2 early access and I come across a old > problem....getResultMetaData null values (I think). In JSC 1 the driver > works fine but on this early access version it doesn't. I am posting > what I think is relevant of the trace. I am not sure if this is a issue > with the driver or the JSC it self so I am posting this into here as > well as into the EAfeedback program. > > java.lang.RuntimeException: java.sql.SQLException: Invalid column > display size. Cannot be less than zero > at > com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1299) I believe you have a variable length field in your table. Sun's CachedRowSet implementation examines the ResultSetMetaData and creates its own copy of it. The postgresql JDBC driver returns -1 for ResultSetMetaData.getColumnDisplaySize() meaning unknown for variable length fields, like say a column of type "text". Sun does not like this value and reports an error. In the past we've tried to ask Sun for some advice in this area and got nothing in response. Other than -1 the only other real defensible value for getColumnDisplaySize would probably be Integer.MAX_VALUE. We've been concerned that GUIs would try to actually use this provided value and they would blow up, but the only complaints we've heard are from people disliking the -1 value and this problem doesn't seem to be going away. I suggest we try returning Integer.MAX_VALUE for a while and see what complaints we get. Objections? Kris Jurka