pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Muhammad Altaf <mmalik_altaf@yahoo.com>
To: jonykapil <jony.kapil@gmail.com>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Date: Tue, 15 May 2012 17:10:12 -0700 (PDT)
Message-ID: <1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com> (raw)
In-Reply-To: <1337085975761-5708766.post@n5.nabble.com>
References: <1333637920442-5620617.post@n5.nabble.com>
	<1333710841.58069.YahooMailNeo@web110406.mail.gq1.yahoo.com>
	<1333717349570-5622702.post@n5.nabble.com>
	<1337061122958-5708726.post@n5.nabble.com>
	<1337079586.90024.YahooMailNeo@web121302.mail.ne1.yahoo.com>
	<1337085975761-5708766.post@n5.nabble.com>

Use setTimestamp and no need to cast.

-- Altaf Malik


________________________________
 From: jonykapil <jony.kapil@gmail.com>
To: pgsql-jdbc@postgresql.org 
Sent: Tuesday, 15 May 2012 10:46 PM
Subject: [JDBC] Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
 
Hello Altaf,
      Thanks for your reply.
I changed my calling code as following.

*
objCstmt = objConn.prepareCall("{? = call SFBLPRDBILLDATA(?,?,?, cast(? as
timestamp without time zone),cast(? as timestamp without time zone),cast(?
as timestamp without time zone) )}");

objCstmt.registerOutParameter(1,Types.VARCHAR);
           objCstmt.setInt(2,iBillDay);
           objCstmt.setInt(3,iBillDay);
           objCstmt.setString(4,strBillFrequency);
           objCstmt.setDate(5,dtSysDate);
           objCstmt.registerOutParameter(6,Types.DATE);
           objCstmt.registerOutParameter(7,Types.DATE);
           objCstmt.execute();*


Exception thrown by Postgres is ::

*org.postgresql.util.PSQLException: ERROR: cannot cast type void to
timestamp without time zone  Position:84*

I am not able to understand why now it is taking registerOutParameter as
void.
Please help me out of this...

Thanks & regards
jony

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Issues-with-IN-OUT-parameters-for-Array-of-Objects-in-EDB-us...
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

view thread (10+ messages)

Message-ID: <1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com>
Permalink:  ../1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com/
Also on:    postgresql.org/message-id/1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mmalik_altaf@yahoo.com, jony.kapil@gmail.com
  Subject: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
  In-Reply-To: <1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com>
  References: <1333637920442-5620617.post@n5.nabble.com> <1333710841.58069.YahooMailNeo@web110406.mail.gq1.yahoo.com> <1333717349570-5622702.post@n5.nabble.com> <1337061122958-5708726.post@n5.nabble.com> <1337079586.90024.YahooMailNeo@web121302.mail.ne1.yahoo.com> <1337085975761-5708766.post@n5.nabble.com> <1337127012.43561.YahooMailNeo@web121302.mail.ne1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox