Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YAt5D-0001q9-J8 for pgsql-jdbc@arkaria.postgresql.org; Tue, 13 Jan 2015 04:27:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YAt5D-0008Od-2a for pgsql-jdbc@arkaria.postgresql.org; Tue, 13 Jan 2015 04:27:59 +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 1YAt5C-0008N7-0n for pgsql-jdbc@postgresql.org; Tue, 13 Jan 2015 04:27:58 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YAt58-0006NB-5u for pgsql-jdbc@postgresql.org; Tue, 13 Jan 2015 04:27:56 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 7B183105551A for ; Mon, 12 Jan 2015 20:27:52 -0800 (PST) Date: Mon, 12 Jan 2015 21:27:50 -0700 (MST) From: Vinayak To: pgsql-jdbc@postgresql.org Message-ID: <1421123270940-5833702.post@n5.nabble.com> In-Reply-To: References: <1420546864196-5833008.post@n5.nabble.com> <1421061400959-5833623.post@n5.nabble.com> Subject: Re: Problem with DATE MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.3 (/) 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 Hi Dave, The below example works fine using Oracle but in PostgreSQL it throws error for date type so we need to typecast that argument. Example: ps = conn.prepareStatement("SELECT ?, ?, ?,?"); ps.setObject(1, new String("1.2")); ps.setObject(2, new BigDecimal("1.2")); ps.setObject(3, new String("2014-01-11 33:22:11")); ps.setObject(4, Date.valueOf("2014-01-11")); I don't know whether to add PGDATE class is appropriate or not but if the above example works like Oracle in PostgreSQL then not necessary to change java code during migration from Oracle to PostgreSQL. Am I missing something? ----- Regards, Vinayak, -- View this message in context: http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833702.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc