how to batch insert

But the input data is a List how Can I use that in the query?

The “Collection” field is a List.
The “Input Data” is a String.
As you can see on the picture :
Picture

Oh I dont have these fields .I just have onle one field which accepts input lists

Apologies I had a bad day, but to fix your problem you have to be clear on what you want, so far we have given you everything but we still cannot seem to make it work. Yannick has done a wonderful job and he cannot see what is happening for your question to fail.

You do not even say what version on Bonita you are using, which would help, especially if you do not see the same things as Yannick has shown in pictures.

So far you have said.

I have a list and I want to insert the data in the list into a database…there are two ways to do this.

Via Connector which Yannick has shown you, or in code similar to (note you will have to change the code to suit your environment, this code is based on postgres, and is not tested…):

StringBuffer sb = new StringBuffer();
sb.append(“a,b,c,d,e”); //create temp string

List jobs = sb.toString().split(“,”);

//set basics for db
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String sql2 = null;
String dbTable = null;
String user = null;
String password = null;

String url = “jdbc:postgresql://”+dbHost+“:”+dbPort+“/”+dbDatabase);
try {
Class.forName(“org.postgresql.Driver”);
try {
con = DriverManager.getConnection(url, dbUser, dbPassword);

for (String job : jobs){

String templateSQL = “INSERT into dbTable (colName) values('”+job+“')”;

		pst = con.prepareStatement(templateSQL);
		rs = pst.executeQuery();

}
} catch (SQLException ex1) {
logger.severe(module+": Error (ex1): "+ex1.getMessage());

	} finally {
		try {
			if (rs != null) {
				rs.close();
			}
			if (pst != null) {
				pst.close();
			}
			if (con != null) {
				con.close();
			}
		} catch (ClassNotFoundException e) {
			if(debug){logger.info("After Load Class: ClassNotFoundException");}
		}