Progress
Open Client
Developer’s Guide


Default Data-type Mapping For TEMP-TABLE Fields

The Java default data-type mapping for the individual fields of a TEMP-TABLE is different than for non-TEMP-TABLE parameters in order to conform to the JDBC standard. Table 5–3 shows the mappings.

Table 5–3: Default Data-type Mapping For TEMP-TABLE Fields  
Progress Data Type
Java Object Type
CHARACTER
String
COM-HANDLE
Long
DATE
java.sql.Date or
java.util.GregorianCalendar
DECIMAL
Java.math.BigDecimal
INTEGER
Integer
LOGICAL
Boolean
RAW
byte[]
RECID
Long
ROWID
byte[]
WIDGET-HANDLE
Long

There are two different Java data types listed for DATE. For an input TEMP-TABLE or TABLE HANDLE, you can supply either of the object types shown. For details about how input TEMP-TABLE data is supplied to the proxy, see the "Passing a TEMP-TABLE Or TABLE-HANDLE As an INPUT Parameter."

For output, your application calls an instance of java.sql.ResultSet to get the data of each TEMP-TABLE field or TABLE-HANDLE. There is both a getDate() method that returns a java.sql.Date and a getGregorianCalendar() method that returns a java.util.GregorianCalendar on this result set. There is also a getObject() method that when called returns a java.sql.Date. For more information, see the "Accessing TEMP-TABLE Or TABLE-HANDLE Parameters As Output" section.

getObject() can return either one of these object types. For output, there is both a that returns a java.sql.Date and a getGregorianCalendar() method that returns a java.util.GregorianCalendar. If getObject() is called, a java.sql.Date is returned.

When the getDataType() method that you use to get the value of a TEMP-TABLE field does not match the default Java data type of the field (Table 5–3), a valid conversion occurs as long as the getDataType() method corresponds to the Progress data type as shown in Table 5–4. Otherwise, an Exception is thrown with a message explaining that the conversion is not supported. For example, if the TEMP-TABLE field is defined as LOGICAL, you can use any of getString(), GetInt(), or GetBoolean() to retrieve the field value.

Table 5–4: Data Type Conversions For TEMP-TABLE Fields
Progress
Data Type
Valid Java Data Type Conversions
CHARACTER
java.lang.String getString()
COM-HANDLE
java.lang.String getString()
int getInt()
long getLong()
DATE
java.lang.String getString()
java.sql.Date getDate()
java.util.GregorianCalendar getGregorianCalendar()
DECIMAL
java.lang.String getString()
int getInt()
long getLong()
double getDouble()
java.math.BigDecimal getBigDecimal()
INTEGER
java.lang.String getString()
int getInt()
long getLong()
double getDouble()
java.math.BigDecimal getBigDecimal()
LOGICAL
java.lang.String getString()
int getInt()
boolean getBoolean()
RAW
byte[] getBytes()
RECID
java.lang.String getString()
int getInt()
long getLong()
ROWID
byte[] getBytes()
WIDGET-HANDLE
java.lang.String getString()
int getInt()
long getLong()


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095