Re: Throwing NumberFormat exception for preparedStatement.setObjcet()

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Srinivas Gunnam <srinivas_gunnam(at)persistent(dot)co(dot)in>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Throwing NumberFormat exception for preparedStatement.setObjcet()
Date: 2010-01-12 11:45:17
Message-ID: 491f66a51001120345o78aa2597n3c9f7f281a57baed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, Jan 12, 2010 at 12:40 AM, Srinivas Gunnam
<srinivas_gunnam(at)persistent(dot)co(dot)in> wrote:
>
>
> Thanks for your reply.
> Here columnType value is 3 and inputdata value is always string type.

If I were writing it I would use java.sql.Types.Integer as the
columnType, not the numeric value. And inputData should be an Integer.

Dave

> -----Original Message-----
> From: davecramer(at)gmail(dot)com [mailto:davecramer(at)gmail(dot)com] On Behalf Of Dave Cramer
> Sent: Tuesday, January 12, 2010 1:45 AM
> To: Srinivas Gunnam
> Cc: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] Throwing NumberFormat exception for preparedStatement.setObjcet()
>
> On Mon, Jan 11, 2010 at 7:58 AM, Srinivas Gunnam
> <srinivas_gunnam(at)persistent(dot)co(dot)in> wrote:
>> Hi,
>>
>> In our application we are using the Postgres Sql 8.3.3 and jdbc driver is
>> postgresql-8.0-310.jdbc3.
>
>
> Do you mean 8.0-310 ? if so why not use a more recent driver ?
>
>>
>>
>>
>> When I am trying to set the value for id(int) like as follows throwing
>> exception.
>>
>> ps.setObject(1, inputData,columntype);
>>
>> where inputdate value is 2
>
> what is the columnType value ?
>
> Dave
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-01-13 22:36:52 Re: Throwing NumberFormat exception for preparedStatement.setObjcet()
Previous Message Srinivas Gunnam 2010-01-12 05:40:33 Re: Throwing NumberFormat exception for preparedStatement.setObjcet()