Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YDFvW-0005zH-Vi for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 Jan 2015 17:15:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YDFvW-0004DQ-EA for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 Jan 2015 17:15:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YDFvU-0004AT-T2 for pgsql-jdbc@postgresql.org; Mon, 19 Jan 2015 17:15:44 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YDFvQ-0004DW-0V for pgsql-jdbc@postgresql.org; Mon, 19 Jan 2015 17:15:43 +0000 Received: from [192.168.157.52] (unknown [65.19.243.151]) by outbound.vnet-inc.com (Postfix) with ESMTP id AC2857804; Mon, 19 Jan 2015 10:15:16 -0700 (MST) Message-ID: <54BD3D71.2070403@ttc-cmc.net> Date: Mon, 19 Jan 2015 10:22:57 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21 MIME-Version: 1.0 To: Vinayak , PostgreSQL JDBC Subject: Re: Problem with DATE References: <1421061400959-5833623.post@n5.nabble.com> <1421123270940-5833702.post@n5.nabble.com> <1421131374401-5833708.post@n5.nabble.com> <1421213697306-5833860.post@n5.nabble.com> <1421386506791-5834215.post@n5.nabble.com> <54B9433B.6070706@ttc-cmc.net> <1421671732288-5834546.post@n5.nabble.com> In-Reply-To: <1421671732288-5834546.post@n5.nabble.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Vinayak wrote: > Hi, > I tried to use setDate() instead of setObject() but still it gives the same > error. > Example: > ps = conn.prepareStatement("SELECT ?"); > java.sql.Date sqlDate1 = new java.sql.Date(new java.util.Date().getTime()); > ps.setDate(6, sqlDate1); That will not work has you said and is not the same code you demostrated. Use the Oracle TO_DATE('db_date_content', 'YYYY-MM-dd') to collect the correct formatted date string from the existing source database, oracleDateString = SELECT TO_DATE(SELECT dateField, 'YYYY-MM-dd') Use dateValue = java.sql.Date.valueOf(oracleDateString), and prepared_sqlStatement.setDate(i++, dateValue) to set the date in PostgreSQL database. danap. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc