One thing I noticed.

The AS/400 doesn't handle 63 digit numbers till v5r3.  The max digits for 
earlier versions is only 31.


HTH,

Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
 

> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx
> [mailto:java400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bruce Jin
> Sent: Wednesday, February 23, 2005 12:20 PM
> To: Java Programming on and around the iSeries / AS400
> Subject: com.ibm.as400.access.ExtendedIllegalArgumentException:
> numDigits (0)
> 
> 
> I use toolbox to retrieve column information from AS400 
> files. The code 
> is as follows:
> 
> DatabaseMetaData dbMeta = connection.getMetaData();
> resultSet = dbMeta.getColumns(null, “mylib”, “myfile”, null);
> while (resultSet.next()) {
> int size = resultSet.getInt("COLUMN_SIZE") ;
> }
> 
> This code works on many AS400 boxes. But it fails on one 
> particular file 
> on an AS400 (V5R1). See error message below. Looking into 
> source code of 
> AS400PackedDecimal class, I guess a ‘0’ is used as field length to 
> initiate the class, causing the exception. But this file is a valid 
> file. This file does have a number of packed fields. Note: 
> when I move 
> this file to another as400, the code will work with no problem.
> 
> TOOLBOX source code:
> 
> public AS400PackedDecimal(int numDigits, int numDecimalPositions) {
> 
> if (numDigits < 1 || numDigits > 63) {
> throw new ExtendedIllegalArgumentException("numDigits (" + 
> String.valueOf(numDigits) + ")", 
> ExtendedIllegalArgumentException.RANGE_NOT_VALID);
> }
> if (numDecimalPositions < 0 || numDecimalPositions > numDigits) {
> throw new ExtendedIllegalArgumentException("numDecimalPositions (" + 
> String.valueOf(numDecimalPositions) + ")", 
> ExtendedIllegalArgumentException.RANGE_NOT_VALID);
> }
> 
> 
> ERROR MESSAGE:
> 
> com.ibm.as400.access.ExtendedIllegalArgumentException: numDigits (0): 
> The parameter value is out of the allowed range.
> com.ibm.as400.access.AS400PackedDecimal.<init>(AS400PackedDeci
> mal.java:46)
> com.ibm.as400.access.SQLDecimal.<init>(SQLDecimal.java:58)
> com.ibm.as400.access.SQLDataFactory.newData(SQLDataFactory.java:612)
> com.ibm.as400.access.JDTypeInfoFieldMap.getValue(JDTypeInfoFie
> ldMap.java:59)
> com.ibm.as400.access.JDPrecisionFieldMap.getValue(JDPrecisionF
> ieldMap.java:52)
> com.ibm.as400.access.JDMappedRow.getSQLData(JDMappedRow.java:157)
> com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResu
> ltSet.java:3479)
> com.ibm.as400.access.AS400JDBCResultSet.getInt(AS400JDBCResult
> Set.java:2781)
> com.ibm.as400.access.AS400JDBCResultSet.getInt(AS400JDBCResult
> Set.java:2808)
> MRCPS.MRCWRKF.getColumns(MRCWRKF.java:284)
> 
> 
> Thanks.
> 
> 
> 
> -- 
> This is the Java Programming on and around the iSeries / 
> AS400 (JAVA400-L) mailing list
> To post a message email: JAVA400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.