pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
getObject and SMALLINT (JDBC)
4+ messages / 2 participants
[nested] [flat]

* getObject and SMALLINT (JDBC)
@ 1999-11-10 08:28 Wim Ceulemans <wim.ceulemans@nice.be>
  0 siblings, 0 replies; 4+ messages in thread

From: Wim Ceulemans @ 1999-11-10 08:28 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: [INTERFACES] getObject and SMALLINT (JDBC)
@ 1999-11-10 09:14 Peter Mount <petermount@it.maidstone.gov.uk>
  1999-11-10 12:19 ` Re: [INTERFACES] getObject and SMALLINT (JDBC) Wim Ceulemans <wim.ceulemans@nice.be>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Mount @ 1999-11-10 09:14 UTC (permalink / raw)
  To: 'Wim Ceulemans' <wim.ceulemans@nice.be>; pgsql-interfaces

It's probably been like that since day one. I'll check the specs.

Peter

> -----Original Message-----
> From:	Wim Ceulemans [SMTP:wim.ceulemans@nice.be]
> Sent:	10 November 1999 08:29
> To:	pgsql-interfaces@postgreSQL.org
> Subject:	[INTERFACES] getObject and SMALLINT (JDBC)
> 
> 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
> 
> ************



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] getObject and SMALLINT (JDBC)
  1999-11-10 09:14 RE: [INTERFACES] getObject and SMALLINT (JDBC) Peter Mount <petermount@it.maidstone.gov.uk>
@ 1999-11-10 12:19 ` Wim Ceulemans <wim.ceulemans@nice.be>
  0 siblings, 0 replies; 4+ messages in thread

From: Wim Ceulemans @ 1999-11-10 12:19 UTC (permalink / raw)
  To: pgsql-interfaces



Peter Mount wrote:
> 
> It's probably been like that since day one. I'll check the specs.
> 
> Peter
> 

I don't know it's a spec, but the recommendation I have read is in "JDBC
Database Access with Java" - Graham Hamilton - Rick Catell - Maydene
Fisher (The Java Series from the Source) on page 384, and it says:

"The recommended Java mapping for the JDBC SMALLINT type is a Java
short."



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: [INTERFACES] getObject and SMALLINT (JDBC)
@ 1999-11-10 13:07 Peter Mount <petermount@it.maidstone.gov.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Mount @ 1999-11-10 13:07 UTC (permalink / raw)
  To: 'Wim Ceulemans' <wim.ceulemans@nice.be>; pgsql-interfaces

I do know that some books have got things wrong (usually typing mistakes
etc).

Anyhow, in the end, the JDBC specification is what counts.

Peter

> -----Original Message-----
> From:	Wim Ceulemans [SMTP:wim.ceulemans@nice.be]
> Sent:	10 November 1999 12:20
> To:	pgsql-interfaces@postgreSQL.org
> Subject:	Re: [INTERFACES] getObject and SMALLINT (JDBC)
> 
> 
> 
> Peter Mount wrote:
> > 
> > It's probably been like that since day one. I'll check the specs.
> > 
> > Peter
> > 
> 
> I don't know it's a spec, but the recommendation I have read is in
> "JDBC
> Database Access with Java" - Graham Hamilton - Rick Catell - Maydene
> Fisher (The Java Series from the Source) on page 384, and it says:
> 
> "The recommended Java mapping for the JDBC SMALLINT type is a Java
> short."
> 
> ************



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-11-10 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-10 08:28 getObject and SMALLINT (JDBC) Wim Ceulemans <wim.ceulemans@nice.be>
1999-11-10 09:14 RE: [INTERFACES] getObject and SMALLINT (JDBC) Peter Mount <petermount@it.maidstone.gov.uk>
1999-11-10 12:19 ` Wim Ceulemans <wim.ceulemans@nice.be>
1999-11-10 13:07 RE: [INTERFACES] getObject and SMALLINT (JDBC) Peter Mount <petermount@it.maidstone.gov.uk>

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