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 |
Дата | |
Msg-id | 1e11c2271002192024p1d6d064fu8cca2494383bba4c@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Column is of type date but expression is of type text (list_usr@spacebox.net) |
Список | pgsql-jdbc |
Would the problem be that the timezone is included with the date passed in the stored procedure parameter? I don't understand why the timezone shows up in my J2EE app but not in the test code you sent. On Fri, Feb 19, 2010 at 8:21 PM, <list_usr@spacebox.net> wrote: > 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 по дате отправления: