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 AF31A5644E for ; Mon, 7 Mar 2005 19:19:47 +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 78050-03 for ; Mon, 7 Mar 2005 19:19:38 +0000 (GMT) Received: from mail.liquidcore.com (mail.liquidcore.net [68.17.96.60]) by svr1.postgresql.org (Postfix) with ESMTP id 8A1F356448 for ; Mon, 7 Mar 2005 19:19:34 +0000 (GMT) Received: (from root@localhost) by mail.liquidcore.com (8.13.1/8.12.10) id j27JJlJ3030250 for pgsql-jdbc@postgresql.org; Mon, 7 Mar 2005 13:19:47 -0600 Received: from ppasala3 (ppasala.nqadmin.com [192.168.0.7]) by mail.liquidcore.com (8.13.1/8.12.10) with SMTP id j27JJjVM030207 for ; Mon, 7 Mar 2005 13:19:46 -0600 From: "Prasanth" To: Subject: Re: java.sql.date insert as null Date: Mon, 7 Mar 2005 13:20:49 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: <422CA65C.7050303@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal X-scanner: scanned for malicious content X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/53 X-Sequence-Number: 12446 Remove the quotes on either side when inserting null value. -Prasanth. -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Mican Bican Sent: Monday, March 07, 2005 1:07 PM To: pgsql-jdbc@postgresql.org Subject: [JDBC] java.sql.date insert as null Hello, How can I store a java.sql.date as null in database. The problem is (pseudecode): .... java.sql.Date date = null; .... Customer cust = new Customer(id); cust.setSqlDate(date); ..insert into Customer (id..,date,...) values(... ...." ' "+in.getSqlDate()+" ' "..... ...) then the exception java.sql.SQLException: ERROR: invalid input syntax for type date: "null" ........ when I select a row with empty date and system.out.print, it gives me a null.. but why I can't store it as null I use jdbc3, postgresql 8.0.1 and java 5 (tiger) on windows thank you best regards Mican Bican ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)