|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using Passthru Inside Java Plug in Node |
« View previous topic :: View next topic » |
Author |
Message
|
Fady |
Posted: Tue Jan 21, 2003 11:37 pm Post subject: Using Passthru Inside Java Plug in Node |
|
|
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 |
|
 |
lillo |
Posted: Wed Jan 22, 2003 5:19 am Post subject: |
|
|
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 |
|
 |
Fady |
Posted: Wed Jan 22, 2003 6:11 am Post subject: Java compiler error |
|
|
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 |
|
 |
lillo |
Posted: Wed Jan 22, 2003 6:35 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|