Re: BAD INTEGER - Mailing list pgsql-jdbc

From Amit_Wadhwa@Dell.com
Subject Re: BAD INTEGER
Date
Msg-id D84C5C69F2723B43BD7AAFA63D4012BA64EF2F@blrx2kmbgl101.blr.amer.dell.com
Whole thread Raw
In response to BAD INTEGER  ("Wadhwa, Amit" <Amit_Wadhwa@Dell.com>)
List pgsql-jdbc
Hi
I got rid of the error using a subquery instead,
actually i had developed the whole app. using mysql, and the mysql jdbc
driver never gave me problems.
and im working on windows so i wasnt able to use postgre.
when the time came to port it to postgre (on the clients linux webhost)
i had problems.
so i finally after a lot of problems, managed to get postgre running for
windows in the cygwin shell after compilign the postgre src file.
And everything worked on the postgre on my system as far as the queries
were concerned. when i uploaded my files to the webhost and his tomcat
was restarted, i got these errors,
i put a out.print statement on every line, and finally caught at what
stage the error occured.
and that was when i emailed this forum after checking all the datatypes.
Never faced a problem like this, still dont know what the reason was,
specially since the data on the webhost, and the database is essentially
the same as on my system. (postgre 7.0.3)
and if it worked fine on my system, why would postgre (or the jdbc
driver/or tomcat) choke on a nested query block??
that too nested under a java block, not as a subquery. But well, it
seems to be working ok when i make it as a subquery.
i can send the old file in here tomorrow, as im at work currently, not
at home. Meanwhile if anyone has any pointers, or has faced this issue
before, do let me know.
Regards,
Amit

-----Original Message-----
From: Dave Cramer [mailto:Dave@micro-automation.net]
Sent: Tuesday, March 11, 2003 8:54 AM
To: Wadhwa, Amit
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] BAD INTEGER


Can you send us test code to demonstrate the problem

Dave
On Mon, 2003-03-10 at 15:19, Wadhwa, Amit wrote:
> Hi
> I have an application which is using an online shopping cart on
postgre,
> jsp, tomcat.
> here is how my query goes.
> select prodid, memname, prodqty, prodprice  FROM rdnprod something...
> while rs.next()
> {
> insert into rdnordertable(memname, prodid, qty, price, ordernumber)
> values ('memname', rs.getInt("prodid"), rs.getInt("prodqty"),
> rs.getInt("prodprice"), 'new order no.for every row inserted');
> }
> ..or something to that effect.
>
> now the problem im facing here is:
> if i have one product in the rdnprod table, it throws exception bad
integer
> in the first iteration
> if i have two products in the rdnprod table, it throws exception bad
integer
> in the second iteration
> if i have third product in the rdnprod table, it throws exception bad
> integer in the third iteration
>
> ive checked all datatypes returned by the previous query, they seem to
be
> perfect integers, except a bad integer which appears out of nowhere,
when i
> fire the same query on the database, it works fine!!
> im not doing any Integer.parseint or anything.
> and this happens only in the last record, WHATEVER IT MAYBE (and only
in the
> jdbc resultset, not in the database).
> Im baffled.
> please help.
> Regards,
> Amit
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Dave Cramer <Dave@micro-automation.net>



pgsql-jdbc by date:

Previous
From: Jeremiah Jahn
Date:
Subject: changes to error reporting questions
Next
From: Michel Néron
Date:
Subject: Need setFetchSize()