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

getObject and SMALLINT (JDBC)

From: Wim Ceulemans <wim(dot)ceulemans(at)nice(dot)be>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: getObject and SMALLINT (JDBC)
Date: 1999-11-10 08:28:56
Message-ID: 38292CC8.F96A6BA8@nice.be (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi

I noticed that all jdbc drivers return the Integer java type for a
SMALLINT database type. Is this intended or is this a bug? The
recommendation in the JDBC book (Hamiltan, Catell, Fisher) says that
SMALLINT should be mappped to the Java short type.

If I want to changes this, is all I have to do is change the line in
/src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java from

case Types.SMALLINT
	return new Integer(getInt(columnIndex)
to

case Types.SMALLINT
	return new Short(getShort(columnIndex)
?

Regards

Wim Ceulemans
Nice bvba www.nice.be
Eglegemweg 3, 2811 Hombeek Belgium
Tel 0032-15-412953 Fax 0032-15-412954

pgsql-interfaces by date

Next:From: Peter MountDate: 1999-11-10 09:14:14
Subject: RE: [INTERFACES] getObject and SMALLINT (JDBC)
Previous:From: Constantin TeodorescuDate: 1999-11-10 07:16:00
Subject: Re: pgaccess on Windows NT

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