How to fetch data from custom external DB in bonita using groovy.
Following is the code snippet to fetch data list from external DB. Let say,we want to fetch data from MYSQL. 1) Make connection with MySQL 2) Make query and specify column 3) Make output string
Following is the code snippet to fetch data list from external DB. Let say,we want to fetch data from MYSQL. 1) Make connection with MySQL 2) Make query and specify column 3) Make output string
import groovy.sql.Sql; import com.mysql.jdbc.Driver; def result = [] Sql sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost: 3306/custdb","root","root", new com.mysql.jdbc.Driver()) sql.eachRow 'select * from table_name;', { result += it.col_name } sql.close() resultPlease let me know for any further clarifications.