X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 39AAD3A4AB4 for ; Sat, 13 Nov 2004 17:04:27 +0000 (GMT) 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 17014-03 for ; Sat, 13 Nov 2004 17:04:19 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 947FE3A4AAD for ; Sat, 13 Nov 2004 17:04:18 +0000 (GMT) Received: (qmail 3542 invoked by uid 1112); 13 Nov 2004 17:04:52 -0000 Date: Sat, 13 Nov 2004 12:04:52 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Franco Bruno Borghesi Cc: pgsql-jdbc@postgresql.org Subject: Re: Question In-Reply-To: <41963B7A.8080900@akyasociados.com.ar> Message-ID: References: <41963B7A.8080900@akyasociados.com.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/109 X-Sequence-Number: 11531 On Sat, 13 Nov 2004, Franco Bruno Borghesi wrote: > Hi all. > > I've donwloaded pg80b1.308.jdbc3.jar from jdbc.postgresql.org and now my > calls to PreparedStatement.setObject(int, Object) are failing, when they > used to work with the previous driver version. > > The message I get is: "Cant infer the SQL type to use for an instance of > {0}. Use setObject() with an explicit Types value to specify the type to > use.". > > Calling setObject(int, Object, Types.xxxxx) works ok, but I need > setObject(int, Object). I've tryied setObject(int, Character) and > setObject(int, java.util.Date) and both fail with the same message. > Haven't tested other cases. setObject(int, Object) has a limited number of types that it knows about (and Character and java.util.Date aren't in them). Using String and java.sql.Date will work but you probably don't want to do that. Supposing we did add these two types to setObject's knowledge, what does java.util.Date map to? With java.sql.Date/Time/Timestamp you know what datatype you are really talking about. Kris Jurka