Issue Details (XML | Word | Printable)

Key: DERBY-452
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Deepa Remesh
Reporter: Deepa Remesh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Import/export fails for DECIMAL type in J2ME/Foundation

Created: 12/Jul/05 04:41 AM   Updated: 01/Dec/05 04:05 PM
Return to search
Component/s: Tools
Affects Version/s: 10.1.1.0, 10.2.1.6
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-452.diff 2005-07-14 10:27 AM Deepa Remesh 3 kB
File Licensed for inclusion in ASF works derby-452.status 2005-07-14 10:27 AM Deepa Remesh 0.4 kB
Text File Licensed for inclusion in ASF works derbyall_report_j2me.txt 2005-07-14 10:27 AM Deepa Remesh 205 kB
Environment: J2ME/CDC/Foundation using IBM's WCTME 5.7

Resolution Date: 30/Sep/05 02:19 AM


 Description  « Hide
Derby import/export tool has to be modified to work in J2ME/Foundation.

I tried running the testcase importExport.java and it fails with following exception:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Test importExport starting
testing non-existing data file
Data file not found: extinout/Z.dat
testing null data file
Data file cannot be null.
testing empty table
testing empty table with Delimited format
testing empty table import Field/Char Delimiters
PASS: setup complete
testing import/export with default options
FAIL: exception thrown:
ERROR 38000: The exception 'SQL Exception: An attempt was made to get a data value of type 'java.lang.Object' from a data value of type 'DECIMAL'.' was thrown while evaluating an expression.
ERROR 22005: An attempt was made to get a data value of type 'java.lang.Object' from a data value of type 'DECIMAL'.
Test importExport finished
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The exception is thrown because Derby system procedure for export calls getObject() on a DECIMAL type. This is not supported in J2ME/Foundation. Derby Embedded JSR 169 Functional Spec asks to use alternate JDBC getXXX and setXXX methods (like getString and setString) for DECIMAL type. I think the Derby import/export utility can be modified to call getString and setString for DECIMAL type when using J2ME/Foundation.







 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #219259 Fri Jul 15 23:11:37 UTC 2005 djd DERBY-452 - In J2ME/Foundation, getObject was throwing an exception because getObject on DECIMAL types is not supported.
I removed the call to getObject since it was a redundant check. getString internally checks for null values.

Patch contributed by Deepa Remesh dremesh@gmail.com
Files Changed
MODIFY /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
MODIFY /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties
MODIFY /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties
MODIFY /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ExportAbstract.java

Repository Revision Date User Message
ASF #265639 Thu Sep 01 03:38:45 UTC 2005 kmarsden DERBY-452 - In J2ME/Foundation, getObject was throwing an exception because getObject on DECIMAL types is not supported.
I removed the call to getObject since it was a redundant check. getString internally checks for null values.

Patch contributed by Deepa Remesh dremesh@gmail.com
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportAbstract.java