Hello,
I’m trying to execute mutiples sql queries from groovy, but only the first query is executing, the rest never gives me any result,
here is my script
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.logging.Logger;
import org.bonitasoft.engine.bpm.process.ProcessInstance;
import com.mysql.jdbc.Driver;
Logger logger=Logger.getLogger(“org.bonitasoft”)
Sql sql = BonitaSql.newInstance(“jdbc:mysql://localhost:3306/projetbonita”, “root”, “”, new Driver());
Statement stm = sql.getConnection().createStatement();
for(String tech : technologie.split(“,”)){
ResultSet rs = stm.executeQuery("select * from technology where name like '"+ tech +"'");
int id = 0;
if(rs.next()){
id = rs.getInt(1);
}
logger.severe(id.toString());
}
only the first “id” is shown, the rest is always “0”.
I want to grab all the ids then perform a certain operation.
What am i doing wrong?