Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Metadata in 3.0

2 posts in JConnect version 3.0 Last posting was on 1999-01-19 19:25:17.0Z
Nilesh Vaidya Posted on 1999-01-19 18:44:56.0Z
Message-ID: <36A4D2A8.8A3CC6B1@caribsurf.com>
Date: Tue, 19 Jan 1999 14:44:56 -0400
From: Nilesh Vaidya <nvaidya@caribsurf.com>
X-Mailer: Mozilla 4.06 [en] (WinNT; I)
MIME-Version: 1.0
Subject: Metadata in 3.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jconnect30
Lines: 11
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jconnect30:332
Article PK: 255725

I am using "Metadata".getColumnType(index) to get the column type. I
compare the type returned to java.sql.Types.XXX to create a Object of
that particular type.
The problem that I am facing is that when I retrieve a column of type
'float' from the database the metadata object returned by the result set
interpretes the column as a Double and an object of type Double is
created. Is this a bug??

Thanks


Kevin J. Grittner Posted on 1999-01-19 19:25:17.0Z
Message-ID: <36A4DC1C.74EC1664@chorus.net>
Date: Tue, 19 Jan 1999 13:25:17 -0600
From: "Kevin J. Grittner" <kjgrittn@chorus.net>
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en-US,en,en-GB
MIME-Version: 1.0
Subject: Re: Metadata in 3.0
References: <36A4D2A8.8A3CC6B1@caribsurf.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jconnect30
Lines: 30
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jconnect30:331
Article PK: 254609

The following is the mapping of SQL92 standard data types to JDBC datatypes,
from the Sun JDBC specification. (Keep in mind that ASE doesn't support the
DATE, TIME, TIMESTAMP datatypes in a SQL92 compliant manner.) Notice the
mappings for the various floating point datatypes...

CHAR - String
VARCHAR - String
LONGVARCHAR - String
NUMERIC - java.math.BigDecimal
DECIMAL - java.math.BigDecimal
BIT - boolean
TINYINT - byte
SMALLINT - short
INTEGER - int
BIGINT - long
REAL - float
FLOAT - double
DOUBLE - double
BINARY - byte[]
VARBINARY - byte[]
LONGVARBINARY - byte[]
DATE - java.sql.Date
TIME - java.sql.Time
TIMESTAMP - java.sql.Timestamp

Nilesh Vaidya wrote:

> I am using "Metadata".getColumnType(index) to get the column type. I
> compare the type returned to java.sql.Types.XXX to create a Object of
> that particular type.
> The problem that I am facing is that when I retrieve a column of type
> 'float' from the database the metadata object returned by the result set
> interpretes the column as a Double and an object of type Double is
> created. Is this a bug??
>
> Thanks