pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Todd Shoemaker <jtshoe11@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Default numeric scale of zero in JDBC?
Date: Thu, 18 Jan 2007 21:54:36 +0000
Message-ID: <45AFEC9C.7080102@opencloud.com> (raw)
In-Reply-To: <20070118170551.88504.qmail@web53608.mail.yahoo.com>
References: <20070118170551.88504.qmail@web53608.mail.yahoo.com>

Todd Shoemaker wrote:
> Hello,
> 
> I downloaded the jdbc source and noted that if I specified a default scale of 4 in AbstractJdbc2ResultSetMetadata.getScale() (if the column is numeric and the scale is -1), I received the desired results.  I further updated the code to provide a private DEFAULT_NUMERIC_PRECISION that defaults to 4, which can be overridden with the System property org.postgresql.jdbc2.DEFAULT_NUMERIC_SCALE.  I built this and tested it within Squirrel SQL and it works properly, and the system property is working to override this default.  Would this be an update that the jdbc driver developers would be interested in?
> 
> I suppose my other question is, what do other JDBC drivers default this to?  Also, does this imply that others do not use non-integer arithmetic with sql through JDBC?

Given that the reported metadata scale does not affect what the driver 
does at all, and all the computation is done on the server side, I'd say 
that any rounding that is happening is happening in whatever is using 
the driver's metadata ("Squirrel SQL?")

-O



view thread (3+ messages)

Message-ID: <45AFEC9C.7080102@opencloud.com>
Permalink:  ../45AFEC9C.7080102@opencloud.com/
Also on:    postgresql.org/message-id/45AFEC9C.7080102@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, jtshoe11@yahoo.com
  Subject: Re: Default numeric scale of zero in JDBC?
  In-Reply-To: <45AFEC9C.7080102@opencloud.com>
  References: <20070118170551.88504.qmail@web53608.mail.yahoo.com> <45AFEC9C.7080102@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox