db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik" <Dag.Wan...@Sun.COM>
Subject Re: [jira] Created: (DERBY-447) getBoolean() throws data conversion exception for DECIMAL type in J2ME/CDC/Foundation
Date Fri, 08 Jul 2005 15:36:10 GMT

Hi,

Out of curiosity I checked the DatabaseMetaData on the topic of
conversion and I found that supportsConvert() returns true, but still
returns false for all combination of types,
e.g. supportsConvert(java.sql.Types.DECIMAL, java.sql.Types.BOOLEAN);
viz. the code in the embedded driver:

    public boolean supportsConvert() {
	return true;
    }

    public boolean supportsConvert(int fromType, int toType) {
    /*
     * at the moment we don't support CONVERT at all, so we take the easy
     * way out.  Eventually we need to figure out how to handle this
     * cleanly.
     */
     return false;

JDBC 3.0 section 14.2.3.1 "Data Type Conversions" says this method
should return true if the driver supports the respective getter method
on the result set.

The Javadoc for the method *only* talks about the CONVERT function
(JDBC 3.0 App C.5), though, and since we don't implement that yet (?),
I guess that's the reason we return false above.

I suppose there are three issues here:
a) We don't yet support CONVERT (improvement?)
b) We do support conversion on getter methods for result sets, but
   the "supportsConvert" doesn't reflect that (bug?)
c) supportsConvert() (with no args) returns true (not true!) (bug?)

I could not find any JIRA issue on any of these, nor the did I find
anything about it in the docs.

It may seem we need to implement explicit CONVERT *or* drop getter
method conversion (for those conversions we do support) to be in
compliance? Comments?

Dag




>>>>> "DR(" == Deepa Remesh (JIRA) <derby-dev@db.apache.org> wrote:
DR(> 
DR(> getBoolean() throws data conversion exception for DECIMAL type in J2ME/CDC/Foundation
DR(> -------------------------------------------------------------------------------------
DR(> 
DR(>          Key: DERBY-447
DR(>          URL: http://issues.apache.org/jira/browse/DERBY-447
DR(>      Project: Derby
DR(>         Type: Bug
DR(>   Components: JDBC  
DR(>     Reporter: Deepa Remesh
DR(>  Assigned to: Deepa Remesh 
DR(> 
DR(> 
DR(> The call to the ResultSet method getBoolean() for a DECIMAL value throws data conversion
exception with J2ME/CDC/Foundation. The class BigIntegerDecimal, which is used for DECIMAL
support in J2ME/CDC/Foundation, does not override the getBoolean() method from the class DataType.
The getBoolean() method in DataType simply throws a data conversion exception.
DR(> 
DR(> -- 
DR(> This message is automatically generated by JIRA.
DR(> -
DR(> If you think it was sent incorrectly contact one of the administrators:
DR(>    http://issues.apache.org/jira/secure/Administrators.jspa
DR(> -
DR(> For more information on JIRA, see:
DR(>    http://www.atlassian.com/software/jira
DR(> 
-- 
Dag H. Wanvik
Sun Microsystems, Web Services, Database Technology Group
Haakon VII gt. 7b, N-7485 Trondheim, Norway
Tel: x43496/+47 73842196, Fax:  +47 73842101

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply email and destroy all copies of the original
message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Mime
View raw message