|
On Feb 9, 2017, at 2:54 PM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:
A String inherits from Object, so I'd try creating stringJ and then doing:
objectJ = stringJ;
-----Original Message-----
From: Don Brown [mailto:DBrown@xxxxxxxxxx]
Sent: Wednesday, February 08, 2017 4:13 PM
To: Java Programming on and around the IBM i <java400-l@xxxxxxxxxxxx>; rpg400-l@xxxxxxxxxxxx; Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Difference between java object and java string
To those who subscribe to all the xxxxxxx-l mailing lists this question has been cross posted.
I have been slowly but to this point successfully working my way through using a java API provided by the external party to retrieve a list of transactions.
Now I am having a problem and most likely it is my lack of java that is causing it.
What from an ILE RPG perspective is the difference between the following variable's ?
D stringJ S O Class(*JAVA : 'java.lang.String')
D objectJ S O Class(*JAVA : 'java.lang.Object')
I have a requirement to pass a java.lang.Object to a procedure.
To create a java string I use the makeString procedure.
I can't seem to find a makeObject procedure.
This is the procedure I want to use ...
D getMap PR O CLASS(*JAVA : 'java.lang.Object' )
D EXTPROC(*JAVA : 'java.util.Map' :
D 'get' )
D arg0 O CLASS(*JAVA : 'java.lang.Object' )
D customJ S O Class(*JAVA : 'java.lang.String')
The parameter I need to pass is the name of a custom field that is returned in the transaction object so I am doing the following ...
customJ = makestring('test_custom_key_1'); stringJ = getMap( JavaMap : customJ );
When the program executes the getMap java blows up and generates a core dump.
Would appreciate any suggestions or comments to solve the issue as opposed to totally alternative options/solutions.
Thanks
Don Brown
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD
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.