Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0CD9A632AA4 for ; Thu, 29 Jul 2010 20:49:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 99856-01 for ; Thu, 29 Jul 2010 23:49:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id EC9AA6322DA for ; Thu, 29 Jul 2010 20:49:33 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id D640D28454; Thu, 29 Jul 2010 19:49:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=W1Iq/h1P7gxbUCNQwnHuA1//ytU=; b=N9LGIY EEEZevDNCRHwxS3bfC7CwSIfAgzHNa7UCnHmESf3wtUkOsSrH1oos8l/CoBMlYUY qk2FWa/43vGJiLlJSKalqR+8P8aNYQ+yKGeRv3YsFCbK4qsBSCV4C3MNhKGt57UO ZpDrWVkKMqKpoX8SIprfCan+PBOx+EtnkItrU= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id A6A952844D; Thu, 29 Jul 2010 19:49:31 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 6C37CA206; Thu, 29 Jul 2010 19:49:31 -0400 (EDT) Date: Thu, 29 Jul 2010 19:49:31 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Lloyd Parkes cc: pgsql-jdbc@postgresql.org Subject: Re: Integer is not a subclass of Short In-Reply-To: <1280446120.8031.14.camel@cafe-de-la-rue.ecs.vuw.ac.nz> Message-ID: References: <1280446120.8031.14.camel@cafe-de-la-rue.ecs.vuw.ac.nz> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/131 X-Sequence-Number: 20796 On Fri, 30 Jul 2010, Lloyd Parkes wrote: > I have found a problem with a discrepancy between getColumnClassName() > in jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java > and internalGetObject() in > jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java. > > The former is defined (indirectly) to return the fully qualified class > name of (a possible superclass of) the object returned by the latter. > For a smallint column, the former returns "java.lang.Short", but the > latter returns a java.lang.Integer. Short is neither Integer, nor a > superclass of Integer. According to my attached testcase getColumnClassName does return Integer. > I guess someone should add the line "return new > Short(getShort(columnIndex));" between lines 123 and 124 of rev 1.108 of > AbstractJdbc2ResultSet.java. There may be a similar problem with tinyint > columns, but I don't have any tinyint columns. The spec requires the return type for smallint to be Integer. See table B-3 of the JDBC4 spec. Kris Jurka