Fix getXXX methods when used with CHAR columns or columns with decimals

From: Kim Ho <kho(at)redhat(dot)com>
To: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Fix getXXX methods when used with CHAR columns or columns with decimals
Date: 2003-06-18 17:44:39
Message-ID: 1055958280.13891.40.camel@topanga.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Problem:
- Error parsing input in getByte() and getShort() if input has a decimal or whitespace (from CHAR columns)
- Error parsing CHAR columns in other getXXX methods.

Fix:
- Added trim() to getXXX methods
- In getByte() and getShort(), check the field type and take out the decimal and everything after it. Also check for CHAR and trim if necessary.

Cheers,

Kim

Attachment Content-Type Size
fixgetXXXmethods.diff text/plain 3.4 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kim Ho 2003-06-18 18:02:56 ToBoolean method return correct Boolean values as per JDBC spec
Previous Message Kim Ho 2003-06-18 17:09:12 Allow setObject(x,y,Types.BIT) if y is a Number & getObject() on bit columns

Browse pgsql-patches by date

  From Date Subject
Next Message Rod Taylor 2003-06-18 17:45:40 Re: Runtime.SGML diff ... please expedite!
Previous Message Kim Ho 2003-06-18 17:09:12 Allow setObject(x,y,Types.BIT) if y is a Number & getObject() on bit columns