Re: Column is of type date but expression is of type text - Mailing list pgsql-jdbc

From list_usr@spacebox.net
Subject Re: Column is of type date but expression is of type text
Date
Msg-id 1e11c2271002191721hbce2124r189dbecebe78bcd@mail.gmail.com
Whole thread Raw
In response to Re: Column is of type date but expression is of type text  (Kris Jurka <books@ejurka.com>)
Responses Re: Column is of type date but expression is of type text  (list_usr@spacebox.net)
Re: Column is of type date but expression is of type text  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Re: version, good question - I have both postgresql-8.4-701.jdbc3.jar
and postgresql-8.4-701.jdbc4.jar in my Apache Tomcat 5.5 common/lib
directory.  Would that cause a problem?

I'm using PostgreSQL 8.4.  Java 1.6.

Your example code worked with both jdbc3 and jdbc4, but my code still
isn't working.

I thought it might have to do with the way I instantiate the date, but
I tried that in your example code and it worked fine:

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
birthdate.setTime(format.parse(request.getParameter("birthdate")).getTime());
// getParameter("birthdate") would return "1978-02-13" for example

In my app the PostgreSQL logs show the birthdate parameter as
"1978-02-13 -04:00:00", with the same code in your test program the
time is omitted.  Would that make a difference?


On Thu, Feb 18, 2010 at 5:11 PM, Kris Jurka <books@ejurka.com> wrote:
>
>
> On Thu, 18 Feb 2010, list_usr@spacebox.net wrote:
>
>> Here is the stored procedure in question:
>
> The attached testcase works fine for me.  What driver and server versions do
> you have?
>
>>
>> As an aside, how do most people name their IN parameters so as not to
>> have them conflict with actual column names?
>>
>
> Some people prefix them with v_ to indicate that they are variables.
>
> Kris Jurka

pgsql-jdbc by date:

Previous
From: Mr Miquel Jordana
Date:
Subject: auto savepoint in a transaction
Next
From: list_usr@spacebox.net
Date:
Subject: Re: Column is of type date but expression is of type text