|
Thanks Sarah and Joe. I think you suggestion of using string might work for me. I plan to try below to handle to column data conversion to RPG variable: In java class: - public String getColumn(int x) - public String getColumn(String columnName) In RPG service program: - Because RPG has build in functions that can easily convert a string into a float data type, date, time, or timeStamp, all I need is to create 5 different getColumnInXXXXX that call the jave getColumn method and convert string data into these 5 different types: 1) Float data (for numeric field) 2) Varying Length Charater field 3) Date 4) Time 5) TimeStamp - This way caller will only need to do this: ZoneField = getColumnInFloat(1) // RPG assign float data to a decimal field. DateField = getColumnInDate(2) TimeField = getColumnInDate(2) CharField = getColumnInDate(2) TimeStampField = getColumnInDate(2) - If data conversion field, the method will send an *escape message and caller will need to handle this error. Thanks for all your help -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Sarah Poger Gladstone Sent: Friday, December 30, 2005 1:22 PM To: Java Programming on and around the iSeries / AS400 Subject: Re: Generic java class that will allow RPG/RPGSQLE program toaccessnon-iSeries Data Joe- Perhaps an approach that combines your idea and mine. The getColumn() method returns an Object, then another program takes the object and calls the "instanceOf()" method to find out the actual class, then it fills in the data structure that you proposed. Then passes a pointer to the populated datastructure back. Using this combined approach, the "getColumn()" method doesn't have to deal with populating the datastructure. It would also simplify error handling. If the "instanceOf" method returns something that is not usable from RPG, then the Java program can throw/log an exception. -Sarah Poger Gladstone -- 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 mailing list archive is Copyright 1997-2024 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.