Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group