Re: date value not geting inserted properly

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: "Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: date value not geting inserted properly
Date: 2006-06-07 13:52:59
Message-ID: 8626C1B7EB748940BCDD7596134632BE398688@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

yes that is an Object type.
i figued out the problem,
the value was something like "yyyymmdd"
so i needed to convert it to a date type and then do a setObject.

thanks,
regards
Surabhi

________________________________

From: Oliver Jowett [mailto:oliver(at)opencloud(dot)com]
Sent: Wed 6/7/2006 6:00 PM
To: surabhi.ahuja
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] date value not geting inserted properly

***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********

surabhi.ahuja wrote:

> stmt.setObject(i + 1, (tagV.value),
> ((TypeAttrib) (primaryKeyMap_.get(tMap.get(temp)))).dataType);
>
> can u please tell as to what should the dataType be for date, isnt it
> 91- integer?

java.sql.Types.DATE is 91, which should be correct if you're inserting a
bare date (with no time part).

What is the type and value of the "tagV.value" object?

What driver version and server version are you using?

What is the query you are executing?

Can you provide a selfcontained testcase showing the problem? You
haven't really given us enough info to go on here.

-O

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-06-07 13:59:41 Re: composite data type question
Previous Message Greg 2006-06-07 13:35:35 Can PostGreSQL slow down a Windows PC much?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Chris 2006-06-08 02:35:59 Re: date value not geting inserted properly
Previous Message Jan de Visser 2006-06-07 12:42:20 Re: PostgreSQL XA & EJB container