pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Franco Bruno Borghesi <franco@akyasociados.com.ar>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Question
Date: Sat, 13 Nov 2004 12:04:52 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0411131201340.26@leary.csoft.net> (raw)
In-Reply-To: <41963B7A.8080900@akyasociados.com.ar>
References: <41963B7A.8080900@akyasociados.com.ar>



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



view thread (17+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0411131201340.26@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0411131201340.26@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0411131201340.26@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, franco@akyasociados.com.ar
  Subject: Re: Question
  In-Reply-To: <Pine.BSO.4.56.0411131201340.26@leary.csoft.net>
  References: <41963B7A.8080900@akyasociados.com.ar> <Pine.BSO.4.56.0411131201340.26@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox