hi,
i've managed to read a value from the database and display it in a form field
i've use a java service task with the following class:
public class aicha implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Connection con;
Statement stmt;
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/activiti","root","a");
System.out.println ("Ok, connection to the DB worked.");
stmt = con.createStatement();
String queryString1 = " select FIRST_ from act_id_user ";
ResultSet rs = stmt.executeQuery(queryString1);
while (rs.next()) {
String name = rs.getString("FIRST_");
execution.setVariable("nom",name);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//String nom = (String) execution.getVariable("nom");
//conn();
//execution.setVariable("nom",conn());
}
}
where nom is the id of the form's field in the process diagram.but i still have ine issue
how can' i display a collection of items from the database (combo box ) .i've tried to use the type "enum" but no results!!!!!!!
thanks for any reply