Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [JDBC] TypeInfoCache

From: Daniel Migowski <dmigowski(at)ikoffice.de>
Date: Wed Dec 19 2007 - 10:50:32 EST
Daniel Migowski schrieb:
Gregory Stark schrieb:
"Daniel Migowski" <dmigowski@ikoffice.de> writes:
 
Hello dear developers,

I just updated the TypeInfoCache to return LONGVARCHAR for the PostgreSQL Type
text. Currently VARCHAR(0) is returned, which seems not correct in my eyes, and
confuses some major software packets like Chrystal Reports.
   

Why?
Because VARCHAR (in my understanding) has some limit, like 256 or 50 or even 8192, whatever. LONGVARCHAR is unlimited as I understand and much better matches what i understood what "text" is for. While looking at the JDBC specification "JSR-000221 JDBC 4.0 Final Release Evaluation", they didn't make a clear statement on this, but AFAIK varchar always carries a length with it. "text" does not, so its a LONGVARCHAR. It doesn't matters, because all functions to get the data are equally defined for both datatypes (spec page 199, table B-6).

At all, the driver returns a length of -1 for the "text" type, since its no varchar type, and software using the metadata might expect to get something >0 for the length of a VARCHAR, like defined in the SQL spec (don't know the page there, but the postgresql handbook says, varchar without a parameter is a postgres extension).

With best regards,
Daniel Migowski
See http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html, Chapter 8.9.7, how others map a very large text type. The biggest they support as varchar is 8.000 chars (MS SQL Server). Everything over that is LONGVARCHAR (and "text" in postgres is up to 1GB).

With best regards,
Daniel Migowski

--
 |¯¯|¯¯|    
IKOffice GmbH             Daniel Migowski
 |  |  |/|                            Mail: 
dmigowski@ikoffice.de
 |  | // |  Nordstr. 10               Tel.: +49 (441) 21 98 89 52
 |  | \\ |  26135 Oldenburg           Fax.: +49 (441) 21 98 89 55
 |__|__|\|  
http://www.ikoffice.de    Mob.: +49 (176) 22 31 20 76
 
            Geschäftsführer: Ingo Kuhlmann, Daniel Migowski
            Amtsgericht Oldenburg, HRB 201467
            Steuernummer: 64/211/01864
Received on Wed Dec 19 10:47:56 2007

This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:41:43 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library