Share:

PREVIOUS  |  NEXT

Call a Stored Procedure

Quick Links


Notice: We are currently working to improve this content. Once revisions are finalized, we will add the article to the Recently Updated Articles section on the product's Documentation Home page. Learn more.


Define Datasource


To define your datasource, go to Setup > System Settings > Organization Settings and select the Custom Parameters tab: 

Parameter NameExample
datasource.ACME.usernamejohn_smith
datasource.ACME.passwordpassword
datasource.ACME.jdbcInterceptors org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer
datasource.ACME.driverClassNameoracle.jdbc.OracleDriver
datasource.ACME.urljdbc:oracle:thin:@192.168.150.38:1521:testDatabase


Connect to Datasource

def db = resp.dbConnect('yourDatasource');  


Call Stored Procedure

def sp = db.createStoreProcedure("test_procedure_2");
sp.addInParameter("input1", 'numeric');
sp.addInParameter("input2", 'varchar');

Map <String, String> inParams = new HashMap();
inParams.put("input1", 5);
inParams.put("input2", 'abcd');

def result = db.execute(sp, inParams);



Related Articles