Author |
Message
|
cvag |
Posted: Sat Jun 20, 2009 3:32 am Post subject: Calling stored proc. in java compute node |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi,
Can anybody pls help out in calling the stored procedure in java compute node.
Thanks in Advance |
|
Back to top |
|
 |
mymq |
Posted: Sat Jun 20, 2009 6:04 pm Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
U can call the below JAVA method as below:
CALL retrieveLDAPAttr(LdapRef,EnvRef,ErrorMsg) into RetCode;
JAVA Method definition:
CREATE PROCEDURE retrieveLDAPAttr(IN LdpRef REFERENCE,INOUT EnvRef REFERENCE,OUT ErrorMsg CHAR)
RETURNS INT
LANGUAGE JAVA
EXTERNAL NAME
"com.michelin.eai.utils.JAVACLASS.JAVAMETHOD"; _________________ --SRK-- |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Jun 21, 2009 7:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm not sure that giving code to call a Java procedure that is very company and site specific from ESQL is a good answer for a question about how to use JDBC to call a database Stored Procedure from within Java.
CVAG - You can either use MbSqlStatement to call your Stored Procedure or standard JDBC. Presumably you are using Java because you are trained in Java and know it better than ESQL, otherwise you would just use the ESQL CALL statement. And being trained in Java means that you know how to use JDBC or know how to learn JDBC. |
|
Back to top |
|
 |
mymq |
Posted: Sun Jun 21, 2009 8:27 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
sorry. My mistake. Misunderstood it. _________________ --SRK-- |
|
Back to top |
|
 |
mymq |
Posted: Tue Jun 23, 2009 7:10 pm Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
cvag - did u find a solution on the same? _________________ --SRK-- |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Jun 23, 2009 10:48 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
its easy to do that in JCN
Use the below format.... (Tested Code)
private static final String STORED_PROC_CALL = "PASSTHRU('CALL GAYATHRI()')";
MbSQLStatement statement = createSQLStatement (dataSourceName, STORED_PROC_CALL, MbSQLStatement.SQL_TRANSACTION_AUTO);.
comply with what Jeff pointed out _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
mymq |
Posted: Thu Jun 25, 2009 8:21 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
Thankx Gaya3 (Mr.Arun) _________________ --SRK-- |
|
Back to top |
|
 |
|