Re: Aggregate function: Different results with jdbc and psql

From: Tilman Rassy <rassy(at)math(dot)TU-Berlin(dot)DE>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Aggregate function: Different results with jdbc and psql
Date: 2008-10-07 13:04:14
Message-ID: 200810071504.14293.rassy@math.tu-berlin.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tuesday 07 October 2008 14:48, Marc Mamin wrote:
> maybe you try to retrieve the value of grade with an inappropriate
> method ?

I use the getFoat Method. Here is the code:

// Query grade data:
float result = 0;
ResultSet gradeData = dbHelper.queryUserWorksheetGrade(userId, worksheetId);
if ( !gradeData.next() )
this.logDebug("### DEBUG 1 ### Result set empty");
else
{
result = gradeData.getFloat(DbColumn.GRADE);
if ( gradeData.wasNull() )
this.logDebug("### DEBUG 2 ### Column was SQL NULL");
}

In the logs I see: "### DEBUG 2 ### Column was SQL NULL"

In earlier tries, I experimented with different types for "result" (double,
String). I also casted on the SQL side to "double precision" before
multiplying und summing. No effect.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marc Mamin 2008-10-07 13:22:53 Re: Aggregate function: Different results with jdbc and psql
Previous Message Tilman Rassy 2008-10-07 12:53:32 Re: Aggregate function: Different results with jdbc and psql