ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » call a java method in esql

Post new topic  Reply to topic
 call a java method in esql « View previous topic :: View next topic » 
Author Message
sai kumar adduri
PostPosted: Wed Aug 21, 2013 11:11 pm    Post subject: call a java method in esql Reply with quote

Acolyte

Joined: 04 Apr 2013
Posts: 73

Hi all ,
I am trying to call a java method in esql , i am getting a class not found exception .
java method:
public static createMqmdHeaders(MbElement p_outRoot, int p_ccsid,
int p_encoding) throws MbException {

MbElement l_mqmd = p_outRoot.createElementAsFirstChild("MQHMD");
l_mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Version",
new Integer(2));
l_mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Format",
MQC.MQFMT_RF_HEADER_2);
l_mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Encoding",
p_encoding);
l_mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,
"CodedCharSetId", p_ccsid);
;

ESQL procedure:
CREATE PROCEDURE createMqmdHeaders(INOUT outRef REFERENCE,IN ccsid INTEGER ,IN encoding INTEGER )Returns BOOLEAN
LANGUAGE JAVA
EXTERNAL NAME "com.mss.MbMsgUtils.createMqmdHeaders";

Is it the correct way to use INOUT in the above procedure
Back to top
View user's profile Send private message
dogorsy
PostPosted: Thu Aug 22, 2013 12:30 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

you don't need to write a java program to do what you are doing.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Aug 22, 2013 12:40 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The OP might be trying to use Java simply because he/she has been told to use it instead of ESQL. Until they give a reason for this, you shouldn't be so dismissive.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
dogorsy
PostPosted: Thu Aug 22, 2013 12:45 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

smdavies99 wrote:
The OP might be trying to use Java simply because he/she has been told to use it instead of ESQL. Until they give a reason for this, you shouldn't be so dismissive.


Argumentative today, are we ?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Aug 22, 2013 1:13 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

not really. Just looking at the facts. your point is correct but you have no idea if it is relevant to the problem that the OP is trying to solve.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Simbu
PostPosted: Thu Aug 22, 2013 1:37 am    Post subject: Re: call a java method in esql Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

sai kumar adduri wrote:

java method:
public static createMqmdHeaders(MbElement p_outRoot, int p_ccsid,
int p_encoding) throws MbException

ESQL procedure:
CREATE PROCEDURE createMqmdHeaders(INOUT outRef REFERENCE,IN ccsid INTEGER ,IN encoding INTEGER )Returns BOOLEAN
LANGUAGE JAVA
EXTERNAL NAME "com.mss.MbMsgUtils.createMqmdHeaders";

Is it the correct way to use INOUT in the above procedure


Please do search in this forum. you will get answers
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Aug 22, 2013 1:55 am    Post subject: Re: call a java method in esql Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

Please use [code] tags when posting code; it's much easier to read.

sai kumar adduri wrote:
Is it the correct way to use INOUT in the above procedure

That is the correct way to use INOUT, but the ESQL procedure does not match the Java method signature (including the parameter types and the throws clause). The InfoCenter describes the requirements for Java routines in more detail. Java methods also require a return type.
Back to top
View user's profile Send private message
sai kumar adduri
PostPosted: Thu Aug 22, 2013 1:57 am    Post subject: Reply with quote

Acolyte

Joined: 04 Apr 2013
Posts: 73

Reason to use this is , to resuse the exisiting java code . All though it is a simple function , but I have methods which are complex .
Dont go by the functionality of the method , even I known that it can be implemented in esql .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » call a java method in esql
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.