Re: Aggregate function: Different results with jdbc and psql - Mailing list pgsql-jdbc

From Tilman Rassy
Subject Re: Aggregate function: Different results with jdbc and psql
Date
Msg-id 200810071504.14293.rassy@math.tu-berlin.de
Whole thread Raw
In response to Re: Aggregate function: Different results with jdbc and psql  ("Marc Mamin" <M.Mamin@intershop.de>)
Responses Re: Aggregate function: Different results with jdbc and psql  ("Marc Mamin" <M.Mamin@intershop.de>)
List 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.

pgsql-jdbc by date:

Previous
From: "Marc Mamin"
Date:
Subject: Re: Aggregate function: Different results with jdbc and psql
Next
From: "Marc Mamin"
Date:
Subject: Re: Aggregate function: Different results with jdbc and psql