Consultor Eletrônico



Kbase 17703: Apptivity initQuerySet() throwing exception:java.lang.Double
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/29/1998
Apptivity initQuerySet() throwing exception:java.lang.Double

The following error is sometimes encountered when using Oracle with
Apptivity - initQuerySet() throwing exception:java.lang.Double

This casting problem is due to a discrepancy in the column
type returned by the various Oracle drivers for a NUMBER field.
If the field was created without indicating a length for the
NUMBER field as shown below:


CREATE TABLE CLIENT(
CLIENT_ID NUMBER NOT NULL,
CLIENT_NAME VARCHAR2(2000) NULL);

Then the various drivers report the following type
information:

ODBC version 2.0 reports the type as FLOAT(15,0)
ODBC version 2.5 reports the type as DECIMAL(15,0)
JDBC thin client report the type as (NUMERIC).

The problem is that the data type is recorded by the designer in the
the .qry file in the COLUMNTAG entries. The runtime uses this tag to
create the corresponding abColumn objects. When the query is
actually run, the resultset meta data is compared to the original
definitions and reports the "mismatch" message when the actual
query data does not match the original definitions. So long as
Oracles drivers give inconsistent information about the data types
for NUMERIC, we will continue to have this problem.

If you create the NUMBER field with a specific length as
follows:

CREATE TABLE CLIENT(
CLIENT_ID NUMBER( 15) NOT NULL,
CLIENT_NAME VARCHAR2(2000) NULL);

All the drivers will report the type as (NUMERIC) and there
will be no conflict between the runtime and design time types
and as a result no class cast exception.

It is important with ORACLE to make sure when a number field is
created, the length be specified, Otherwise, more than annoyance
can be created but actual exceptions will be thrown causing the
application to fail.

Another Possible work-around. Manually modify COLUMNTAG
the .qry file after the designer creates it to match the definitions
that the runtime driver will report. The problem with this is the
Apptivity Designer (Developer) constantly recreates the .qry file.


PES 07/29/98

Progress Software Technical Support Note # 17703