Re: resultset.first() untrappable error

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "kevin" <kevin(at)mtel(dot)co(dot)uk>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: resultset.first() untrappable error
Date: 2003-08-16 13:19:36
Message-ID: NEBBLAAHGLEEPCGOBHDGEEDIIAAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


By "bombing", do you mean no error message at all? What behavior lets you
know that it has failed? Especially if the code once worked and wasn't
changed when it started failing, we'll need a description of what you're
seeing (or not seeing) when it fails.

-Nick

> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of kevin
> Sent: Friday, August 15, 2003 9:12 AM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] resultset.first() untrappable error
>
>
> the following code frag has recently started bombing in a bean. It
> produces no trappable error I can see (SQLException, Exception,
> RuntimeException all fail) and is bombing at the ResultSet.first()
> function call. Its using redhat 7.3 postgres jdbc pg73b1jdbcX jars.
> The db is 7.3.2. jdk is sun
> hotspot 1.41-b21. The sql works in a file with hard coded customer id.
>
> query = "SELECT TO_CHAR(break,'MI9999990D99') as value," +
> " TO_CHAR(discount,'MI9999990D99') " +
> " FROM customer " +
> " WHERE id='" + custid + "'" +
> " AND discount > 0 " +
> " UNION " +
> "SELECT TO_CHAR(value,'MI9999990D99')," +
> " TO_CHAR(discount,'MI9999990D99') " +
> " FROM discountbyvalue " +
> " WHERE account='" + custid + "' " +
> " ORDER BY value";
>
> results = stmt.executeQuery(query);
>
> // only output discounts if there are some */
> if( ! results.first() ){
> results.close();
> stmt.close();
> return "";
> }
>
> Anybody got an idea why?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2003-08-16 20:54:56 Re: Bug #926: if old postgresql.jar in CLASSPATH, ant fails
Previous Message Oliver Jowett 2003-08-16 05:33:16 patch: fix a couple of server-prepared-statement bugs