Forum Discussion
nmrao
10 years agoCommunity Hero
Is it that you the sql query is different for different data base type which is why you kept different groovy script step for each?
First, I would suggest to use single groovy to handle all.
Use map to get different details such class name / connection string / query etc for each db type.
Coming to your main question, you can read xml in the groovy to get the respective value using XmlSlurper which is very easy. Please see an example below
http://mrhaki.blogspot.in/2009/10/groovy-goodness-reading-xml.html
First, I would suggest to use single groovy to handle all.
Use map to get different details such class name / connection string / query etc for each db type.
Coming to your main question, you can read xml in the groovy to get the respective value using XmlSlurper which is very easy. Please see an example below
http://mrhaki.blogspot.in/2009/10/groovy-goodness-reading-xml.html