Greetings,
I’m new on bonitasoft , and i only know SQL, nothing on java. my Select work fine, i did put my two queries in the same Step (Select in the Connector In, and insert connector out)
Select :
http://s24.postimg.org/y7xulpstx/select.png
def script ="" script = "SELECT
name1FROM
demo3"
Outpout operation:
http://s21.postimg.org/9tunljid3/name_List.png
resultSet Query:
`import java.sql.ResultSetMetaData;
List list = new ArrayList();
resultset.beforeFirst();
while (resultset.next()) {
list.add(resultset.getString(“name1”));
}
return list;`
Insert :
`def script = “”
script = “INSERT INTO demo3 (name1)” + “VALUES ('”+nameList+“');” `
the insert gives me value between brackets [john, gerard] with these two values , so in my database i get this
john
gerard
[john, gerard]
here is my engine log:
INFOS: THREAD_ID=70 | HOSTNAME=toto-PC | TENANT_ID=1 | The user <walter.bates> has executed the task [name = <Step1>, display name = <Step1>, id = <24>, parent process instance = <10>, root process instance = <10>, process definition = <6940256260942608510>]
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: username bonita
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: password ******
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: script INSERT INTO demo3 (name1)VALUES (‘[john, gerard’);
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: separator null
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: driver com.mysql.jdbc.Driver
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: url jdbc:mysql://192.168.2.24:3306/test
2016-02-23 10:04:10.420 +0000 org.bonitasoft.connectors.database.jdbc.JdbcConnector org.bonitasoft.connectors.database.jdbc.JdbcConnector setInputParameters
INFOS: outputType null