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 » Using Passthru Inside Java Plug in Node

Post new topic  Reply to topic
 Using Passthru Inside Java Plug in Node « View previous topic :: View next topic » 
Author Message
Fady
PostPosted: Tue Jan 21, 2003 11:37 pm    Post subject: Using Passthru Inside Java Plug in Node Reply with quote

Novice

Joined: 15 Jan 2003
Posts: 15
Location: Egypt , KSA

Hello :

I made a java Plugin Node that call a java class, and in this Java class i need to insert record in DB2 Database
so i wrote the following
String StrAdd = "PASSTHRU('INSERT INTO Trans(Type,NOTrials) values (?, ?)',Inputroot.XML.data.action,'1')";
MbSQLStatement sqls=createSQLStatement("Trans",StrAdd,MbSQLStatement.SQL_TRANSACTION_AUTO);
sqls.execute(assembly);

I needed the field Action in the XML message to be a parameter in the insert statment
when i put message in the queue with some value in the field action
what is recorded in the DB2 is somthing else the Character {-} only

my question is how to make an element in XML message paramater in the SQl statments
thank you
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lillo
PostPosted: Wed Jan 22, 2003 5:19 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Maybe inserting the parameter in your string.
Code:

String StrAdd = "INSERT INTO Trans(Type,NOTrials) values ('" + Inputroot.XML.data.action + "','1')";
MbSQLStatement sqls=createSQLStatement("Trans",StrAdd,MbSQLStatement.SQL_TRANSACTION_AUTO);
sqls.execute(assembly);


Cheers,
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
Fady
PostPosted: Wed Jan 22, 2003 6:11 am    Post subject: Java compiler error Reply with quote

Novice

Joined: 15 Jan 2003
Posts: 15
Location: Egypt , KSA

Java compiler didn't recognize Inputroot.XML.data.action
passthru should has the syntax as it will be excuted thru the database server

it's not working
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lillo
PostPosted: Wed Jan 22, 2003 6:35 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Sorry I forgot the parameter. Use the following code

Code:
String action = contact admin.getMessage().getRootElement().getFirstElementByPath("./data/action");
String StrAdd = "INSERT INTO Trans(Type,NOTrials) values ('" + action + "','1')";
MbSQLStatement sqls=createSQLStatement("Trans",StrAdd,MbSQLStatement.SQL_TRANSACTION_AUTO);
sqls.execute(assembly);

_________________
Lillo
IBM Certified Specialist - WebSphere MQ
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 » Using Passthru Inside Java Plug in Node
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.